Sunteți pe pagina 1din 12

Infosys

Understanding Agents in OTM

Infosys

Understanding Agents In Otm


26th September, 2012

INFOSYS LIMITED

Pune

Document No. Ver. Rev. :

Authorized by: Anupam Agrawal Signature/:

Date:

©2012 Infosys Limited, India


Infosys

Understanding Agents in OTM

COPYRIGHT NOTICE

©2012 Infosys Limited, Bangalore, India. All rights reserved. Infosys believes the information
in this document is accurate as of its publication date; such information is subject to change
without notice. Infosys acknowledges the proprietary rights of other companies to the
trademarks, product names and such other intellectual property rights mentioned in this
document. Except as expressly permitted, neither this document nor any part of it may be
reproduced, stored in a retrieval system, or transmitted in any form or by any means,
electronic, mechanical, printing, photocopying, recording or otherwise, without the prior
permission of Infosys Technologies Limited and/or any named intellectual property rights
holders under this document.

Infosys Limited
Hosur Road
Electronic City, 3rd Cross
Bangalore 560 100
India.
Telephone: (91) (80)28520 261-270
Fax: (91) (80) 8520 362
Website: http://www.infosys.com

©2012 Infosys Limited, India


Infosys

Understanding Agents in OTM

Author : Anupam Agrawal

Date written (MM/DD/YY) : 09/26/2012

Project Details

Project(s) involved : ESOPUSEZ

H/W Platform : NA

S/W Environment : NA

Application Type : Oracle Transportation Management

Project Type : Shipment Optimizer

Target readers

All

Keywords

OTM, Agents, Best Practices

Prerequisite

NA

©2012 Infosys Limited, India


Infosys

Understanding Agents in OTM

Table of Contents

1.0 Introduction ................................................................................. 5


2.0 When are they triggered? .............................................................. 6
3.0 Parts of Agents ............................................................................. 9
4.0 Some Good Practices to be followed while building an Agent ............ 11
5.0 References ................................................................................. 12

©2012 Infosys Limited, India


Infosys

Understanding Agents in OTM

1.0 Introduction

Automation Agent, a powerful tool in Oracle Transportation Management, is capable of


automating complicated business processes. An automation agent listens and proactively
responds for an OTM event. It also verifies a user-defined condition, and executes one or
more statements which are written in the actions tab. For example, an agent can be created
that listens to any change in the order, it then copies the changes to order release and can
send out a notification to the concerned parties. An agent can do large number of action
depending on the object type, some of the applications of agent are:

 Copying Refnum/Remarks from Order Base to Order Release to Shipment


 Creating an Order Release corresponding to an Booking or a Shipment corresponding to an Order
Release
 Validating a business requirement
 Setting indicators
 Setting statuses
 Notifying a user based on condition
 Checking business conditions and modifying refnums
 send the order base in XML format to an involved party
 And many set of other activities….

An agent works for specific business objects like order base, order release, shipment etc.,
they are triggered by a pre-defined events associated with these business objects. It also
checks pre-set user conditions and perform a set of instruction as actions. I can also take
necessary actions and notify the concerned party in case an error occurs during the normal
processing of the agent.

©2012 Infosys Limited, India


Infosys

Understanding Agents in OTM

2.0 When are they triggered?

1. When an OTM defined Event occurs, respective agent gets triggered automatically

Here the Agent “SHIPMENT – CREATED’ is triggered when a new Shipment is created

2. Through custom Event raised in some other agent

 Define a custom event in Business Process Automation > Power Data > Event Management >
Agent Events.
 Use this Event ID in the Event field of the Agent which needs to be invoked.
 Raise this Event from any other agent, wherever require

©2012 Infosys Limited, India


Infosys

Understanding Agents in OTM

3. Through SCREENSET Actions defined in Action Manager

 Create an agent without adding an event to it

 Define a new Label by login in as DBA user in Configuration and Administration>User


Configuration>Label Manager

 Create an action under "Configuration and Administration > User Configuration > Actions Manager"
and add the label to it, also include the agent id in it.

©2012 Infosys Limited, India


Infosys

Understanding Agents in OTM

 Attach the label created in the above step to the to the respective screen set actions

 Trigger the agent by going to the respective screenset, and clicking on the action id appearing
under the Actions window

©2012 Infosys Limited, India


Infosys

Understanding Agents in OTM

3.0 Parts of Agents


 Agents header
 Actions that it can perform
 Error Handling

Agent header:

This contains following fields:

 Agent ID
 Agent Type
 Description
 Event
 Restrictions
 Saved Conditions
 Threshold Id
 User role

Agent ID - unique, try to keep it same as Event that triggers this Agent

Agent Type – like Order Base, Order Release etc. Defines the business object on which this agent is
supposed to work

©2012 Infosys Limited, India


Infosys

Understanding Agents in OTM

Description – Add a short description for describing what this agent is supposed to do (for documentation
and understanding)

Event – Can be OTM defined or user defined custom event. OTM listens for these Events, which than
triggers respective agents. These Events can be OTM defined like ORDER BASE created / ORDER BASE SHIP
UNIT updated or they can be custom defined through Business Process Automation>Event
Management>Agents Event.

Restrictions: Can be INTEGRATION/INTERNAL OR USER, depending upon the type of restriction one wants
to put on the Agent. These restrictions can be added only for an OTM defined Event and not for a custom
created event.

Saved Conditions: These are pre-defined conditions (one or more saved SQL queries) should hold true,
for the agent to get triggered. This must be used when an agent is required to action only under specific
condition.

Threshold: Thresholds can be used to tell the OTM not to trigger the agent unless the change is more than
the defined cutoff.

Run As: One can tell OTM to run the agent “as” a specific user role or using the rights of the domain.

Agent Action:

These are a set of instructions which are executed in top to down fashion once an agent is triggered.
Agents can perform large verity of action depending upon the Agent type defined in the header.

 These actions gets executed step by step in top down fashion


 The execution stops when an error is encountered or all the steps are exhausted
 Clicking on “Add Action” will give the list of actions that can be performed for the agent type
 “+” is used to add a new statement
 One can Set Indicators, Change Status, Notify contacts are among available actions
 IF.. ELSEIF .. ENDIF loop can be used to execute statements based on certain conditions
 OTM also supports nested if loop in Agents

Example:

Error Handler:

©2012 Infosys Limited, India


Infosys

Understanding Agents in OTM

Error Handler is used to define how the system should respond to an error arising during the normal
execution of an agent. Statements in Error Handler are written in similar fashion as in Action tab. They are
executed sequentially top to bottom. Most common statement is to NOTIFY the system ADMIN in case an
error is encountered while execution of the actions.

Example:

4.0 Some Good Practices to be followed while building an Agent

 Only one agent should be defined for each Event type – to avoid inconsistency of result
 Group multiple agents into one, when multiple agents need to be triggered on some event

©2012 Infosys Limited, India


Infosys

Understanding Agents in OTM

 Always use more specific agent events like ORDER RELEASE - DATES MODIFIED than generic ones
like ORDER RELEASE - MODIFIED event
 Within the agent, add different IF sections to handle different conditions or child events with
appropriate STOP action to reduce unnecessary execution overflow
 Name an agent same as Event type to avoid multiple agent acting on some ‘Event Type’
 Describe the logic/functionality of the Agent in the Description field, this is a good practice and
will help others to understand the use of the agent
 Used ‘Saved Query’ option effectively in Header tab to improve efficiency of an Agent
 Prepare a flowchart for the business requirement before building an agent
 Do not active an agent unless the entire logic is correctly written
 All public agents should be de-activated on OTM installation
 One should not delete any public agent, even if it’s not required
 Do not use a public agent directly, copy it into your domain to use it
 Use “LOG” statement followed by short description as the first line in Actions, this will help in
easily identifiable checkpoints in the system Logs, “LOG” action can also be used to describe a set
of statements
 Direct SQL update statements should be scrutinized and tested carefully for any data corruption
and performance problem
 Describe the intent of SQL in SQL Description field for Direct SQL Update action
 While checking for negative IF condition, write statement for positive IF condition and place your
logic in the ELSE part
 Use NOTIFY in error handler, to notify the admin in case of an error execution
 Use system Logs to study the execution and flow of the agent

5.0 References
 Oracle Help
 www.otmfaq.com

©2012 Infosys Limited, India

S-ar putea să vă placă și