Forum Discussion

Former_Member's avatar
Former_Member
Ideator I
9 years ago

Relation Insertion for multi user environment.

Hi, I am trying following use case for relation insert. I have created 2 parts: Part 1-  item_number = TestPart1 Part 2- item_number = TestPart2 Let's assume that ids for above parts are: TestPart1 = 'id1' TestPart2 = 'id2' Now to insert Part BOM relation between these two parts I have fetched both the objects . So now I have id1 & id2. After fetching both objects , I am trying following AML to insert relation. <AML> <Item type="Part BOM" action="add" > <source_id> id1 </source_id> <related_id> id2 </related_id> </Item> </AML> But before I execute above AML , some other user has updated TestPart2. So latest id for TestPart2 = 'id2' For this scenario I have following questions : 1) How does aras handles this case ? 2) Does it allow to insert relation in this case ? 3) What will happen if source part i.e TestPart1 is updated before executing relation insert query? 4) Is there any construct in AML where I can specify to pick latest generation of the source and related part ? Thanks for reply ! -Ketan.

1 Reply

  • Ketan, Just use following AML and this will solve your problem:
    <AML> <Item type='Part' action='add'> <item_number>TestPart1</item_number> <Relationships> <Item type='Part BOM' action='add'> <related_id> <Item type='Part' action='add'> <item_number>TestPart2</item_number> </Item> </related_id> </Item> </Relationships> </Item> </AML>