Specifying details for a Set Parameter element
- Select Set Parameter to view the Set Parameter Properties pane.
- In the Set Parameter Properties pane, specify a name for the Set Parameter element.
- Click the + icon to add one or more rows to the list of parameters to be set.
- On each row, select a parameter name in the Name column.
Each workflow parameter can be selected only once.
The Data Type column is automatically filled with the data type of the selected parameter.
The Assignment Type column is automatically filled with “Value” and the parameter is set with a default value specific to the data type.
- Select a row to open the Set Parameter details panel.
In this panel, you can change the assignment type and the values that are used in the assignment.
- Specify one of these assignment types:
- Value: The parameter is assigned with a fixed value.
- Value from Structure: The parameter is assigned with a value extracted or calculated from a structure.
This option is only applicable for these parameter types: String, Boolean, Integer, Decimal, Date, Date and Time.
- Parameter: The parameter is assigned with the value of another parameter.
- Person Name for Person ID: The parameter is assigned with the value of the Common Name field that corresponds to the specified person ID in IFS.
This option is only applicable for the parameter type String. The person ID can be retrieved from a parameter of type String or User.
- Expression: The parameter is assigned with an expression.
This option is only applicable for these parameter types: Integer, Decimal, Date and Time, String, and Hyperlink.
- Specify this information:
- Value
-
This field is displayed if you specified the Value as the assignment type. Specify the fixed value that must be assigned to the parameter. This table shows an example:
Parameter Assign with Value Isvalid (boolean) Value True Isvalid (boolean) Value False - Value of Parameter
- This field is displayed if you specified the Parameter as the assignment type. Specify the parameter that must be assigned to the parameter. You can only select parameters of the same type.
- Expression
-
This field is displayed if you specified the Expression as the assignment type. Specify the expression that must be assigned to the parameter. The expression must follow these rules:
- For parameters of type Integer and Decimal, an expression consists of numeric parameters between brackets and operators. Valid operators are +, -, *, and /. Additionally, you can use parentheses.
Press Ctrl+spaceber or Ctrl+Alt+spacebar to include the value of a parameter.
This table shows an example:
Parameter Assign with Value Profit (decimal) Expression [Salesprice] - [Purchaseprice] You can assign a parameter of type Integer or Decimal with a value about the current workflow instance. These operators can be used:
ID()to get the ID of the current workflow instanceMAJORVERSION()to get the major version of the workflow definitionMINORVERSION()to get the minor version of the workflow definition
- For parameters of type String and Hyperlink, an expression consists of these elements:
- String constants
- String parameters
- Parameters of type Hyperlink, Code, or Integer
Note: The parameters of type Hyperlink, Code, and Integer are automatically converted to Strings when the expression is evaluated.
- Operators
You can use these operators:
- Ampersand (
&) to concatenate two or more strings SUBSTRING(string, start index, length)to extract a substringREPLACE (string, substring, replacement)to replace all occurrences of substringTRIM(string)to trim beginning and ending white spaces such as space, tab, and enterGETLAST(string, length)to extract the last characters of a stringTOUPPERCASE(string)to convert the whole string to uppercaseTOLOWERCASE(string)to convert the whole string to lowercaseNAME()to get the workflow definition name for the current workflowSOURCETYPE(string)to get the source type that started this workflow. Possible source types are:- Manual
- Alert
- Process.Workflow BOD
- Workflow
- Activation Policy
- Workflow Scheduler
- API
When a workflow is started from a document flow, the source type is Process.Workflow BOD.
SOURCE(string)to get the identifier of the source that started this workflow instance. Depending on the source type, one of these identifiers is retrieved:- User
- Alert ID
- Logical ID of the Process.Workflow BOD or API
- Activation Policy name
- Workflow name
- Workflow Scheduler name
You can nest the String operators. Use square brackets for parameter placeholders and double quotes for constant string values.
Press Ctrl+spacebar or Ctrl+Alt+spacebar to include the value of a parameter.
The expression is validated when you leave the input field. Validation errors are listed in the Notifications pane.
When a workflow with a Set Parameter step fails on the expression during runtime, then the original parameter value, or the value set in the previous steps in the workflow, are kept. Examples of failures:
- A parameter used in an expression is not initialized and has value NULL.
- The result of a concatenation is a string with more than 4,000 characters.
This table shows examples of expressions with strings:
Parameter Assign with expression Result Prefix(string) SUBSTRING("abcde", 1, 3) “abc” TestX(string) REPLACE("a_ba_ca_", "a_", "x") “xbxcx” Link(hyperlink) “http://” & [Prefix] & “.com” “http://abc.com” Address(string) [Street] & SUBSTRING([AddressLine], 1, 3) Value of Street concatenated with the first three positions of the AddressLine - For parameters of type Date you cannot specify an expression.
- For parameters of type "Date and Time" you can specify an expression using these operators:
NOW()to receive the current date and time as UTCSTARTTIME()to receive the time when this workflow instance was started, as UTC time
The expression is validated when you leave the input field. Validation errors are listed in the Notifications pane.
When a workflow with a Set Parameter step fails on the expression during runtime, then the original parameter value, or the value set in the previous steps in the workflow, are kept.
Note: Date and time is based on epoch time (milliseconds after Jan 1, 1970, midnight GMT). Therefore, the results of the calculation cannot be earlier than this date and time. If the calculation returns date and time before 01.01.1970 00:00:00, then the value 01.01.1970 00:00:00 is returned as the result.
- For parameters of type Integer and Decimal, an expression consists of numeric parameters between brackets and operators. Valid operators are +, -, *, and /. Additionally, you can use parentheses.
- Person Name for Person ID
-
This field is displayed when you specified the Person Name for Person ID as the assignment type. Select a parameter that contains the person ID for which the user name must be retrieved. Any parameter of type String or User, other than the parameter to be assigned, is displayed and can be selected.
The selected parameter contains a valid person ID. The result of this assignment is the value of the Common Name field from IFS, corresponding to this person ID. The person ID can be obtained from the completion properties of a previous user Task, or as an input parameter to the workflow.
The selected parameter does not contain a valid person ID, or there was an error retrieving the user name from IFS. The result of this assignment is the value of the parameter selected for the Person ID field.
Two users with the same name in a company can cause confusion. We recommend then to show the user name and the person ID in subsequent Tasks or Notifications.
This table shows an example:
Parameter Assign with Person Name for Person ID UserName (string)Person Name for Person ID UserID (string, user) - Function
-
This field is displayed if you specified the Value from Structure as the assignment type. Depending on the parameter data type, a pre-defined set of functions is available. You must select one function to apply. The function is applied to the element of the structure that is selected in the Path property. If the function does not return a valid result, then the parameter is assigned with the Default Value specified.
This table shows the functions available for each data type:
Parameter type Function Result Boolean Get field value Returns the field value that is specified in the path. Possible results are "True" or "False". If there are no occurrences of this field, then the Default Value is returned. Date or DateAndTime Get field value Returns the field value that is specified in the path. The result is a Date or a DateAndTime value. If there are no occurrences of this field, then the Default Value is returned. Maximum value From all field occurrences that are specified in the path, returns the one with the highest value. This is the latest date value. If there are no occurrences of this field, then the Default Value is returned. Minimum value From all field occurrences that are specified in the path, returns the one with the lowest value. This is the earliest date value. If there are no occurrences of this field, then the Default Value is returned. Decimal Get field value Returns the field value that is specified in the path. The result is a decimal value. If there are no occurrences of this field, then the Default Value is returned. Maximum value From all field occurrences that are specified in the path, returns the one with the highest value. If there are no occurrences of this field, then the Default Value is returned. Minimum value From all field occurrences that are specified in the path, returns the one with the lowest value. If there are no occurrences of this field, the Default Value is returned. Average value Calculates the average from all field occurrences that are specified in the path. If there are no occurrences of this field, then the Default Value is returned. Sum of values Calculates the sum of all field occurrences that are specified in the path. If there are no occurrences of this field, then the Default Value is returned. Integer Get field value Returns the field value that is specified in the path. The result is an integer value. If there are no occurrences of this field, then the Default Value is returned. Maximum value From all field occurrences that are specified in the path, returns the one with the highest value. If there are no occurrences of this field, then the Default Value is returned. Minimum value From all filed occurrences that are specified in the path, returns the one with the lowest value. If there are no occurrences of this field, then the Default Value is returned. Count values Counts all occurrences of the field or level that is specified in the path. If there are no occurrences of this field, then the value zero is returned. Sum of values Calculates the sum of all field occurrences that are specified in the path. If there are no occurrences of this field, then the Default Value is returned. String Get field value Returns the filed value that is specified in the path. The result is an integer value. If there are no occurrences of this field, then the Default Value is returned. Concatenate values Returns the concatenated string of all occurrences of the field that is specified in the path. Delimited by the string that is specified in the Separator property. If there are no occurrences of this field, then the empty string is returned. If the concatenated string values exceed a total length of 4,000 characters, then the execution of the workflow instance fails. An error message is displayed in the workflow instances manage screen.
- Path
-
This field is displayed if you specified the Value from Structure as the assignment type and is used in combination with the selected Function. You must specify a path in a structure on which the selected function is applied. To specify a path:
- Click the … button next to the Path field. A dialog box, where all workflow structures are listed, is displayed.
- Expand the structure from which to make a selection. The structure fields and levels are displayed. Only the fields that have the same data type as the parameter in the assignment have a selection option next to them. Select an option to specify which field to use. At the bottom of the dialog, the path to the field is displayed. By default, the function applies to all occurrences of the field with this path from the workflow structure.
- Optionally, select one level from the path to the selected field. You can specify a filter for the level. This table shows the options:
Option Effect All The default option. All occurrences of this level and its children are taken into consideration when the function is applied. First Only the first occurrence of this level and its children is taken into consideration when the function is applied. Last Only the last occurrence of this level and its children is taken into consideration when the function is applied. Parameter When selecting this option, you must also select a parameter of type Integer. Set the specified parameter with a value that can be used as an index in the structure. Do this before the Set Parameter step is reached. Only the occurrence with the index that is specified in the integer parameter is taken into consideration when the function is applied. The first occurrence in a structure has index 1. If the index is out of bounds, the Default Value corresponding to the selected function is returned. - Click OK to confirm the path selection and return to the workflow model screen.
- Default Value
-
This field is displayed if you specified the Value from Structure as the assignment type and is used in combination with these functions:
- Get field value
- Maximum value
- Minimum value
- Average value
- Sum of values
You must set this field to the value of the same data type as the parameter in the assignment.
- Separator
-
This field is displayed if you specified the Value from Structure as the assignment type and is used in combination with the "Concatenate values" function for parameters of type String.
You can specify any string in this field. The specified string is used to delimit concatenated values. Empty string or spaces are also allowed as separator.