Creating custom task-based, time-triggered transactions

Task-based custom time-triggered transactions are written as subclasses of the com.yantra.ycp.japi.util.YCPBaseTaskAgent class, which is a subclass of com.yantra.ycp.japi.util.YCPBaseAgent with the getJobs() and executeJob() functions already implemented. Creating a task-based custom time-triggered transaction by subclassing this class involves implementing the executeTask() function to process one task queue record that is passed to you as input.

Note: Ensure that you add the logic to manage available dates for a task in the agent itself.
Note: If the executeTask() function throws an exception, the exception is logged and the transaction is rolled back, otherwise it is committed.

The logging and timing utility functions available are similar to the ones provided by the com.yantra.ycp.japi.util.YCPBaseAgent class. The signature of the executeTask() function is public Document executeTask(YFSEnvironment oEnv, Document inXML);Env is a pre-created instance of a YFSEnvironment object that can be passed to APIs and InXML is the org.w3c.dom.Document object, which contains the custom task XML. The custom task XML also contains a TransactionFilters Node, which contains all the parameters that are passed to the task-based custom time-triggered transaction. This node is under the root node of the input XML. For example, see an example for a task-based custom time-triggered transaction.

<?xml version="1.0" encoding="UTF-8"?> 
<TaskQueue 	TaskQKey="" TransactionKey="" DataKey="" DataType="" AvailableDate=""
   		Lockid="" Createts="" Createprogid="" Createuserid="" 
     Modifyts=""Modifyprogid="" Modifyuserid="" >
                 <TransactionFilters   AgentName=""  TransactionKey=""
   			         CurrentThread="" NumRecordsToBuffer="" TotalThreads=""/> 
</TaskQueue>

For a sample custom task-based time-triggered transaction, see the com.yantra.ycp.japi.util.YCPBaseTaskAgent class in the Javadoc.