Adding Logic to Workflows with Listeners and Process Variables

So far you've seen that a process can be modeled as a collection of nodes connected via paths or transitions. A common requirement is to be able to execute some code or business logic at certain points within the process. For example, maybe you want to send an e-mail or want to increment a counter that keeps track of how many times a node has been executed. We already used the concept of service tasks to execute some codes, but now we are going to use event listeners.

An event mechanism has been introduced in Activiti to get notified when various events occur within the engine. In our use case, we are going to focus on the Task Listener. A task listener is used to execute custom Java ...

Get Alfresco One 5.x Developer's Guide - second edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.