Document Approval Workflow with assignment completion information in document #
M-Files Elements #
It is often the case, that customer needs to keep information about document approval (who approved and when) in the document itself. Even though the M-Files history has needed information, it is not possible to include that information in the document.
Assignment module creates separate objects (in this example called Approvements) that contain information about who and when completed which Assignment.
To support this case, certain M-Files elements are created:
Required elements #
Element | Name | Description |
Object Type | Approvement | An object of this object type will be created after a user marks assignment as completed |
Class | Approvement | Object of this class will be created after user marks assignments as completed |
Property Definition | Approvement Name | Name of Approvement object. Configured as a simple concatenating of properties: %Approver User% – %Approvement Date% – %Approvement Time% This property is very important as this property will be visible in the document. |
Property Definition | Approver User | User that marks assignment as completed. |
Property Definition | Approvement Date | Date when the assignment is marked as completed. |
Property Definition | Approvement Date UTC | Date UTC when an assignment is marked as completed. |
Property Definition | Approvement Time | Time when the assignment is marked as completed. |
Property Definition | Approvement Time UTC | Time UTC when an assignment is marked as completed. |
Property Definition | Approvement Timestamp | Timestamp when an assignment is marked as completed. |
Property Definition | Document Approvers Approvements | List of all approvement objects for an assignment for Document Approvers |
Property Definition | Document Authors Approvements | List of all approvement objects for an assignment for Document Authors |
Property Definition | Document Reviewers Approvements | List of all approvement objects for an assignment for Document Reviewers |
Approvement class with all properties:
In most cases, document approval workflow has three important steps: authors approve, reviewers approve and final approval.
To support three different approval states we need to have three different assignment classes:
Assignment Configuration #
With all the elements created, it is possible to configure the Assignments module.
The first part of the configuration is used for connecting elements that module looks for and created elements:
After that, for each assignment class, we will add Assignment Rule that will create Assignment Completion objects and add them to the referenced object (in our case Document) [Source Object Property] in property (in our case Document Authors Approvements, Document Reviewers Approvements, Document Approvers Approvements) [Completions property].
The Result #
To create a new document, the user needs to select Author(s), Reviewer(s) and Approver(s).
In the state Document Authors Approve separate assignment is created and assigned to Document Author – Cristiano Ronaldo. After Cristiano marks assignment as completed, Extended Assignments module creates a separate object (of class Approvement) and add this object to property metadata on Document (Document Authors Approvements)
The same behavior is for the next stages of Document Approval workflow and the result for this example is next:
As it is visible, the document is now in state Document Approved with information about who, when and in which state, approved this document. Now it is possible to add information in the document.
As this output with semicolons might not be good enough, we have created Macro Properties module which, among others, can convert multi-select lookups to the list of lookups displayed one value per line: