IBM TRIRIGA Application Platform Version 3.5.1

Example: Execution from custom tasks

After you create the integration object record, you can use a custom task to filter an outbound query with data from the currently running process.

Background

Ichiro is an integration specialist at Company ABC. He develops IBM® TRIRIGA® integrations for the customers of Company ABC.

Ichiro updates a subset of records, but he wants an integration to send a record when a user clicks a particular action. So he uses a special Custom task object that uses workflow variables to set data, and that communicates with the Integration class loader record. By using this feature, Ichiro can build the subset of records in the workflow by using the common methods. Then, he can pass the subset by referring to the Custom task, and assign the integration object record that he wants to trigger to a workflow variable named IntegrationObject.

Ichiro's basic workflow contains the following workflow tasks:
  • Start task
  • Query task that is named Query For Integration Object
  • Variable Definition task that is named Define IO as Variable
  • Variable Definition task that is named IntegrationInstance
  • Query task that is named Query for subset of people
  • Custom task that is named Custom Task
  • End task

Step 1: Define the workflow

Ichiro selects the Start task, sets the workflow as asynchronous, and sets the workflow to run when a person record (triPeople) is saved (triSave).

Step 2: Define the first Query task

Ichiro inserts the first Query task and names it Query For Integration Object. In this task, he queries (Manager Default - Integration Objects) for the integration object record that he wants to trigger. Then, he filters the results of this query for a specific name. Ichiro must have only one resulting integration object record.

Step 3: Define the first Variable Definition task

Ichiro inserts the first Variable Definition task and names it Define IO as Variable. In this task, he defines the integration object record (triIntegration) as a variable. The result of the query from the previous task is assigned to this variable.

Step 4: Define the second Variable Definition task

Ichiro inserts the second Variable Definition task and names it IntegrationInstance. In this task, he defines the integration instance object (triIntegrationInstance) as a variable. This return variable is used for the return value from the Custom task at the end of the workflow.

Step 5: Define the second Query task

Ichiro inserts the second Query task and names it Query for subset of people. In this task, he obtains the filtered set of people records that are processed for the integration. He queries (triEmployee – Find) for the people records. Then, he filters the results for records where the person's given name (triFirstNameTX) contains Ichiro.

Ichiro verifies that the people business object (triPeople) contains the record ID (triRecordIdSY) field. For any business object that is used in the Query task that is passed to the integration object record, the record ID (triRecordIdSY) field must be included. When an integration is running, the integration object record uses the record ID to retrieve the remaining fields in the business object that is defined in the data map.

Step 6: Define the Custom task

Ichiro inserts the special Custom task that uses workflow variables to set data, and that communicates with the Integration class loader record. In this task, he passes the results of the Query for subset of people task as the set of records. Finally, Ichiro adds the return variable that is needed to obtain the integration instance record. The name of the return value must be IntegrationInstance.

This Custom task is also defined with the following values and behavior:
  • The Class Name field for the Custom task is set to Integration:com.tririga.custom.integration.Parameter. This class name must be used when this method is implemented. The Parameter class inside of the Integration class loader path implements the CustomParamBusinessConnectTask Java Interface class with the following signature:
    public CustomParamTaskResult execute(TririgaWS client, 
      Map params, long userId, Record[] records)
  • The params argument represents the assigned IntegrationObject variable so that the process has the instructions that it needs to continue the integration. The records argument represents the Records section in the Custom task where the records to use for the workflow process are assigned. Instead of triggering the event on one object, two sets of objects are being passed to an event.
  • The Parameter class looks for the integration object record from the IntegrationObject variable and processes the results in the records argument that are passed. This processing includes running the query from the Query for Outbound section of the integration object record and filtering by the record IDs of the records that are passed. As a result, data is being exported with the common utilities. But the export is no longer bound by all-or-nothing queries, or by triggering the event directly from the Execute form action.


Feedback