Dances with Agents

MavenWire
Dance with Agents
Building High Efficiency OTM Workflow
Presented by Milind Anerao
1
Agenda









Agent Overview
How Agent works
Header
Actions
Using Agents Effectively
Debugging
Workflow Automation
Best Practices
Q&A
2
What is an Agent?
• Automation Agent Characteristics
–
–
–
–
–
–
Objects that constantly listen for occurrence of event
Perform specific set of actions upon occurrence
Integral part of OTM implementation
Essential for workflow automation
Can be very simple like sending email when tender is accepted
Can be complex cluster of Agents linked together
3
Who Can Write an Agent?
• Anybody
– With OTM Navigation skills
– Basic understanding of OTM objects
• What it takes to write better Agent
–
–
–
–
–
–
–
Some experience in programming development
Knowledge of PL/SQL
Business knowledge of logistics operation
Clear understanding of OTM concepts
Good understanding of OTM table structure
Cache Concept
Design with exception management
Internal Use ONLY
4
What Can an Agents Do?
 Common reasons for writing an Agent
• Workflow automation
• Copying data from one object to another (e.g. RefNums)
• Tendering process
• Sending Integration to external system
• Shipment Events/Tracking Events
• Perform steps beyond OTM standard functionality
• Exception Handling
• Data Validation and Correction
5
Agent Header
6
Agent Header Tab
 Header
• Agent Type
– Indicates business object for which Agent is created
– Determines event and action available
• Events
– Decides when the agent should trigger
– Restrictions further narrow down the triggering
• Save Conditions and Threshold
– Another way to filter execution of agent steps
– Helps reduce IFs in agent actions
Company Confidential
7
Events
8
Restrictions
9
Understanding Actions
Non Technical
Technical
















Assign Equipment
Build Shipment
Notify Contact
Change Mode
Change Service Provider
Set Indicator
Withdraw Tender
Recalc Shipment
IF/Elsif/Endif
Assignee Variable
For Loop
Direct Sql Update
Assign Variable
Send Integration
Raise Error
Raise Event
10
Sample Actions
11
Using Agents Effectively
 Power of FOR loop
 DSU can take you beyond OOB
 Running Agents on Demand
 Using Agents With Other Objects
Company Confidential
12
Power of FOR Loop
13
OOB Actions vs. DSU
14
Running Agent On Demand
15
Using Agents with Other Objects
16
Debugging the Agent
• Notify Contact Action
• Log Action
• Error Handling
17
Workflow Automation
Workflow Automation
ERP
Revised 08/19/2012
START
ERP To OTM Release
Interface
Integration
Carrier
Transportation Planner/Execution Team
OTM
Integration
Order Release
Created in OTM
Agent on event
‘RELEASE-CREATED’
will perform ‘BUILD
SHIPMENT’ action
Planner Reviews
Shipment and
Approve for
Execution
Shipment Created
Agent on event
‘SHIPMENT CREATED’ will
perform ‘SEND
INTEGRATION’
action to send
Shipment Info To
ERP
Agent on event
‘SHIPMENT APPROVE FOR
EXECUTION’ will
check IF Mode is TL,
will Perform
‘SECURE RESOURCE
ACTION’ ELSE
perform ‘ACCEPT
TENDER’ Action
Receive Tender
Tender Accepted
Agent on event
‘SHIPMENT TENDER
- ACCEPTED’ will
check if Mode is TL,
will Perform ‘SEND
NOTIFICATION’ else
perform ‘ACCEPT
TENDER Action
Interface EDI 990
Interface EDI 204
Accept Tender
18
Agent Limitations
•
•
•
•
•
DSU size limit – 800 characters
Migration between instance is cumbersome
Moving lines within agent requires re-typing
Lack of version management
Commit after each Action
– Makes error handling challenging
– No auto rollback
19
Best Practices
• Never write Agents in Public domain
• Never modify Public Agent
– Instead copy the Agent in your domain and modify it
• Avoid writing multiple Agents on same event
– Instead Raise custom events from master Agent
• Always write Error Handling Actions
• Use saved condition in the header to restrict the triggering
– It helps reduce If statements in the Action tabs
• Use PL/SQL block to take care of complex logic
• Create workflow diagram before working on Agents
– It will help you avoid duplication of Agent action
• Choose user friendly names for saved conditions
• Write comments with action for better readability
• Keep Agents in all instances synced
20
Q&A
21
Thank You For Attending
Presentation By:
Milind Anerao
MavenWire LLC
Cell: + 1 919 457 7766
Email: [email protected]
22