Problem Statement
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.
Prerequisites
- 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.
Workflow
- 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
- https://wtcindia.wordpress.com/2012/01/02/developing-a-general-workflow-in-adempiere/
- 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
- http://www.adempiere.com/How_to_Configure_Dynamic_Approval_Workflow
- 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
- http://www.compieresource.com/2008/04/add-approval-to-document-workflow.html#more
- Forwarding and Sharing Responsibility
Reference
- http://www.adempiere.com/How_to_Configure_Dynamic_Approval_Workflow
- http://www.compieresource.com/2008/04/add-approval-to-document-workflow.html#more
- http://www.adempiere.com/images/0/08/WFapproval.pdf
- http://en.wikiversity.org/wiki/Adempiere_Technical_Training
- Adempiere 3.4 ERP Solutions Book
- http://wiki.compiere.com/display/docs/Workflow
- https://wtcindia.wordpress.com/2011/12/21/expense-claim-and-reimbursement-in-adempiere/
- http://www.adempiere.com/How_to_Activate_Document_Approval_Workflow
- 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.
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!
Hello Lin,
Please find the below link in order to achieve your requirement
http://www.walkingtree.in/forums/showthread.php?857-Lin-Disabling-the-attachment-for-the-email-action-in-workflow
First,Thank you for your assistance.^_^
Now,Could you tell me Which editing tool I can edit the DocAction.java
Please….^_^
Any editing tool. If you have reached this far, I am surprised to see this kind of questions coming in.
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 ?
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
My Adempiere version is 360LTS.013@2010-06-14…>_<
Hello Lin,
This change is not part of ADempiere, we customized.
OH,I see…^_^
so I must buy it?
Buy only it?
No, this is a small enhancement and as long as you can do this with minor assistance from us, you don’t need to pay anything.
Ranjit will be putting the code and steps, which will allow you to achieve the desired functionality.
What is the minor assistance for you?
Minor assistance means that we will be able to respond to your “clearly stated” question when we have bandwidth to do so. Also, it means that we don’t have to prepare anything specific (which takes more than 15 minutes) to answer your question.
Oh,Thanks a lot!
When will Ranjit be putting the code and steps to me?
Send it to my email?
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!
Here is the screen showing Node Tab:
Sorry,I login Adempiere using user :System , but not see the checkBox(include Attachment) in workflow windows..Why?….>_<
We can make this change as shown in below link,
http://www.walkingtree.in/forums/showthread.php?857-Lin-Disabling-the-attachment-for-the-email-action-in-workflow
I already login but do not have permission to access this page
Sorry,this picture’s size is too small,so i do not see clear
Lin click on the image & you will see the bigger size, also you can increase size as need.
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!
when I send mail to saler how to cancel the adds(document-pdf file) ?
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.
First,Thanks!
and next question:how do I make code changes?
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.
Thanks
Hi,
How to add cc for an email.
Thanks and regards