Use a chain of managers in an approval process

Document created by emily.billing@nintex.com Champion on May 28, 2014Last modified by emily.billing@nintex.com Champion on Feb 7, 2016
Version 3Show Document
  • View in full screen mode

This is applicable to both Nintex Workflow 2013 and Nintex Workflow 2010.

 

This article explains how you can use Nintex Workflow to request approval from the workflow initiator's manager, and then also that manager's manager, and so-on until there is no-one left in the managerial approval chain.

 

Included is the final workflow, any other actions can be added at your discretion. This process depends on the use of Active Directory.

 

Open the Workflow Designer

 

Create Workflow Variables

A variable will be created to record the nomination of the current approver. A second to store the name of the current approver's manager, and a third to record whether or not the approval process is complete.

Click on the Workflow Settings drop down arrow, and select Variables. Create three variables.

  1. Name: Current Approver, Type: Single line of text
  2. Name: Manager DN, Type: Single line of text
  3. Name: Approval Process Complete, Type: Yes/no

workflow_variables.png

Add a Build String action

Drag a Build String action onto the canvas. Double-click on the action to open the configuration dialog. This action will set the current approver to be the manager of the initiator of the workflow.

  1. In the Text box, click on Inset Reference and select Manager from the Common tab.
  2. In the Store result in field, select Current Approver. Click Save.

build_string.png

Add a Loop action

Now we can add a Loop action to the canvas, this will create a loop which is set to run while there is a manager. The condition set for the loop means it will continue while the variable "Approval process complete" is set to No.

 

  1. Drag a Loop action to the canvas, and double click on the action to open the configuration dialog.
  2. In the Condition field, select If any value equals value.
  3. In the Where field, select Workflow data; Approval Process Complete, and then No next to the Value drop down.

loop.png

Add a Request Approval action

The Request Approval action needs to be added to the canvas, within the Loop action. The Request Approval action will set the approver using the value stored in the Current Approver variable.

workflow.png

  1. Double click on the Request Approval action to open the configuration dialog.
  2. In the Approvers field, click on the Lookup icon. Select the Lookup section and click on the workflow variable Current Approvers.
  3. Save the action.

request_approval.pngRequest Approval Declined Path

Add a Set Variable action

If the item in the workflow is declined, we can set the Approval Process Complete variable to Yes, and the loop ends.

  1. Drag a Set Variable action to the declined branch of the Request Approval action. Double-click on the action to open the configuration dialog.
  2. In the Set field, select Approval Process Complete and then Yes in the Equals drop down.

set_variable.png

Request Approval Approved Path

 

Add a Regular Expression

The Regular Expression action will strip the domain name from the username stored in the Current Approver variable, so it is ready for use in the Query LDAP action.

  1. Drag a Regular Expression action on to the canvas and double click on the action to open the configuration dialog.
  2. In the Pattern textbox type, "(your Domain)\\".
  3. In the Input text field, click on Insert Reference and select the workflow variable Current Approver.
  4. In the Store result in field, select Current Approver.

regular.png

Add a Query LDAP action

The LDAP will query using the user name stored in the Current Approver variable, and the result stored in the variable Manager DN.

  1. Drag a Query LDAP action below the Regular Expression action, and double-click on the action to open the configuration dialog.
  2. In the LDAP path field, type in the LDAP path that points to Active Directory in your environment. Enter a username and password of an Active Directory account that has at least Read permissions. For information on how these queries work, see LDAP Query Basics
  3. In the Query section, type "(&(objectClass=user)(samaccountname=", and then click on Insert Reference. Select Current Approver from the Workflow Variables tab.
  4. In the Property to retrieve field, type "Manager" and click Add.
  5. In the newly created Manager field, select Manager DN from the drop down list, and save the action.

query_ldap.png

Add a Set a Condition action

The next action is Set a Condition. This will check if the Manager DN variable is empty. Once the Manager DN variable is set to Yes, the loop will end, and the rest of the workflow will run.

  1. Drag a Set a Condition action onto the canvas, below the Query LDAP action. Double click on the action to open the configuration dialog.
  2. In the Condition field, select If any value equals value.
  3. In the Where field, select Workflow Data; Manager DN, and is not empty.

set_a_condition.pngAdd a second Query LDAP action

We now need to add another Query LDAP action. This action will convert the distinguished name, created in the previous action, to a standard "domain/username" format, which will be stored in the Current Approver variable.

 

  1. Drag a Query LDAP action to the canvas on the Yes branch of the Set a Condition action. Double click on the action to open the configuration dialog.
  2. In the LDAP path field, type in the LDAP path that points to Active Directory in your environment. Enter a username and password of an Active Directory account that has at least Read permissions. For information on how these queries work, see LDAP Query Basics
  3. In the Query section, type "(&(objectCategory=user)(distinguisedName=", and then click on Insert Reference. Select Manager DN from the Workflow Variables tab.
  4. In the Property to retrieve field, type "saMAccountName" and click Add.
  5. In the newly created Manager field, select Current Approver from the drop down list, and save the action.

query.png

 

Add a Set Variable action

If the variable is not empty, the loop continues. We can set the Approval Process Complete variable to Yes, and the loop ends.

  1. Drag a Set Variable action to the No branch of the Set a condition action. Double-click on the action to open the configuration dialog.
  2. In the Set field, select Approval Process Complete and then Yes in the Equals drop down.

set_variable.png

The workflow should look like this.

workflow.png

2 people found this helpful

Attachments

    Outcomes