Information Technology Reference
In-Depth Information
Building your own extensions to Human tasks
Now that we've understood the APIs provided by the Human task component, we can start
discussing the possible extension points that the API provides to allow users to extend its
functionality and connect the component to other tools. This proves most useful when you
think of the Human task component as a piece of a big puzzle, for example, the overall en-
terprise architecture of an organization. In such contexts, the possibility of handling human
tasks is not the only thing that is important, but how information from those tasks can also
impact other components.
The main responsibility of the Human task component is to handle the life cycle of tasks,
and leave many connection points for other pieces of software to be notified about the
changes in said life cycle or affect it in a simple way. In the following subsections, we will
see some details on how to configure different pieces of software that can provide a lot of
added value to you. We will concentrate on three main extension points:
• Task life cycle event listeners
• Task service interceptors
• Task model providers
Task life cycle event listeners
In jBPM6, the task service provides a configuration facility to expose the behavior of tasks
to external components. This configuration allows you to construct all sorts of publishing
for task operations. In a way, every time a task is changed from one state to another, the
current status of said task could be exposed. This is achieved through a specific listener
class called TaskLifeCycleEventListener that can be implemented in virtually
any way you see fit, as shown in the following code:
public interface TaskLifeCycleEventListener extends
EventListener {
public void beforeTaskActivatedEvent(TaskEvent event);
public void beforeTaskAddedEvent(TaskEvent event);
//omitted methods
public void afterTaskActivatedEvent(TaskEvent event);
public void afterTaskAddedEvent(TaskEvent event);
//omitted methods
}
Search WWH ::




Custom Search