jBPM5 - Workflow Components
The following screenshot show the various workflow components available in jBPM 5. Using these components, you can create a workflow to orchestrate your process.
You can create your custom tasks as well but that will be covered later. In addition, there are service tasks available that can be used to orchestrate a process.
Start Event − This is the first node executed in every process. There can be only one start node in your process.
End Event − This node signals the end of the process. There can be more than one occurence of this type of node in a process.
Rule Task − It is a node that evaluates a RuleFlow group, that is a group of Drools Rules under the same named scope.
Gateway (diverge) aka Split − This particular node creates new paths/ways in the process. It has two or more outgoing connections. You can choose between three different types of Splits/Gates available.
AND GATE − Where the flow of the process continues to all outgoing connections at the same time.
XOR GATE − Which goes to one only outgoing path according to some predefined constraints defined in the workflow.
OR GATE − Where the flow proceeds based on evaluation of all outgoing constraints and that path is enabled where the constraint is evaluated to true.
Gateway (converge) aka Join − This join is the reverse of the split. It joins multiple paths into one. There can be four different types of Joins/gates −
AND − The flow continues when all the branches are complete.
XOR − The flow continues when at least one branch is complete.
Discriminator − Like XOR, it continues if one of its branches has been completed. But unlike XOR, it registers the completions of the other branches until all connections have completed. When it happens, the node resets and it can be entered again when an incoming branch activates and the cycle starts all over again.
N-of-M − The flow continues when n number of m branches completes. You need to specify the n (number) while configuring the gate as to how many branches should complete before the flow exits.
Reusable Sub-Process − Calls another process. This is very useful to compose several smaller process into a larger one. This larger one can be a coordinating process. You can configure the calling process to wait for the callee to complete and also to have an indepedent lifecycle of its parent.
Script Task − A node that can execute a simple piece of code.
Timer Event − This type of node starts a timer and triggers when the timer expires. Enables time-related process and repetitive tasks.
Error Event − This kind of node signals an error condition in the process. It has no outgoing connections. It specifies a FaultName and a FaultVariable. The engine will search for an exception handler that matches the FaultName and stores the Fault information in the variable defined by the FaultVariable.
Message Event − It triggers when an event of a predefined type is emitted. It can be either an internal event (signaled inside the process) or external (signaled by an external entity other than the process engine).
User Task − A node that creates a Human Task. This Human Task is an activity that must be completed by a human actor.
Embedded Sub-Process − Helps to create a subprocess within a parent process. It can have its own scope. This is useful for larger process where you want to keep some complex branches isolated. It can have its own variables and exception handlers
Multiple Instances aka for Each − It allows a collection of elements to be fed into a subprocess. Very useful when combined with a Reusable Subprocess to compose and coordinate smaller processes.