Custom task
The purpose of the Custom task is to allow external code to run within the context of a firing workflow. This is something that no other platform-supplied workflow task can do. Among the possible uses for this are complex computations, communication with other applications, and interfacing with IBM TRIRIGA Connector for Business Applications.
To understand and successfully use a Custom task, you must have a thorough understanding of the IBM TRIRIGA Application Platform, the fundamental concepts required to build applications on this platform, and Java development.
The Custom task can work with any Java class that implements either the com.tririga.pub.workflow.CustomTask interface described in "CustomTask interface" or the com.tririga.pub.workflow.CustomBusinessConnectTask interface. The task creates an instance of the specified class using a zero argument constructor. The task then calls the instance's execute method, passing it the IDs of the records in the result list of a specified task. The called Java code can then use the record IDs to interact with the IBM TRIRIGA Application Platform using IBM TRIRIGA Connector for Business Applications. IBM TRIRIGA Connector for Business Applications (CBA) is described in the IBM TRIRIGA Connector for Business Applications: Technical Specification.
Each time the Custom task is performed, it determines which interface is being used, creates a new instance of the specified Java class, and calls its execute method.
The custom Java class must be specified in the Class Name field of the Custom Task object in the workflow. In order for the execution to occur properly, the specified class must be in the application classpath. For example, if you were using "ABC" as your application server and you had a Custom task with the Class Name of com.company.myFirstCustomTask, you would place the compiled com.company.myFirstCustomTask.class file into the proper <ABC_server_path>\lib directory or equivalent directory.