Setting Up a Basic Document Workflow in Compiere 3
Compiere’s workflow processes form an integral part of the system. In this section we are going to learn how to setup a basic approval workflow for a document within Compiere.
The system definitions are as follows:
- A workflow is made up of a node and transitions.
- A node refers to a piece of work.
- A transition is the action to get to the next node, based on a logical condition.
- The workflow process is the active workflow and an activity for the processing of the active node (an activity also may have multiple parallel processes).
- A workflow also has an active State. A Workflow State refers to whether the workflow is running, not running, not started, completed, aborted, or terminated.
- Nodes also have Owners or Responsible persons.
[singlepic id=297 w=320 h=240 float=center]
Illustrative workflow example
We are going to set up a workflow between two roles, whereby the Gardenworld Purchasing role will capture a Purchase Order and the order will be approved by the Gardenworld User role. This type of approval requires a flag, and Compiere has a built in IsApproved database field that is used for this purpose.
Compiere has standard document workflows and transitions that are predefined within its workflow processes. These nodes are DocStart, DocPrepare, DocComplete, and DocAuto (automatic approval). What this means is that workflow processes already manage the transitions of documents, with the System being the Owner of these workflow nodes.
Defining a custom node in a workflow
We use the workflow editor to define a new node.
- Open the Workflow editor window, and find the Order process Process_Order. Right-click in the editor, and then add an additional new node called Order Approval:
- We need to define where the transition is going to take place by defining the originating node (Document prepare) and the next node (Document complete):
- Click on the upper-right Zoom button to zoom to the actual workflow process, and find the newly-created node:
- Define the node’s owner by creating a workflow owner. Right-click on the workflow owner field:
- The node’s workflow owner is set to be role-based, as follows:
- The Node for Approval can be summarized as follows:
- Define the Transition of the node through a condition:
[singlepic id=298 w=320 h=240 float=center]
[singlepic id=299 w=320 h=240 float=center]
[singlepic id=300 w=320 h=240 float=center]
[singlepic id=301 w=320 h=240 float=center]
[singlepic id=302 w=320 h=240 float=center]
[singlepic id=303 w=320 h=240 float=center]
[singlepic id=304 w=320 h=240 float=center]