Aras Innovator Platform

AML

AML is the XML dialect and language that drives the Aras Innovator server. Clients submit AML documents to the Aras Innovator server via HTTP. The server parses the AML applying the business logic defined as the action attribute for the Items in the AML document, and an AML document is returned. The AML dialect is very simple. The following sections describe the tags that define the AML language:

The <Item> tag defines an Item instance. XML is case-sensitive (notice the capitalized Item.) There are three principal attributes for the Item tag to define the Item instance:

  • id – the unique ID for the Item.
  • type – the ItemType name for the Item.
  • action – the name of the Method that is applied to the Item.

There are other attributes, but these are the most significant. They define the Item and the action to apply on it. The following is an AML query example requesting a Part Item by ID:

<Item type="Part” id="ACBDEF0123456789…" action="get"/>

Refer to section 5.2 Built in Action Methods for the list of Aras Innovator pre-built actions.

Items can have relationships to other Items. The <Relationships> tag is a container tag that holds the set of relationship Items. Notice the capitalized Relationships. There are no attributes for the tag because it is a container. With relationships it is possible to describe an Item configuration to any level deep as necessary.

The following is an AML query example requesting a Part Item and its BOM relationships:

<Item type="Part” id="ACBDEF0123456789…" action="get">
 <Relationships>
 <Item type="BOM” action="get"/>
 </Relationships>
</Item>

Properties for the Item are the nested tags directly below the <Item> tag. The Property name is the tag name. For example, a ‘Part’ ItemType may have the properties: item_number, description, and cost, which are also the tag names in the AML. Property names are lowercase, so the property tag names are also lowercase.

The following AML illustrates a simple Item configuration for describing a Part-to-Part BOM relationship:

<Item type="Part” action="add">
 <item_number>999-888</item_number>
 <description>Some Assy</description>
 <Relationships>
 <Item type="Part BOM” action="add">
 <quantity>10</quantity>
 <related_id>
 <Item type="Part” action="add">
 <item_number>123-456</item_number>
 <description>1/4w 10% 10K Resistor</description>
 </Item>
 </related_id>
 </Item>
 </Relationships>
</Item>

Property values always use locale-neutral formats. Decimal and float values use the period symbol (.) as the decimal separator and no digit separator (i.e. commas separating thousands). The dash symbol (-) is used to denote a negative value. Date/Time values should be in ‘YYYY-MM-DD[Thh:mm:ss]’ format and in the local (or corporate) time zone. Language-specific values use the xml:lang attribute to specify the language code. For example:

<Item type="Part">
 <item_number>292-102</item_number>
 <i18n:name xml:lang="de” xmlns:i18n="http://www.aras.com/I18N">Rad</i18n:name> 
 <i18n:name xml:lang="en” xmlns:i18n="http://www.aras.com/I18N">Wheel</i18n:name> 
 <cost>232.13</cost>
 <created_on>2008-08-24T08:12:02</created_on>
</Item>

Properties are used to define the data for an Item. Attributes are meta-data for the Item or Property. They are used to control the server logic and Methods. Think of attributes like command line switches, or as arguments to a function.

In addition to the type, id, and action attributes mentioned above there are several additional attributes used to control the server. The following is the attribute reference for the <Item> tag:

Item Attributes

Attribute

Type

Usage

type String The ItemType name for which the Item is an instance.
id String The unique ID value for the Item instance.
where String Used instead of the id attribute to specify the WHERE clause for the search criteria. Include the table name with the column name using the dot notation: where=‘user.first_name like ‘Tom%'‘
action String The name of the Method (or Built in Action Method) to apply to the Item.
doGetItem Boolean If 0 then do not perform a final get action on the Item after the server performed that action as defined by the action attribute. Default is 1.
Used with action="get” Used with action="get” Used with action="get”
select String A comma delimited list of property names (column names) to return which is the SELECT clause in the SQL statement.
orderBy String A comma delimited list of property names (column names) to order the results and is the ORDER BY clause in the SQL statement.
page Integer The page number for the results set.
pagesize Integer The page size for the results set.
maxRecords Integer This defines the absolute maximum Items to be searched in the database.
levels Integer The Item configuration depth to be returned. This should be used with caution because of the performance hit due to its lack of granularity in the data fetched. Use the nested Relationships style of defining your queries to do the same thing but with far greater performance.
serverEvents Boolean If 0 then disable the server events improving performance. Default is 1.
isCriteria Boolean If 0 then include the nested structure for the Item configuration in the response but don’t use it as search criteria. Default is 1, which uses the nested structure in the request as search criteria.
related_expand Boolean If 0 then do not expand the related_id Property for the relationship Items to include the related Item. Another word returns its ID.
language String A comma-delimited list of language codes, or "*" to return all languages. Multilingual property values are returned (if present) for all specified languages.
Used with action="update” | “edit” Used with action="update” | “edit” Used with action="update” | “edit”
version Boolean If 0 then don’t version an Item on update. Default is 1, which is version the Item (if it’s a versionable Item) on update.
serverEvents Boolean If 0 then disable the server events improving performance. Default is 1. Only ‘Update’ events are disabled, ‘Lock’ events can be executed if using ‘Edit’.

Property Attributes

Attribute

Usage

type The ItemType name for the item instance.
keyed_name This is the keyed_name Property for the Item referenced by the Item type Property.
condition This is the condition value for the AML query. The condition value is any valid SELECT condition supported by the database. The following is the list of possible condition values:
Xml:lang Language code for multilingual properties. You must use this in conjunction with the internationalization namespace on the property tag. For example: <i18n:name xml:lang="de” xmlns:i18n="">Rad</i18n:name>