Event Types

Item Event Type allows to subscribe to specific system events like “OnAfterAdd”, “OnAfterUpdate”, “OnAfterDelete”, “OnAfterCopy”, “OnAfterPromote” and “OnAfterVersion”. Every time an appropriate system event occurs, an EHF Item Event is generated and added to the publishing events queue.

Warning
Since the publishing queue is in the server memory, it will be lost if the Aras Innovator server is restarted.

The following steps outline the process of creating an Item Event Type:

  1. On the Subscription form, click Edit.
  2. From the Subscription form, scroll down to the Event Types tab and click New Event Type.

    The Select Item Type dialog box appears.

  3. Select Item Event Type and click OK.

    A new row appears on EventTypes tab.

  4. Right-click on the newly added row and click Open.

    The Item Event Type form appears.

  5. In the ItemType field, enter the ItemType.

  6. From the Item Server Event, select the appropriate system event that needs to be subscribed.

    As a part of Event Handling Framework, Aras provides the following Item Server Events:

    • onAfterAdd.v1: The event occurs after an Item is added to the database.
    • onAfterCopy.v1: The event occurs after an Item is copied.
    • onAfterDelete.v1: The event occurs after an Item is deleted.
    • onAfterPromote.v1: The event occurs after an Item is promoted to the next state.
    • onAfterUpdate.v1: The event occurs after an Item is updated in the database.
    • onAfterVersion.v1: The event occurs after an Item is versioned.

    The server automatically generates the Event Name.

  7. Add the event description in the Description field.
  8. Click Done to save.

    The Handled By tab displays all Event Handlers that process this Item Event Type grouped by Subscription. The Event Handlers are visible only when the Event Type is linked to the Event Handler using Subscription. Make sure to save the Subscription item; otherwise, the Subscription will not be visible.

  9. Click Refresh to view the Subscription and linked Event Handler.

    Creating an Item Event Type will inform Aras Innovator when a specific event occurs and add the event data to the publishing queue for publication.

    The following example displays the Item Event Type data that will be added to the publishing queue:

    <Item>

    <data>

    <Item type="Part” id="04850C519DFD45F0A994961CA0F843CD” />

    </data>

    <subject>04850C519DFD45F0A994961CA0F843CD</subject>

    <type>com.aras.innovator.items.Part.onAfterAdd.v1</type>

    <id>C4187AA25AFC4C5E97607EF082ED297F</id>

    <time>2024-08-26T12:26:31.8746280Z</time>

    <source>14_0_15_37629@http://localhost/InnovatorServer_14_0_15_37629</source>

    <datacontenttype>application/aml+xml</datacontenttype>

    </Item>

    where:

    • data – Contains information about the item that triggered the system event.
    • subject – Event subject containing the item’s id that triggered the system event.
    • type – The type property contains the name of the Item Event Type.
    • id – Unique event id.
    • time – UTC time when the event was generated.
    • source – Contains information about event source in the form of <database name>@<innovator_server_url>.
    • datacontenttype – Content type of data value.