The java activiti workflow is an open source one.
The design pattern used here is the Responsibility Chain pattern. For each processing, there is a context, which is a hashmap.
In real world, when we do anything, there is a context too. And the context is passed on and on.
The process and its return result should be exposed for tasks. The engine is responsible for navigating tasks and the context according to the flow rules.
ref: