Sterling OMS Non TaskQ Agent

By | 03/07/2018

Sterling OMS Non TaskQ Agent

In this post we are going to see how to create non taskq based agent in Sterling OMS.

Sterling OMS Non TaskQ Agent

Before reading this post we suggest to read below blogs to get better understanding

Agent Server vs Integration Server

Task Q based agent example

Sterling OMS Non TaskQ Agent

When to implement with Non TaskQ Agent ?

Task Q (YFS_AGENT_Q) based agents are good for processing order or shipment with particular transaction. For example Schedule Transaction (SCHEDULE.0001) for particular order executed as taskq based agent. For task q based agent we need to implement only executeTask() method. Implementation of getJobs() method taken care by the product.

Task Q based transaction good when you have one of following key

  • OrderHeaderKey
  • OrderReleaseKey
  • ReceiptHeaderKey
  • ShipmentGroupKey
  • ShipmentKey
  • WorkOrderKey

Non Task Q agents are good for processing records which does have relationship order or shipment. For example an custom table purge has to be implemented as Non Task Q agent. For non task q based agent we need to implement getJob() and executeJob() methods.

Requirement :

  • New custom table should be created with given data structure


  • Should have option to run purge any given time or particular time interval (N Minutes)
  • Should retain N number of days records and remove remaining records

Steps involved in creating Non Task Q Agent ?

  • Create new custom table
    • Create 5 Services to access Extended Database API
    • Create Test Records into database by calling Create Service
  • Create java Class which extends YCPBaseAgent and overrides getJobs() and executeJob() methods

  • Create New Time Triggered Transaction by selecting “Do not derive from an abstract transaction”

create new transaction

  • Enter Java Class name (com.oms94.agent.CustomerPersonInfoPurgeAgent) under “Time Triggered” tab

New transaction

  • Create New Agent Server (Non Task Q Based) with name as “XYZPersonInfoPurge”

Creating new non task-q based server

weblogic queue configuration

  • Configure Runtime Properties as shown below

Agent Critera Details

  • Configure Criteria Parameters as shown below

Critera Parameter Configuration

  • Start Agent Server
    • agentserver.cmd XYZPersonInfoPurge
  • Trigger message : Required only when schedule trigger message checkbox not selected
    • triggeragent.cmd XYZ_PERSON_INFO_PURGE

XML Messages into Queue

Message Name XML Message Remarks
Trigger Message <Message FlowName=”XYZ_PERSON_INFO_PURGE” TransactionKey=”20180210002704206907″>
<MessageXml Action=”Get” NumRecordsToBuffer=”5″ RetentionDays=”2″/>
NumRecordsToBuffer and
RetentionDays from Criteria
First Get Job Method Trigger message received into getJobs()
N+1 Get Job Method <Message FlowName=”XYZ_PERSON_INFO_PURGE” TransactionKey=”20180210002704206907″>
<MessageXml Action=”Get” NumRecordsToBuffer=”2″ RetentionDays=”2″/>
<LastMessage LastMessagesAdded=”2″>
<PersonInfo PersonInfoKey=”2018021019400339207404″/>
<LastMessage> added after adding N number of execute messages.

Last fetched execute message PersonInfoKey been added in LastMessage

Execute Job Method <?xml version=”1.0″ encoding=”UTF-8″?>
<PersonInfo PersonInfoKey=”2018021000574424207023″/>

We will create another post to explain in detail how getJobs() and executeJob() methods works.

Interview Questions

What are all the different ways to do trigger message ?

  1. Agent Criteria Run time parameters, Select “Schedule Trigger message” checkbox and enter time for automatic trigger
  2. triggeragent.cmd <Criteria Parameter>
  3. By calling triggerAgent standard API with transaction name

How multi-thread works in case of non-task-q based implementation ?

  • getJobs() : Always single thread; lock created using YFS_OBJECT_LOCK table entry
  • executeJob() : Multiple Thread; Thread count based on configuration

Is it possible to override the criteria parameters when using triggerAgent ?

  • Only for few transactions (Example : RTAM) user can override the  criteria parameters from command line

What happens when triggerAgent been called with Criteria Name and agent server is not running ?

  • Trigger message generated and stays in queue (As per agent runtime properties configuration)
  • Next time when agent server starts, trigger message fired

Non-TaskQ based agent supports multi-thread and multiple-instances ?

  • Yes, multi-thread and multiple-instance supported by Non-TaskQ based agent

Register with us to get more updates

OMS Interview Questions

11 thoughts on “Sterling OMS Non TaskQ Agent

  1. Sneha

    Please explain how a taskq agent works as well. During creation , schedule and other transaction how the taskq table gets populated and how is the available date maintained.

    1. admin Post author

      Sure will update same in another post. thanks for your comment

      1. Sneha

        Thank you. Getting to learn a lot from here.
        Really helpful.

        1. admin Post author

          Thanks lot for your response and support. Lets share and learn together. Happy Learning

  2. kaviarasu

    The article is good.

    Can you please post about thread behavior for both task and non task q based agents

    1. admin Post author


      Agent Server : getJobs() — always single threaded and executeJobs() multiThreaded
      Integration Server : For every thread count new object will be created

      Hope this helps. Happy Learning !!!

  3. Ankit

    How does record come into yfs_taskQ table for a custom agent. Where do we configure that?

  4. Pingback: Sterling OMS How to override Agent Criteria parameter runtime ? - Learn IBM Sterling Order Management System

  5. Chetan

    A getJobs thread holds a lock for a particular criteria in yfs_object_lock table? How can we know an agent has locked it currently from the table?

    1. admin Post author


      Really sorry for delayed response.

      This table lock happens very quickly and get released faster. If you try to run SQL command in database
      select * from yfs_object_lock where for update;

      if lock already taken, above command will fails. This way you can easily find any lock occurred or not.

      Hope helps !!!


Leave a Reply

Your email address will not be published. Required fields are marked *