Forum Discussion
2 Replies
- Former_MemberIdeator IHi 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.
- eli_donahueNew MemberHi 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