Managing Workflow in Adempiere


Problem Statement

In a business environment, we often see 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 move 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 possibility of 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 group of people so that action by any of them will complete that particular activity and generate 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 overall picture of the related processes and eliminates 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 Workflow menu available Workflow Menu

How it works in Adempiere?

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

Workflow Setup

Adempiere comes up with 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 definition for all the workflow types
      • General workflow provides 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 business to define processes where set of people need to work on a given document.
      • Document Value workflow allows business to define workflow which gets invoked when certain predefined business criteria is met. You can specify predefined criteria in “Document Value Logic” field on Workflow window.
      • Manufacturing workflow allows business to specify 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 a 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 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 type is sufficient for most of the business.

      Workflow

      • This window allows you to define actual workflow Workflow
        • As part of the workflow definition you often do following
          • Define various Nodes (also known as activity)
  1. Workflow Activity
  2. 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 value of any specific field of the record, select “Set Variable” and specify value for the selected field
      9. For Approval like 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 Activity Transition Condition
  • Workflow Editor
    • The workflow editor allows you to edit an existing workflow. Using right click anywhere, you can create a new node. Workflow Editor
    • By selecting an existing node and using right click, you can manage transitions. Workflow Editor 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) Workflow Process
    • Workflow Manage Process
    • Manage process allows you to do following
  1. Assign this workflow responsibility to someone else (new contact or new workflow responsible)
  2. Abort the currently active workflow execution
  • Workflow to Client
    • This interface allows you to move the workflow customization to specific client
    • Workflow To 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. https://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.

Tagged with: , , , ,
Posted in ADempiere, EagleRP
26 comments on “Managing Workflow in Adempiere
  1. bolig nips says:

    Hi there, just became aware of your blog through Google, and found that it is really informative.

    I am going to watch out for brussels. I’ll appreciate if you continue this in future. Lots of people will be benefited from your writing. Cheers!

    • Lin says:

      First,Thank you for your assistance.^_^
      Now,Could you tell me Which editing tool I can edit the DocAction.java
      Please….^_^

      • Walking Tree says:

        Any editing tool. If you have reached this far, I am surprised to see this kind of questions coming in.

      • Lin says:

        Sorry, please teach me the steps below how to do using a drawing.
        Thanks!
        Frist,
        1. Add an column in table ad_wf_node with name includeAttachment default to true
        —it means that i must use pgAdmin3 to login postgreSQL database,do not it?
        Second,
        2. Load into Tables & Column – AD_WF_Node
        -How do load?
        Third,
        3. Load into Window / Tab / Field – Workflow / Node / includeAttachment as Include Attachment
        -How do load?
        Fourth,
        4. Move field next to Mail Template
        -How do move?
        Fifth,
        5. Add display logic to show when action is email, similar to Mail Template field
        -How to do?

        When I use user:System to login , then how do i do ?

      • Walking Tree says:

        You must seek for a formal training on Adempiere. You can find our training offering on below link:
        http://walkingtree.in/index.php?option=com_events&task=view_detail&agid=9&year=2012&month=10&day=19&Itemid=60

  2. Lin says:

    My Adempiere version is 360LTS.013@2010-06-14…>_<

  3. Lin says:

    I click on the image and see this message “Invalid Attachment specified. If you followed a valid link, please notify the administrator”….>_<….Could you send this image to me by email? My email is mark5912956@yahoo.com.tw…Thanks a lot!

  4. Lin says:

    when I send mail to saler how to cancel the adds(document-pdf file) ?

    • Ranjit says:

      Hello Lin,

      This would be an code change.

      As long as your workflow entity uses DocAction, it creates the pdf for it and send the in mail as part of process, if you want to avoid this then we need to explicitly make code changes in out model classes to avoid generating the Document pdf, so that it will not be an part of your mail.

      Hope this helps you.

  5. Ranjit says:

    Hi Vivek,

    Adempiere did not have this feature, but we can enhance it through customization.

    All the Walking Tree made good enhancement in email functionality like any other typical mail client, for more detail you can refer below link.

    Mailbox in ADempiere

    Thanks

  6. Vivek says:

    Hi,

    How to add cc for an email.

    Thanks and regards

Leave a comment

We Have Moved Our Blog!

We have moved our blog to our company site. Check out https://walkingtree.tech/index.php/blog for all latest blogs.

Sencha Select Partner Sencha Training Partner
Xamarin Authorized Partner
Recent Publication