Using the Activiti API
In the previous example, the logic was easily handled by either expressions or JavaScript within the business process. However, there may be cases when Activiti actions are better implemented in Java. For example, there might be an API readily available in Java that isn't available in JavaScript. Or suppose you want to manipulate workflows from outside a business process. Maybe you want to complete tasks, add items to a workflow, or start a workflow from an action, a web script, or a custom dialog. You can use the Activiti Java services or the Alfresco Workflow Service. In our case, we'll use the first option.
The next example gives you a chance to try out both of these scenarios. In one, you're going to write a custom Activti Task Listener. In the other, you are going to use the ActivitiRuntimeService to signal a process.
SomeCo would like to update the Whitepaper submission workflow to optionally include review by an external third party. The third party might be a...