The configuration procedure includes the following general steps:
-
Set up the approval case as shown on Fig. 1.
-
Set up running the approval business process for records that require approval in the corresponding section.
Configure business processes
-
Open the Process library section and add a new process.
-
Enter the name of the process in the Process field (e.g., “Document approval”).
-
Open the Parameters tab and add a new parameter. This parameter will bind process instances to the documents that needs to be approved (Fig. 2). Once the process is launched from the Documents section, the parameter will be populated with the corresponding document. To add a process parameter:
-
Click the Add parameter button, and select “Lookup” in the drop down menu.
-
In the Title field, enter "Document".
-
In the Lookup field, select "Document".
-
Save the changes.
-
- Add the Read data element from the User actions group to the process diagram. Enter the name of the element in the Read data field (e.g., “Read document data”). This element obtains the process parameters necessary to perform the next steps.
- Set up the element properties (Fig. 3):
-
In the Which data read mode to use? field, select “Read the first record in the selection”.
-
In the Which object to read data from? field, select ”Document”. The business process will read the value in the Owner field of this object to send notifications about the approval status to the document owner.
-
In the How to filter records? area, set the filter “Id = Document”. To do this, click <Add condition>, select the “Id” column, select the Compare with parameter value in the displayed menu, and choose the Document process parameter in the in the appeared window.
-
The default settings in the How to sort records? area are configured for sorting in ascending order.
-
- Add the Approval element from the User actions group to the process diagram (e.g., “Approve document”). The element will be activated once the process is launched for a record in the Documents section.
- Set up the element properties (Fig. 4):
-
In the Approval purpose field, select “Approval required”.
-
In the Approval object field, select “Document”.
-
In the Record Id field, click and select the “Process parameter” option, then choose the “Document” process parameter in the appeared window.
-
In the Approver field, select “Role”.
-
In the Role field, select “Lookup value option” and choose the “Financial department” value from the the “Roles (view)” lookup. All employees in the Financial department role will be able to approve documents.
-
Select the Approval may be delegated checkbox to be able to delegate an approval to a different employee.
-
In the Send email notification field, configure automatic email notifications for the approvers and the document owner employee.
-
Select the Notify that approval is required checkbox.
-
In the Email template field, click and add an email template for a notification from the Email message template lookup.
-
Select the Notify about the approval result checkbox.
-
In the Recipient field, click the button and select “Contact” in the menu, and choose the “Process parameter” option. Then, select the “Owner” parameter from the “Read document data” element in the appeared window. The owner of the document will receive an email notification about the approval.
-
In the Email template field, click and add an email template for a notification from the Email message template lookup.
-
-
- Add two Modify data elements of the System actions group to the process diagram. The “Change document status to Draft” and “Change document status to Active” elements are used to change the document status based on the approval result. Set up the element properties (Fig. 5): The parameters of the two elements are identical, except for the resulting document status.
-
In the Which object to read data from?, select “Document”. This will be set by default if approvals are enabled in the Documents section. In this case, it is the “Chart” component.
-
In the How to filter records? area, set the filter “Id = Document”. To do this, click <Add condition>, select the “Id” column, select the Compare with parameter value in the displayed menu, and choose the Document process parameter in the in the appeared window.
-
In the Which column values to set for modified records? area, select the resulting document status. If approved, the document status changes to “Active”. If not approved, the document status changes to “Draft”. To do this, click <Add field>, and select the “Status” column. In the Status field, click the button, select “Lookup value”, and choose the following values: “Active” for the “Change document status to Active” element and “Draft” for the “Change document status to Draft” element.
-
- Copy the previously created Read data element of the System actions group – “Read document data” – and place it after the Change document status to Draft element on the diagram. This element determines the responsible individual for re-working the document.
- Add the Perform task element from the User actions group to the process diagram (“Revise the document”). This element will create a task (activity) for the individual to edit the document if it was not approved.
- Set up the element properties (Fig. 6):
-
Enter the name of the task in the What should be done? field.
-
Select the start time of the task in the Start in field, and the approximate duration of the task in the Planned duration field. The value of the Start in field determines a time period at the end of which the task will be scheduled. In the Planned duration field, specify the approximate duration of the task.
-
Select the Show in calendar checkbox to display the task in the responsible individual’s calendar.
-
In the Who performs the task? field, click and select the “Process parameter” option. Then, select the “Owner” parameter from the “Read document data” element in the appeared window.
-
In the Connected to field, connect the task to the document. To do this:
-
Click the button and add the “Document” column.
-
Click the button and select the “Process parameter” option, and choose the “Document” process parameter in the appeared window.
-
-
- After creating the process elements, connect each element with the next one by using the arrows in the upper right corner of the selected element.
-
Use conditional flows () to connect the “Approve document” element to the “Change document status to Draft” and “Change document status to Active” elements.
-
Click the conditional flow connecting the “Approve document” element and the “Change document status to Draft” element and select the “Negative ”approval result.
-
Click the conditional flow connecting the “Approve document” element and the “Change document status to Active” element and select the “Positive ”approval result.
-
Use sequence flows () to connect all other elements.
-
-
Save the business process. Once saved, configure the start of a business process.
Set up business process launch
The process is launched by clicking the Run process button on the record page or in the section list. The button is not displayed by default and requires additional setup (Fig. 7).
To configure the button, connect the document approval process to records for which it will be launched. To do this:
-
Click the View button in the Contacts section and select the Open section wizard command.
-
Open the Business process tab. Click the button on the Run business process from section detail. The window of the business process launch settings will be opened.
-
Select the “Document approval” process in the Which process to run? field.
-
To start the process for separate section records, select the “For selected record” radio button.
The Process parameter where the record is passed field is populated automatically with the “Document” parameter of the “Document approval” process.
-
Save the changes in the window and the section wizard.
As a result, you will be able to launch the approval process for any record of the Documents section (Fig. 8).
Set up custom email templates for approval notifications
Use the Approval process element to set up custom logic for approving various Creatio records (documents, invoices, orders, etc.) by Creatio users. Both the approver and the user who submits the record for approval will receive email notifications about the approval procedure.
You can set up custom email templates for these notifications. Note that approval notification emails do not require additional Send email elements, and are configured in the Approval process element.
The instructions below assume that you have enabled approvals in the Documents section, added the Approval element on the process diagram (Fig. 9) and set up its properties. Read more about enabling approvals in the Approval process element article. More information about the approval process setup is available in a separate Configure a document approval process guide.
To set up templates:
-
Populate the fields of the Approval element setup area. If the Approval section field is populated, available email templates for approval notification will be filtered according to the selected section.
-
Select the Notify that approval is required checkbox. As a result, whenever a record is submitted for approval, a notification will be sent to the “approver” user. If “Role” is selected in the Approver field, the notification will be sent to all users with the corresponding role.
-
In the Email template field, click (Fig. 10). A new email template window will open on a new tab.
-
In the new template window, populate the Template name field. Note that if you populated the Approval section field earlier, the Macro source field will be already populated with the corresponding approval object (in this case – the “Approvals in section Document” object, (Fig. 11).
-
Click the Edit button. The template will open in the content designer.
-
Enter the email subject.
-
Drag&drop a content block (e.g., Text) to the template. Replace the text in the Text block with your own.
-
Add regular email template macros:
-
Place your cursor in the text block, click and choose Basic macro (Fig. 12). The Macros selection window opens.
-
In the Macros selection window, choose the needed macro and click Select. The available macros are divided into several groups.
You can specify data of the email recipient contact (“Recipient” group), information of the user who runs the approval process (“Current user” group) or the owner of the record being approved (“Owner” group). For example, to add the name of the user who submitted the document for approval, select Current user > Contact name macro (Fig. 13).
The corresponding macro will be added to the email text at the insertion point.
-
-
Add email template macros that are based on the “Macro source” object.
-
Place your cursor in the text block, click and choose Select column. The Select column window (Fig. 48) opens.
-
In the Select column window, choose the column of the object (that you specified in the Macro source field) whose values must be added to the notification text. The “approval” object is automatically added once you enable approvals in the section wizard and contains data from the approval itself, e.g., Approval purpose, Approver’s name, etc.
-
You can add macros for columns of any object, provided it is linked to the “approval” object, e.g., you can add columns of the document being approved. To select a column of a linked object, Click + next to the “approval” object name in the Select column window (Fig. 14). For example, to add the approved document’s type and number, add the Type and Number columns from the linked Document object.
As a result, your template will look like this (Fig. 15):
-
-
Save the changes in the content designer and the email template.
-
Select the Notify about the approval result checkbox and populate the Recipient field. You can specify any Creatio contact, account or an email address. For example, you can send approval result notifications to the user who submitted the record for approval, record owner, etc.
-
Repeat steps 3-10 to create an approval notification email template.
-
Save the process diagram.
As a result, whenever a user submits a record for the approval using this process, email notifications will be sent according to the custom templates.