Workflow Events
The TACTIC workflow engine is an event based system. This means that TACTIC will store the state of the workflow until an event is sent which causes some part of the workflow to execute.
External process can sent events to any part of the workflow, which will cause the workflow engine to respond to that event according to the specified action of the node.
To send an event to a workflow, you will need the following information:
- job
- process name
- event name
Call an arbitrary event in the pipeline
Jobs have a workflow that defines the steps needed to take it from start to finish. The workflow is composed of a number of interconnected nodes.
You can either pass in the a dictionary or the search key. If a dictionary is passed in, the SEARCH_KEY key must point to the value of the search key of the sobject.
server.call_pipeline_event(job, "Start", "pending")
or alternatively:
server.call_pipeline_event(search_key, "Start", "pending")
This command will call the pipeline event "pending" for the given node. If this is the first node, it will effectively "start" the workflow. However, messages can be sent to any part of the pipeline at any time. TACTIC will be able to handle multiple streams of execution of the workflow at the same time.
Node types and events
Every node has a number of events that it will respond to. How a node responds to these events depends on the node type. There are a number predefined events that most nodes will respond to.
The main events are: pending in_progress complete reject not_required
Each node will implement a behavior for these events (or adopt the default behavior). And defined the condition for going to the next event.
Manual nodes will have a task associated with them. In general, the node will relay this event to the task which, in turn, will set the task to the appropriate status. It should be noted, that changing the status of a task will in turn notify the associate process of the task with the appropriate event. With manual nodes, the execution of the pipeline will stop after the pending and in progress events. With the complete event, it will send a "pending" event to any outgoing node.
Auto nodes will have some code that is executed.