Scroll Top

Managing Workflow in Adempiere

Getting your Trinity Audio player ready...

Problem Statement

In a business environment, we often see the following situations where some sort of workflow is involved

  1. (Manager’s Approval) The document is prepared by sub-ordinates or specialists and the final authorization is given by higher management (as per the business process).
    1. In nutshell, there is a need that a document moves from one table (or person) to another table (or person) until it reaches the last table (or person) in the workflow, where it finally gets completed and overall work is considered completed. During this process, there may be the possibility of the content of that document being modified, while it is being actioned.
  2. (Across Department) One part of the work is done by one department (e.g. Packing of material by Packaging department) and  the other part of the work is done by the other department (e.g. verification of package by delivery department)
  3. (Document Status Transition) The document is kept in the draft status for a period and once all the entries are made and verified, the user completes the document
    1. Occasionally they would like to void or reverse the completed document or
    2. Delete the document in draft status
  4. (Approval Based on Amount) The expense (or any transaction) crossing a limit amount may need approval from specific person/designation
  5. (Forwarding and Sharing Responsibility) The business may like to avoid delay in action due to someone being overloaded or being on vacation. In such cases, they may like to
    1. either provide a capability to forward the action request or
    2. send the action request to the group of people so that action by any of them will complete that particular activity and generate the next action request (if there is one) in the work flow.
  6. (General Guideline) The business may want to help staff with standard data flow, which provides the overall picture of the related processes and eliminates the training need of the business

As part of this article, I intend to cover how you can make use of Adempiere to manage various Workflow need mentioned above.

Prerequisites

  1. Ensure that the Adempiere table has following columns (not required for general workflow)
    1. DocAction – Select “Reference” as “Button” and default this value to Complete by setting “Default Logic” a value of ‘CO’. Specify the process associated with the workflow (not required for general workflow).
    2. DocStatus – The Document Status indicates the status of a document at this time.  If you want to change the document status, use the Document Action field. Select “Reference” as “List” (and select “_Document Status” as Reference Key or use your own “Document Status List”) and default this value to Drafted by setting “Default Logic” a value of ‘DR’.
    3. IsApproved – Select “Reference” as “Yes-No”.
  2. Ensure that you have a Workflow menu available

How does it work in Adempiere?

Following diagram summarize the overall setup required for using a workflow in Adempiere:

Adempiere comes up with the following list of interfaces related to Workflow:

  • Workflow Type
    • The type of workflow determines how the workflow is executed.
    • The reference list AD_Workflow Type_L contains a definition for all the workflow types
      • General workflow provides a list of linked nodes which provides step-by-step instruction. It allows you to perform one action after another by clicking on the nodes.
      • Document Process workflow allows the business to define processes were set of people to need to work on a given document.
      • Document Value workflow allows a business to define workflow which gets invoked when certain predefined business criteria are met. You can specify predefined criteria in “Document Value Logic” field on the Workflow window.
      • Manufacturing workflow allows the business to specify a method for manufacturing a particular item. The business can specify different steps,  approvals and other manufacturing parameters (e.g. wait time, cost, etc) involved during different stages of manufacturing.
  • Workflow Responsible
    • Workflow Responsible is the person who is responsible for executing certain activity of the workflow
    • The system allows you to define ways to find the actual user responsible for the workflow
    • The off-the-shelf system provides following responsible type (defined using Reference Key “WF_Participant Type”), which allows the system to determine “the responsible user(s) for the workflow execution”
      • Human (H) – The system allows you to specify the specific user/contact who will be responsible for executing the activity of the workflow. If the specific user/contact has not been defined for this responsible type then the invoker of the workflow becomes responsible for executing the activities of the workflow.
      • Organization (O) – The supervisor of the organization will be responsible for executing the workflow activity.
      • Role (R) – A group of people will be responsible for executing the workflow activity.
      • Depending on your need, you can add more responsible type. However, we have often seen that above three responsible types is sufficient for most of the business.

      Workflow

      • This window allows you to define actual workflow
      • As part of the workflow definition, you often do the following
        • Define various Nodes (also known as activity)

  1. Some of the important points that you would like to note are
    1. Start Mode – allows you to specify if the activity will be triggered automatically or manually
    2. Finish Mode – allows you to specify if the activity will be completed automatically or manually
    3. Join Element – allows you to specify how the incoming transitions shall be handled. If you have used AND then it joins all the concurrent thread and if you have selected XOR (default) then it requires one thread.
    4. Split Element – allows you to specify how the outgoing transitions shall be handled. AND represents multiple concurrent threads and XOR (default) represents the first transition with a true Transition condition.
    5. Action– allows you to specify the action that you want to take on this node. For example
      1. For general workflow (step-by-step instruction) you need to select “User Window” and specify Window Name.
      2. For Sleeping for a certain period, you need to specify “Wait (Sleep)” and specify Wait Time.
      3. For sending Emails – you need to select “EMail” and specify email template & Recipient.
      4. For executing yet another workflow, you need to select “Sub Workflow” and specify the workflow name
      5. For executing a report you need to select “Apps Report” and specify the Report Name
      6. For executing a process you need to select “Apps Process” and specify Process Name
      7. To act on a document, select “Document Action” and specify document action
      8. To change the value of any specific field of the record, select “Set Variable” and specify the value for the selected field
      9. For Approval like the scenario you need to select “User Choice” and specify the column name
  • Specify transitions among the workflow nodes
  • define conditions (using AND / OR logic) on which these transitions will happen

  • Workflow Editor
    • The workflow editor allows you to edit an existing workflow. Using right click anywhere, you can create a new node.
    • By selecting an existing node and using right click, you can manage transitions.
  • Workflow Activities
      • This interface allows you to view currently active activities on which the logged-in user is expected to act.

  • Workflow Process
    • This window allows you to find your workflow processes and the latest status of the workflow (including its events and activities)
  • Manage process allows you to do the following
  • Assign this workflow responsibility to someone else (new contact or new workflow responsible)
  • Abort the currently active workflow execution
    • Workflow to Client
    • This interface allows you to move the workflow customization to specific client

Now let’s review the initial problem statements one-by-one:

  • (General Guideline)The business may want to help staff with standard flow, which provides overall picture of the related processes and eliminates training need of the business. Following link explains step-by-step process for creating general workflow

Reference

  1. http://www.adempiere.com/How_to_Configure_Dynamic_Approval_Workflow
  2. http://www.compieresource.com/2008/04/add-approval-to-document-workflow.html#more
  3. http://www.adempiere.com/images/0/08/WFapproval.pdf
  4. http://en.wikiversity.org/wiki/Adempiere_Technical_Training
  5. Adempiere 3.4 ERP Solutions Book
  6. http://wiki.compiere.com/display/docs/Workflow
  7. http://wtcindia.wordpress.com/2011/12/21/expense-claim-and-reimbursement-in-adempiere/
  8. http://www.adempiere.com/How_to_Activate_Document_Approval_Workflow
  9. http://www.adempiere.com/Workflow

Summary

As part of this article I have attempted to provide overall Workflow management in Adempiere. The workflow engine in Adempiere is one of the most powerful and important functionality that almost every business need. Interestingly, it doesn’t expect you to be technical expert to be able to define workflow for your business. At times, all you need to know is basic SQLs to be able to retrieve appropriate user ID who will be responsible for executing an active activity.

I hope you have enjoyed reading this blog and it helps you in making better use of Adempiere ERP.  In case you need professional assistance to be able to achieve your business need, you can always reach us by visiting our Contact Us page. If you have any specific question then feel free to post the same on our forum or the blog related to your topic of concern.

 

Related Posts

Leave a comment

Privacy Preferences
When you visit our website, it may store information through your browser from specific services, usually in form of cookies. Here you can change your privacy preferences. Please note that blocking some types of cookies may impact your experience on our website and the services we offer.