Dynamically Updating a Workflow Request’s Due Period
Workflow Manager 2020
You can configure a workflow request so that its Workflow Due Period can be automatically adjusted, if needed, every time the workflow advances.
For example, let’s say you created a workflow template related to deploying software on your employees’ computers, and that your organization uses several different operating systems, such as Windows NT and Windows XP. In your organization, the deployment process for a Windows NT machine is considerably longer than on a Windows XP machine, but you want to use the same workflow template for both processes. You can set up your template so that the Workflow due period is automatically lengthened when someone submits a deployment request for a Windows NT system.
Note:To set up dynamic Workflow due period adjustment, you need Visual Studio .NET 2003 or later.
Sample Sla.xml File
The dynamic updating of Workflow due period is configured using an XML file named sla.xml. A sample sla.xml file would look like this:
<?xml version="1.0" encoding="utf-8"?>
<SLACompanies>
<Company Name="Requester">
<CustomAttribute Name="OS">
<Value ID="XP">2</Value>
<Value ID="NT">4</Value>
</CustomAttribute>
<CustomAttribute Name="Priority">
<Value ID="Low">2</Value>
<Value ID="Medium">4</Value>
<Value ID="High">6</Value>
</CustomAttribute>
</Company>
<Company Name="GUID2">
<CustomAttribute Name="OS">
<Value ID="XP">12</Value>
<Value ID="2003">10</Value>
</CustomAttribute>
</Company>
</SLACompanies>
This XML file includes the following elements:
Element |
Description |
SLACompanies |
The parent element of the XML file. Contains one or more Company child elements, listing the workflow consumer companies you want to set up dynamic SLA updating for. |
Company |
Each Company element has a Name attribute, specifying the name of a consumer company. In the example above, the two companies specified are Requester and GUID2. |
CustomAttribute |
Each CustomAttribute element has a Name attribute, specifying the name of the data element collected during the workflow request which determines whether the Workflow due period should be adjusted. In the example above, two data elements are relevant, OS and Priority. |
Value |
A Value element is included for each value of the CustomAttribute data element which can trigger a Workflow due period update. The ID attribute of the Value element specifies the data element value, while the actual value of the Value element specifies how many days the Workflow due period will be incremented by. For example, the following element: <Value ID="NT">4</Value> will increment the Workflow due period by 4 days, when the workflow consumer selects the value NT from the OS data element. |
Setting Up Dynamic Workflow Due Period Adjustment
To set up dynamic Workflow Due Period adjustment for a workflow request, do the following.
To set up dynamic Workflow Due Period adjustment:
1. | Create a workflow template with a data element that can be used to determine whether to adjust the Workflow due period of a workflow request. It might be helpful to use a data element which presents the workflow consumer with a set of discrete choices, like a combo box or set of radio buttons, rather than a free text field, where the consumer’s entry cannot be easily controlled. |
2. | Locate the following files that were installed with Workflow Manager: |
C:\AdminStudioWebComponents_2020\wwwroot\bin\IPlugin.dll
C:\AdminStudioWebComponents_2020\wwwroot\bin\IPlugin2.dll
3. | Obtain the following file from Flexera Technical Support and copy it into the same directory: |
IPlugin.Test.csproj
4. | Open Visual Studio .NET 2003 or later, and include the IPlugin.Test.csproj C# project file into any solution. |
Note:This IPlugin.Test.csproj project file can be used as a basis to build enterprise business logic and to create a DLL to interpret your sla.xml file.
5. | Build the solution in Visual Studio .NET. A file named IPlugin.Test.dll is created in that solution’s Output directory. |
6. | Copy the IPlugin.Test.dll file from the Output directory to the following directory: |
C:\AdminStudioWebComponents_2020\wwwroot\bin\
7. | Locate the sla.xml file in the following directory: |
C:\AdminStudioWebComponents_2020\wwwroot\bin\Plugins
8. | Open the sla.xml file using a text editor of your choice. |
The default sla.xml file contains the following:
<?xml version="1.0" encoding="utf-8"?>
<SLACompanies>
<Company Name="Requester">
<CustomAttribute Name="OS">
<Value ID="XP">2</Value>
<Value ID="NT">4</Value>
</CustomAttribute>
<CustomAttribute Name="Priority">
<Value ID="Low">2</Value>
<Value ID="Medium">4</Value>
<Value ID="High">6</Value>
</CustomAttribute>
</Company>
<Company Name="GUID2">
<CustomAttribute Name="OS">
<Value ID="XP">12</Value>
<Value ID="2003">10</Value>
</CustomAttribute>
</Company>
</SLACompanies>
9. | Create one Company element for each of workflow consumer companies you created your workflow template for. Set the Name attribute of the element to the name of the consumer company. |
10. | For each Company element, create a CustomAttribute child element with Name set to the description of the data element used to adjust the Workflow due period of the workflow request. |
CautionMake sure that the Name of your CustomAttribute is identical to the Description of the data element that you created in the workflow template.
Note:You can create several CustomAttribute elements for the same company, and if both are collected during a workflow, both will be used to determine if the Workflow due period should be updated. You can also define CustomAttribute elements for more than one workflow consumer company in the same sla.xml file.
11. | For each CustomAttribute element, create a Value child element for each response to your data element which can cause a Workflow due period increase. Set the ID attribute of the Value element to the response you are expecting, and the actual value of the element to the Workflow due period increment that will be applied. |
12. | Save the sla.xml file. |
The next time that a workflow request created by one of the companies specified in the XML file collects one of the listed CustomAttribute data elements, the Workflow due period will automatically be adjusted based upon the consumer’s response.
See Also
Modifying Due/At Risk Period for a Specific Workflow Request