We started with simple workflow, learned how to do assignment approvals, and now, final step will be to d oWorkflow with approvals.
Approvals are used inside companies for various purposes, in my experience mostly for orders and invoices. However, that is not only use case scenario for approvals. Let’s see how this works.
As always, in the beginning – official documentation if you want to know more.
https://www.m-files.com/user-guide/2018/eng/using_workflows.html?hl=workflows
This article is follow up from these two:
M-Files – Create and manage simple workflow
M-Files – Create Workflow with assignments
I assume that you now know you way around Workflows, and also can navigate with various Metadata in M-Files.
I won’t be covering simple steps in this review (such as creating Workflow) – if you need help with something, refer to my other articles from this series.
Here is a Workflow I’ll be starting with
I also created new Class named Approval under Assignment Object. Approval has “Approval assignment” under Assignment details, while Assignment Class has “Task assignment”
1. Configuring Actions for States
Edit Draft State
Actions tab – mark Set Properties – Define – Add – Add Reviewers and Approver (we created them in first workflow article)
Confirm everything with OK and exit Draft state properties.
Edit Waiting To Be Reviewed state
Actions tab – mark Create Separate Assignments – Add – Assign to: click on Add button – Use from metadata – Reviewers. – Add
Stay on Create Separate Assignment screen and select Assignment under “Select assignment class”
Under Title add Name or title placeholder with text you wish
Add placeholder also for Assignment description. Confirm everything and exit
We are done with “Waiting to be reviewed” for now.
Edit Waiting to be Reviewed -> Draft transition
Open trigger tab – select “Trigger the state transition if any separate assignment is rejected” – OK, close
Edit Waiting to Be Reviewed -> Waiting For Approval transition
Under trigger tab select “Trigger the state transition once all separate assignments are completed or approved”
Edit Waiting For Approval State
Actions tab – mark Create Separate Assignments – Add – Assign to: click on Add button – Use from metadata – Approver – Add
Stay on Create Separate Assignment screen and select Approval under “Select assignment class”
Under Title add “Name or title” placeholder with text you wish
Add “Name or title” also for Assignment description. Confirm everything and exit
Edit transition between Waiting for approval -> Approved
Under trigger tab select “Trigger the state transition once all separate assignments are completed or approved” – OK, close
Edit transition between Waiting for Approval -> Rejected
Open trigger tab – select “Trigger the state transition if any separate assignment is rejected” – OK, close
Edit transition between Rejected and Draft
Trigger the state transition after 0 days. Ok, close
Set notifications if Approved or Rejected
We would also like to see notifications if our document is approved or rejected. Here is how to do it.
Edit Approved state
Action tab – select Send notifications – Define
Add user from Metadata (Created by) and add Name or title placeholder in subject and Message with some text you like. Ok, close
Edit Rejected state
Repeat procedure as with Approved state, only this time define status as Rejected. Ok, close
Ok, that was it for editing of this workflow.
Let’s Save our workflow and test it in M-Files Desktop.
Testing in M-Files Desktop
Time to see if all of this works.
My Invoice001 went successfully from Administracija1 account – which launched it from Draft to Waiting to Be Reviewed State.
Then in Waiting to Be Reviewed State Racunovodstvo1 account did it’s job and reviewed Invoice001
At last, Uprava1 approved Invoice001
Also, properties we set for the Workflow are working nicely
I also tested going back to Draft and Rejection scenarios – all works very nice.
We now have a solid understanding of Workflow function in M-Files.
My series of articles about M-Files
Server
M-Files how to configure Metadata
M-Files – users and user groups
M-Files – Create and manage simple workflow
M-Files – Create Workflow with assignments
M-Files – Create Workflow with Approvals
M-Files – Manage permissions for Workflows
M-Files – how to create and use document templates
How to backup and restore M-Files Vault
M-Files – How to enable access to M-Files through website
M-Files how to secure connection between server and clients (HTTPS)
M-Files Migrate from Firebird DB to Microsoft SQL DB
Desktop
Understanding M-Files logic + Overview of M-Files desktop
M-Files Creating Views for M-Files Desktop
M-Files how to save or modify documents?
M-Files How to share documents? How to save eMails to M-Files?