In a business environment, we often see following situations where some sort of workflow is involved
- (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).
- 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.
- (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)
- (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
- Occasionally they would like to void or reverse the completed document or
- Delete the document in draft status
- (Approval Based on Amount) The expense (or any transaction) crossing a limit amount may need approval from specific person / designation
- (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
- either provide a capability to forward the action request or
- 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.
- (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.
- Ensure that the Adempiere table has following columns (not required for general workflow)
- 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).
- 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’.
- IsApproved – Select “Reference” as “Yes-No”.
- Ensure that you have Workflow menu available
How it works in Adempiere?
Following diagram summarize the overall setup required for using a workflow in Adempiere:
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.
- Some of the important points that you would like to note are
- Start Mode – allows you to specify if the activity will be triggered automatically or manually
- Finish Mode – allows you to specify if the activity will be completed automatically or manually
- 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.
- 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.
- Action– allows you to specify the action that you want to take on this node. For example
- For general workflow (step-by-step instruction) you need to select “User Window” and specify Window Name.
- For Sleeping for a certain period, you need to specify “Wait (Sleep)” and specify Wait Time.
- For sending Emails – you need to select “EMail” and specify email template & Recipient.
- For executing yet another workflow, you need to select “Sub Workflow” and specify the workflow name
- For executing a report you need to select “Apps Report” and specify the Report Name
- For executing a process you need to select “Apps Process” and specify Process Name
- To act on a document, select “Document Action” and specify document action
- To change value of any specific field of the record, select “Set Variable” and specify value for the selected field
- For Approval like scenario you need to select “User Choice” and specify the column name
- Workflow Editor
- Workflow Activities
- Workflow Process
- Assign this workflow responsibility to someone else (new contact or new workflow responsible)
- Abort the currently active workflow execution
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
- Manager’s Approval and Across Department Approval– There is a need that a document shall be worked by different set of people before it can be finally completed. The step-by-step documentation on below link will enable you to achieve
- Completing a Document– Often business has a need to keep a document in draft status for a period and once all the entries are created and verified then the user completes the document. Following link explains the document completion workflow:
- http://www.adempiere.com/images/6/6d/Creation_or_workflow.pdf – initial part of this document talks about how to create basic workflow to create and complete a document.
- (Approval Based on Amount)– Below link explains how to set-up amount based approval
- Forwarding and Sharing Responsibility
- Adempiere 3.4 ERP Solutions Book
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.