August 15, 2016

Agents - Agent Event Restrictions

In Agents, "Event Restrictions" give us more control on what type of transactions agent should be triggered and also perform some pre- transaction commit validations(if required) on inbound XML transactions.

We can access this by clicking the "i" icon as show below:


You will see below options:



Source: You select this value based on below requirements(Order Release examples discussed)

INTEGRATION: If you are receiving Order Release transaction from an external system via GlogXML element and if you want your Agent logic to trigger only for this type of transactions, you select 'INTEGRATION' as the source. Only Order Releases uploaded to OTM via XMLs will trigger this agent.

INTERNAL: If you want to trigger your agent logic only when Order Release is created by standard OTM internal actions like "RELEASE ORDER BASE", you use this source as INTERNAL.

USER: If you want to trigger your agent logic only when Order Release is manually keyed-in by user within OTM system, we use this source.

Before Persist: We can use this option to perform some validations on the inbound XML, before committing the transaction to database.

Example Usage: Validate some elements/data in the input PO xml before committing (creating) PO in the OTM DB/application.
Suppose that, integration layer is generating OTM XML and you want to ensure you create PO only if following reference number ‘SOURCE_SYSTEM’ exists  - you can do following:

Create below agent:



In the Restrictions section, “Check” Before Persist box as shown below:



Note that once you select ‘Before Persist’, list of actions that appear in the Agent-Actions will vary. They will not be same as standard set of ORDER BASE – CREATED actions.



Expression : #OB_REFNUM/OB_REFNUM_QUAL_GID<>DOMAIN.SOURCE_SYSTEM

By using this expression we are checking if source system refnum exists in the XML and  if refnum is not existing, we are using standard action ‘DON'T PERSIST’ meaning don’t commit/CREATE the PO.

Now upload PO XML, by ensuring we don’t have the refnum SOURCE_SYSTEM.
You will see the transmission in PROCESSED state,but Order Base record is not created in the system.


 
If you repeat this case  by adding the refnum, Order Base record would be created.
So this feature might be used to perform some custom validations on the data coming from other systems to OTM.

2 comments:

  1. very useful information

    ReplyDelete
  2. Hi

    please let me know what is the user of before persist

    ReplyDelete