AML code needed to load Requirements Engineer items

I am trying to batch load a series of requirements from another system into Requirement Engineering. I have been able to create a item using the following code.

<AML>
<Item type="re_Requirement" action="add">
<classification>Text</classification>
<global_version>34012</global_version>
<req_complexity>Low</req_complexity>
<req_document_type>8DF7037346A64816B8BBD8700AFCFE15</req_document_type>
<managed_by_id>EA1E67E3DD2340CEA4D49E1670AFBCE0</managed_by_id>
<req_title>Batch load test3</req_title>
<req_priority>Low</req_priority>
<req_risk>Low</req_risk>
</Item>
</AML>

Where it is failing is when I add in the <content> tag information.

<content xml:lang="en">Aras Review

Document Control
11977 and 12666| This goes hand and hand

15964 Aras or Scale?

13207 Does Scale need Legacy classification/Remove</content>

I can see there is other coding tags needed to format the text but do not know how or what coding is needed. Can someone share a example or a process on how to complete this task.

  • Thanks for the response, here is the error message I receive

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Body>
    <SOAP-ENV:Fault xmlns:af="http://www.aras.com/InnovatorFault">
    <faultcode>SOAP-ENV:Server</faultcode>
    <faultstring>
    <![CDATA[Data at the root level is invalid. Line 1, position 1.]]>
    </faultstring>
    <detail>
    <af:legacy_detail>
    <![CDATA[Data at the root level is invalid. Line 1, position 1.]]>
    </af:legacy_detail>
    <af:exception message="Data at the root level is invalid. Line 1, position 1." type="System.Xml.XmlException"/>
    </detail>
    </SOAP-ENV:Fault>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

  • Hi

    Can you try with below


    <AML>
    <Item type="re_Requirement" action="add">
    <classification>Text</classification>
    <global_version>34012</global_version>
    <req_complexity>Low</req_complexity>
    <req_document_type>8DF7037346A64816B8BBD8700AFCFE15</req_document_type>
    <managed_by_id>EA1E67E3DD2340CEA4D49E1670AFBCE0</managed_by_id>
    <req_title>Batch load test3</req_title>
    <req_priority>Low</req_priority>
    <req_risk>Low</req_risk>
    <content>Aras Review

    Document Control
    11977 and 12666| This goes hand and hand

    15964 Aras or Scale?

    13207 Does Scale need Legacy classification/Remove</content>
    </Item>
    </AML>

    It it doesn't work, try removing special characters in content tags

  • Gopikrishnan

    I tried your sugguestion and the Requirement item was created without any errors. But the text in the <content> tags was ignored. See sample of content tag data.

    <content xml:lang="en">&lt;RequirementText aras:id="0fddf12f26304b82b916cfb8c2f18e22" reqId="C2D3C4A12EC340CF89B6C40A8390FF00" xmlns:aras="http://aras.com/ArasTechDoc" xmlns="http://www.aras.com/REStandard"&gt;&lt;Requirement-Info aras:id="f5f3f187e804454796564866249721c5"&gt;&lt;Requirement-Chapter aras:id="a4d94950d4bb4dcd8385229a5c3883bd"&gt;&lt;aras:emph&gt; &lt;/aras:emph&gt;&lt;/Requirement-Chapter&gt;&lt;Requirement-Title aras:id="e15e247fc81a4237ada1608b173d09d3"&gt;&lt;aras:emph&gt; &lt;/aras:emph&gt;&lt;/Requirement-Title&gt;&lt;Requirement-Number aras:id="66bfd75999174ed0bf2bdf4d6e08cbfe"&gt;&lt;aras:emph&gt;Server Assigned&lt;/aras:emph&gt;&lt;/Requirement-Number&gt;&lt;/Requirement-Info&gt;&lt;/RequirementText&gt;</content>

    Any thoughts?

  • Can you share the data type of content field. Open Item type and check the properties. Also can you run a get query of this item and share the output?

    <AML>
    <Item type="re_Requirement" action="get" maxRecords="1">
    </Item>
    </AML>

  • Gopikrishnan

    Here are two sample of the data. The first I created by hand and has the text included. The second was batch loaded and is mssing the desired text.

    Thanks for your help

    Created by hand

    <Item type="re_Requirement" typeId="55515617CB224C90AB5A9DAC0F061C2A" id="B3988DD302C04F579C8602194B593111">
    <classification>Text</classification>
    <config_id keyed_name="REQ-000000193" type="re_Requirement">B3988DD302C04F579C8602194B593111</config_id>
    <content xml:lang="en">&lt;RequirementText xmlns:aras="http://aras.com/ArasTechDoc" xmlns="http://www.aras.com/REStandard" aras:id="649a35dc685143adabc376a821d3edcc" reqId="B3988DD302C04F579C8602194B593111"&gt;&lt;Requirement-Info aras:id="4fdbc2cde17c41ad8876c0db95ef67a9"&gt;&lt;Requirement-Chapter aras:id="a925172ab3d34b9dbe27c2f9a0f1ee07"&gt;&lt;aras:emph&gt;&lt;/aras:emph&gt;&lt;/Requirement-Chapter&gt;&lt;Requirement-Title aras:id="919336ce4b86461c88108b457a08e9f0"&gt;&lt;aras:emph&gt;Batch load test&lt;/aras:emph&gt;&lt;/Requirement-Title&gt;&lt;Requirement-Number aras:id="43a72ffa68d0499e9863e7e48a2e88bd"&gt;&lt;aras:emph&gt;REQ-000000193&lt;/aras:emph&gt;&lt;/Requirement-Number&gt;&lt;/Requirement-Info&gt;&lt;Text aras:id="09DE62844E2742CB8975221DCF2C1190"&gt;&lt;aras:emph xmlns=""&gt;Aras Review

    Document Control
    11977 and 12666| This goes hand and hand

    15964 Aras or NuScale?

    13207 Does NuScale need Legacy classification/Remove&lt;/aras:emph&gt;&lt;/Text&gt;&lt;/RequirementText&gt;</content>
    <created_by_id keyed_name="Gregg Teachout" type="User">2C48DCD3BFE9492C997F095DB7E07946</created_by_id>
    <created_on>2020-04-03T10:36:09</created_on>
    <current_state name="Draft" keyed_name="Draft" type="Life Cycle State">AB4D30EE178C4EEAA960FD6ACA24C488</current_state>
    <generation>1</generation>
    <global_version>34131</global_version>
    <id keyed_name="REQ-000000193" type="re_Requirement">B3988DD302C04F579C8602194B593111</id>
    <is_current>1</is_current>
    <is_released>0</is_released>
    <keyed_name>REQ-000000193</keyed_name>
    <major_rev>A</major_rev>
    <managed_by_id keyed_name="Gregg Teachout" type="Identity">EA1E67E3DD2340CEA4D49E1670AFBCE0</managed_by_id>
    <modified_by_id keyed_name="Gregg Teachout" type="User">2C48DCD3BFE9492C997F095DB7E07946</modified_by_id>
    <modified_on>2020-04-03T10:37:44</modified_on>
    <new_version>0</new_version>
    <not_lockable>0</not_lockable>
    <permission_id keyed_name="RE Draft Requirement" type="Permission" origPermission="DBC0F24E1FE44C7DB7173090B813F7D9">DBC0F24E1FE44C7DB7173090B813F7D9</permission_id>
    <req_complexity>Low</req_complexity>
    <req_document_type keyed_name="RE-Standard" type="tp_XmlSchema">8DF7037346A64816B8BBD8700AFCFE15</req_document_type>
    <req_priority>Low</req_priority>
    <req_risk>Low</req_risk>
    <req_title>Batch load test</req_title>
    <state>Draft</state>
    <item_number>REQ-000000193</item_number>
    <itemtype>55515617CB224C90AB5A9DAC0F061C2A</itemtype>
    </Item>


    created by Batch loaded

    <Item type="re_Requirement" typeId="55515617CB224C90AB5A9DAC0F061C2A" id="BAB09EE15869453498C8E1DDA01D1361">
    <classification>Text</classification>
    <config_id keyed_name="REQ-000000198" type="re_Requirement">C2D3C4A12EC340CF89B6C40A8390FF00</config_id>
    <content xml:lang="en">&lt;RequirementText xmlns:aras="http://aras.com/ArasTechDoc" xmlns="http://www.aras.com/REStandard" aras:id="0fddf12f26304b82b916cfb8c2f18e22" reqId="C2D3C4A12EC340CF89B6C40A8390FF00"&gt;&lt;Requirement-Info aras:id="f5f3f187e804454796564866249721c5"&gt;&lt;Requirement-Chapter aras:id="a4d94950d4bb4dcd8385229a5c3883bd"&gt;&lt;aras:emph&gt;&lt;/aras:emph&gt;&lt;/Requirement-Chapter&gt;&lt;Requirement-Title aras:id="e15e247fc81a4237ada1608b173d09d3"&gt;&lt;aras:emph&gt;Batch load test4&lt;/aras:emph&gt;&lt;/Requirement-Title&gt;&lt;Requirement-Number aras:id="66bfd75999174ed0bf2bdf4d6e08cbfe"&gt;&lt;aras:emph&gt;REQ-000000198&lt;/aras:emph&gt;&lt;/Requirement-Number&gt;&lt;/Requirement-Info&gt;&lt;Text aras:id="0A42E1B60EA94B6F8DA8943206A5B02B"&gt;&lt;aras:emph xmlns=""&gt;Aras Item&lt;/aras:emph&gt;&lt;/Text&gt;&lt;/RequirementText&gt;</content>
    <created_by_id keyed_name="Gregg Teachout" type="User">2C48DCD3BFE9492C997F095DB7E07946</created_by_id>
    <created_on>2020-04-07T10:09:58</created_on>
    <current_state name="Draft" keyed_name="Draft" type="Life Cycle State">AB4D30EE178C4EEAA960FD6ACA24C488</current_state>
    <generation>3</generation>
    <global_version>34089</global_version>
    <id keyed_name="REQ-000000198" type="re_Requirement">BAB09EE15869453498C8E1DDA01D1361</id>
    <is_current>1</is_current>
    <is_released>0</is_released>
    <keyed_name>REQ-000000198</keyed_name>
    <major_rev>A</major_rev>
    <managed_by_id keyed_name="Gregg Teachout" type="Identity">EA1E67E3DD2340CEA4D49E1670AFBCE0</managed_by_id>
    <modified_by_id keyed_name="Gregg Teachout" type="User">2C48DCD3BFE9492C997F095DB7E07946</modified_by_id>
    <modified_on>2020-04-07T18:09:11</modified_on>
    <new_version>0</new_version>
    <not_lockable>0</not_lockable>
    <permission_id keyed_name="RE Draft Requirement" type="Permission" origPermission="DBC0F24E1FE44C7DB7173090B813F7D9">DBC0F24E1FE44C7DB7173090B813F7D9</permission_id>
    <req_complexity>Low</req_complexity>
    <req_document_type keyed_name="RE-Standard" type="tp_XmlSchema">8DF7037346A64816B8BBD8700AFCFE15</req_document_type>
    <req_priority>Low</req_priority>
    <req_risk>Low</req_risk>
    <req_title>Batch load test4</req_title>
    <state>Draft</state>
    <item_number>REQ-000000198</item_number>
    <itemtype>55515617CB224C90AB5A9DAC0F061C2A</itemtype>
    </Item>

  • The challenge with using the batch loader for adding Requirements, as part of Requirements Engineering, is that there is an onBeforeAdd server method that generates the data for the <content>...</content> property. The data for the <content>...</content> is taken from the <item_number> and <req_title> properties.

    So the <contents>...</contents> property seems to be overwritten by the server event, thus not considering any inputs from the batch loader.

    A small change to the onBeforeAdd method could allow further fields to be added to the Requirement - a Description field for example.

    But I do not have the experience to update this method.

    Further investigation has identified a high-risk method of automatically adding a 'Title' and 'Text' elements to a already defined re_Requirement. Use SQL (via applySQL or SQL Server Management Studio).

    The <content>...</content> from an existing pro-forma requirement can be inserted into an existing re_Requirement table record. The results present, and are editable.

    For example, 

    1. Create a pro-forma template of the re_Requirement manually. With the addition of a Title block and a Text block, the database record is

    <Requirement aras:id="06915ffbc3bd4f3a9f341b16e94857d1" reqId="696D862F9799459D987B3D63D86FC249" xmlns:aras="">http://aras.com/ArasTechDoc" xmlns="">www.aras.com/REStandard"><Requirement-Info aras:id="a8b2b599b8244e738845a2272e0f2176"><Requirement-Chapter aras:id="5a7f493f2f504bd39b3ddf6b20500bbf"><aras:emph> </aras:emph></Requirement-Chapter><Requirement-Title aras:id="2ac08c9e494244e19f2d45269d0aa66e"><aras:emph>RiF Test item 3</aras:emph></Requirement-Title><Requirement-Number aras:id="9572d3bca90a467d9f036356ea5eb1e2"><aras:emph>REQ-000000012</aras:emph></Requirement-Number></Requirement-Info><Title aras:id="1ACDBF2AB9D74A9B89BB6175FDA7AABc" ><aras:emph xmlns="">Description</aras:emph></Title><Text aras:id="C46ABE3370A34C4C85FE33C2A28E630e"><aras:emph xmlns="">This is the description of the Requirement</aras:emph></Text></Requirement>

    2. The textual content of 

    <Title aras:id="1ACDBF2AB9D74A9B89BB6175FDA7AABc" ><aras:emph xmlns="">Description</aras:emph></Title><Text aras:id="C46ABE3370A34C4C85FE33C2A28E630e"><aras:emph xmlns="">This is the description of the Requirement</aras:emph></Text>

    Can be inserted into the <contents> field for a re_Requirement that has been created using AML (for example) or the GUI without extra fragments.

    Until ARAS provides a better approach for programmatically generating extra content, the method may be used with caution.