External interactions
As said before, good process engines are not meant to be monolithic software that manage everything inside; instead, they are coordination frameworks for people and other systems. One key component to achieve such a behavior is to provide a connector strategy to configure and/or code external interactions between the process and other systems.
From the runtime point of view, each one of these external interaction instances are called Work items. Work items are a representation of a specific step in a process execution. They will store the input and output information for each interaction and its state (pending, active, completed, or aborted).
However, information about the actual occurrence of the external interaction invocation is not enough. We need a way to create our own external interaction code to determine what to do for each particular case. To handle these interactions, you need to implement the WorkItemHandler
interface, which is used to manage external interactions...