Forum Discussion

Former_Member's avatar
Former_Member
Ideator I
9 years ago

Transaction boundary support in aras

Hi , Does aras innovator provides transaction boundary support ? Use case : consider I want to create a BOM of 10 Parts. Now I inserted 7 parts and for 8th part it failed to insert. So can we rollback the complete transaction ? Thanks for reply! -Ketan

2 Replies

  • Hi Eli, Thanks for reply ! The method that you suggested works fine. But the API that I am currently using to insert parts does not get all the parts at the same time. It is called again and again to insert single part at a time. For example : If I have three Parts TestPart1 , TestPart2 , TestPart3. Then the API is called three times. So currently it is not possible to get all the objects at same time and add them to single ApplyAML tag. Is there any other way to achieve transaction boundary in this scenario ? Thanks ! -Ketan.
  • Hi Ketan, If you add all Parts/Part BOM items within one AML statement, the whole statement will either succeed or roll back. Ex:
    <AML>
      <Item type="Part" action="edit" id="...">
        <Relationships>
          <Item type="Part BOM" action="add">
            <related_id>
              <Item type="Part" action="get">
                <item_number>Part-0002</item_number>
              </Item>
            </related_id>
          </Item>
          <Item type="Part BOM" action="add">
            <related_id>
              <Item type="Part" action="get">
                <item_number>Part-0003</item_number>
              </Item>
            </related_id>
          </Item>
          ...
          ...
        </Relationships>
      </Item>
    </AML>

    Eli Donahue Aras Labs Software Engineer