Aras Innovator Platform

Item Mapping in the Template file

A Batch Loader template file contains a parameterized template of the AML request that is sent to the Aras Innovator server by the batch loader session for every processed row of the input data file. Parameters of the template have format @N, e.g. @1. The N number is the integer column number from left to right in the data file.

Basic Item Mapping

Below is an example of what a template file might look like for the User ItemType.

<BatchLoaderPrototype>
<Item type="User” action="add">
<login_name>@1</login_name>
<password>607920b64fe136f9ab2389e371852af2</password>
<logon_enabled>@2</logon_enabled>
<first_name>@3</first_name>
<last_name>@4</last_name>
<email>@5</email>
</Item>
</BatchLoaderPrototype>

This file could be used to add Users into Aras Innovator, like the GUI.

Note
The password has been hard coded to a specific value of ‘innovator’.

By making a couple of small changes to the file:
<BatchLoaderPrototype>
<Item type="User” where="login_name='@1'” action="merge">
<login_name>@1</login_name>
<!-- password>607920b64fe136f9ab2389e371852af2</password -->
<logon_enabled>@2</logon_enabled>
<first_name>@3</first_name>
<last_name>@4</last_name>
<email>@5</email>
</Item>
</BatchLoaderPrototype>

We make the file usable for a nightly load of user data. Notice that the password has been commented out, to prevent the batch job from overwriting the current values. Notice also, that the Item tag has a where clause included to specify how to query for existing Users. Lastly, notice that the top-level action has been changed from ‘add’ to ‘merge’. This is so that if the User in the AML sent to the server exists, then the action is to ‘edit’ the existing user. However, if the User does not exist, then the action is set to ‘add’, so that the new user is created. This is especially useful when trying to manage process such as User data uploaded from Active Directory.

Item and Relationship Simultaneous Load

Drawing from the example in the section Batch Loader Graphical User Interface, we can make an AML template that would load better represent how the Part BOM relationship should be loaded from the same sample data file.
<BatchLoaderPrototype>
<Item type="Part” where="item_number='@1'” action="edit">
<Relationships>
<Item type="Part BOM” action="add">
<related_id>
<Item type="Part” action="get” select="id">
<item_number>@2</item_number>
</Item>
</related_id>
<quantity>@3</quantity>
</Item>
</Relationships>
</Item>
</BatchLoaderPrototype>

This AML template make the additions in the context of exiting source Part Items only and forces the part data to make updates to the Part Item history, while uploading the BOM data.

Uploading a File Item

Uploading files to Aras Innovator can be done using the Batch Loader, but Aras recommends loading the File Item in the context of the source item. The following sample template allows you to load the File Item as part of loading the source Document Item. This decreases the complexity of trying to create the correct Document File relationship if the Document and File had been loaded separately.

<Item type="Document" action="add">

   <item_number>@1</item_number>

   <description>@2</description>

   <Relationships>

     <Item type="Document File" action="add">

       <related_id>

         <Item type="File" action="add">

           <actual_filename>@3</actual_filename>

           <filename>@4</filename>

           <Relationships>

             <Item type="Located" action="add">

               <related_id>67BBB9204FE84A8981ED8313049BA06C</related_id>

             </Item>

           </Relationships>

         </Item>

       </related_id>

     </Item>

   </Relationships>

 </Item>

From the AML, you can see that @1 and @2 are mapped to properties of the document item. To load the File Item, we are leveraging the standard Aras Innovator IOM. This requires that we define the following parameters, at a minimum.
On the File Item:
actual_filename (@3 above) – This is the path to the file that is to be vaulted.
Example: C:\Drawing.bmp
filename (@4 above) – This is the name of the file that for the database.
Example: Drawing.bmp

Uploading a File Item also requires the ‘Located’ relationship be defined. In the example provided, the Located relationship has a related Item of the Default vault. If the File must be vaulted to a Vault other than the Default vault, the AML template must be altered to use the id of the alternate Vault.