Registering the task API event handler
Now that the task API event handler is created and configured as a Java EE service provider, how do you execute it before and after the Approver task (the inline task in the CreditProcess process in the MyProcess project) is created? The following steps show one way to register the task API event handler:
- Double-click the assembly diagram icon of the MyProcess project to open the assembly diagram.
- Double-click the process CreditProcess to open the long-running process.
- Double-click the Approver task in the CreditProcess process.
- Click the Details tab of the Properties view of the opened task.
- Enter the task API event handler name in the Event handler
name field. The handler name is
TaskEventHandlerfor this tutorial as shown in Figure 1.
Figure 1. Task API event handler
In general, there are a number of ways to register a task API event handler. You can register the handler in any of the following ways:
- Use the setEventHandlerName() method on the TTask object for ad hoc tasks.
- Dynamically update the task API event handler name on a task object using the update() method of the task object.
- Specify the event handler name on the task model as was done in this tutorial. So, all tasks created from this task model will use the same event handler.