ADOM Item Id

Top  Previous  Next

ADOM Items are similar to the Relational table records. To update or delete an ADOM item we need an identity.

When a new ADOM Item is created with AML function Insert it is assigned an identity.

<root>
  <customers>
    <item id="1">
      <NAME>TransDai Ltd.</NAME>
      <EMAIL>info@transdai.com</EMAIL> 
    </item>
    <item id="2">
      <NAME>BuenoBoo Coorp.</NAME>
      <EMAIL>boo@buenoboo.com</EMAIL> 
    </item>
  <customers>

In the above example when referring the items of the "customers" ADOM we can make use of the id attributes. The following code can be uses to make a ProcessField that contains the ADOM item ids in a hidden input element.

<input name="pf__@id" type="hidden" value="{@id}"
       mo:type="HiddenBox" mo:name="@id" mo:field="true" mo:iValue="{@id}" />

An AML process that is configured to process the Process Block of this element can access to the ADOM Item id with f:@id symbol.

Examples:

Update(s:cart, *, *, a:@id = f:@id)

Delete(s:cart, a:@id = f:@id)