Expression functions are used to define calculation data items that can be resused in many different assignment profiles. If your business requirement changes at any time, you only have to update the calculation data item and not each individual assignment profile. Expression functions are also used to define rules in a process or solution.
To calculate a dynamic due date based on the time a process is started, complete the following steps:
- Check out the solution that you want to edit.
- Click the Create tab. The Solution Items ribbon menu is displayed.
- Click New Data item. The Manage Solution Data Items window is displayed in the workspace.
- In the Name column of the new row, type a name for the data item. The default name is changed.
Note: |
The Rule Engine does not support hyphens in field names. |
- In the Data Item type column of the new row, click the drop-down arrow. A drop-down list is displayed.
- In the Properties tab, click the drop-down arrow in the Data Type column.
- Click DateTime. By default the Format Type is set to the DateTime option as well.
- In the Default Value field, type a default value and click the save button once complete.
- Open the process that you would like to change and double-click the Start activity.
- Click the Data Item Assignments tab and the Data Item Assignments fields are displayed.
- Click the Data Item editor and a drop-down list is displayed.
- Click a data item that you created in the steps above.
- Using the Expression editor enter an expression that will return a date/time.
Example: |
If your business requires that a task is completed five days from the time the process starts, then select a data item that uses the AddDays function to add five days to the due date data item. The function would appear as follows: AddDays(Solution.DataItems.ProcessStartDate, 5). If you would like that task to be completed five days from the current time, the function would appear as follows: AddDays(Now(), 5. In order to specify an activity that is due in a matter of days, it is recommended that you use the AddX function to set the amount of days from a given point. |
- Click OK and then click the save button.
- Open the assignment profile that you would like to update with the new data item.
- Select the Due Date check box. The Due Date fields are enabled.
- Select Due after. The Due after field is enabled.
- In the Due after field, click the Data Item editor and a drop-down list is displayed.
- Click the data item that you created in the steps above and click the save button. You calculated a dynamic due date based on the time a process is started.