Set a due date for a workflow process using only business days
The following is an example of how a date can be stored and used across multiple steps to represent the due date for all of the steps in a workflow process that will only use business days.
Scenario
When an invoice enters an approval workflow, the entire approval process must be completed within 2 business days (Saturday and Sunday are not counted as days that approvals can be performed). In this situation, it is not important how long a document sits on each step in the process, it just matters that all the steps are completed within the two days after the document enters the workflow.
Workflow design and configuration
When a document is routed for approval, the first step is a custom action that will determine the date and time that the document started into the workflow. In this example a Global Function has been stored for the process. This global function was entered by double-clicking the "Start" stencil and will determine if Saturday and Sunday need to be figured into calculating the due date. In this example, the process must be completed in 2 business days. In the "Set Due Date" custom action, the "MakeDueDate" function is called and the current date and time is passed to the function to determine the due date. This due date is then stored within a variable labeled "rtduedate" in the context of the unique route path for that document. To use this due date, each following user step in the workflow will need to be an Assignable step type. The Assignable step type allows the Due Date for the step to be set using VB Script to call the "rtduedate" variable. Below is the script that is used in the VB Script term to call the function:
VB Script: MakeDueDate(NOW())
After the document moves through the Set Due Date custom action stencil it moves to the "Examine" step which is an Assignable step type. This stencil is configured as a standard single user type of step. On the Step Information tab in the Due Date area, the VB Script term is used to call the "rtduedate" variable which contains the due date for the process. Below is the script that is used in the VB Script term:
VB Script: "{RoutePath.rtduedate}"
When the "Send for Approval" button is clicked, the document is then moved to the "Approve" step which is configured exactly like the Examine step. This step will have the exact same due date as the Examine step.
See Set a due date for a workflow process for an example that does not calculate business days.
Calling the MakeDueDate Function
Global Function Window
Using the Variable to Recall the Due Date
Menu