Setting Up a Basic Document Workflow in Compiere 3

Compiere 3


June 2010

$26.99

An essential and concise guide to understanding and implementing Compiere.

(For more resources on Compiere 3, see here.)

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.

Compiere 3 Implementation Guide

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.

(For more resources on Compiere 3, see here.)

Defining a custom node in a workflow

We use the workflow editor to define a new node.

  1. 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:

    Compiere 3 Implementation Guide

  2. 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):

    Compiere 3 Implementation Guide


  3. Click on the upper-right Zoom button to zoom to the actual workflow process, and find the newly-created node:

    Compiere 3 Implementation Guide

  4. Define the node's owner by creating a workflow owner. Right-click on the workflow owner field:

    Compiere 3 Implementation Guide


  5. The node's workflow owner is set to be role-based, as follows:

    Compiere 3 Implementation Guide


  6. The Node for Approval can be summarized as follows:

    Compiere 3 Implementation Guide


  7. Define the Transition of the node through a condition:

    Compiere 3 Implementation Guide

The condition we set up for the document workflow to transition to Document Complete is as follows:

 

Compiere 3 Implementation Guide

(For more resources on Compiere 3, see here.)

Testing the workflow

We can now illustrate the workflow by creating an order and ensuring that it gets approved correctly.

  1. We log in as the GardenWorld Purchasing role, as follows:

    Compiere 3 Implementation Guide


  2. Create a Purchase Order, and then click on the Complete button. The Order will be placed in an In Progress status, because the workflow's next node is document approval:

    Compiere 3 Implementation Guide


  3. We log off, and then log back in to the system with the GardenWorld User role (workflow owner):

    Compiere 3 Implementation Guide

  4. Find the Workflow Activities menu item, and then approve the document, as follows:

    Compiere 3 Implementation Guide


  5. The Document will be approved when the owner sets the approval status to Yes:

    Compiere 3 Implementation Guide


Summary

We have covered certain aspects with regards to Compiere in this three-part article series—namely the Application Dictionary (AD) and Workflows, as follows:

  • We gave you an overview of the Compiere Application Dictionary components.
  • We illustrated how to add a menu item and a custom list field to a Compiere window by using the AD components.
  • We gave you an overview of the Compiere Workflow processes, and illustrated how this is set up.

Further resources on this subject:


Books to Consider

comments powered by Disqus