Specifying details for a Set Parameter element
- Select the Set Parameter element to display the Set Parameter Properties pane.
-
Specify this information:
- Name
- Specify a name for the Set Parameter element.
- Parameters to be set
- 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.
- Assign with
- Specify one of these assignment types:
- Value: The parameter is assigned with a fixed value.
- Parameter: The parameter is assigned with the value of another parameter.
-
Expression: The
parameter is assigned with an expression.
Only applicable for parameter types Integer, Decimal, Date And Time, String, and Hyperlink.
- Person Name for Person ID: The parameter is assigned with the value of the Common Name field corresponding to the given Person ID in IFS.
Only applicable for Parameter type String. The Person ID can be retrieved from a parameter of type String or User.
- Value from Structure: The parameter is assigned with a value extracted or calculated from a structure.
Only applicable for Parameter types String, Boolean, Integer, Decimal, Date, Date and Time.
- Value
- This field is displayed if you specified the Value 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 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 assignment type. Specify the expression that must be assigned to the parameter.
- For parameters of type integer and decimal, an expression consists of numeric parameters between brackets and operators. Valid operators are '+', '-', '*', and '/'. Additionally, parentheses can be used.
- To select from a list of available numeric parameters, press Ctrl+Spacebar. To select a parameter, use the arrow keys and press Enter, or use the mouse. To leave the list without selecting a parameter, press Esc.
- 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 instance.
- MAJORVERSION() to get the major version of the workflow definition.
- MINORVERSION() 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
- Operators
- The parameters of type hyperlink, code, and integer are automatically converted to strings when the expression is evaluated.
- 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. White spaces are space, tab, and enter- GETLAST(string, length) to extract the last characters of a string
- TOUPPERCASE(string) to convert the whole string to uppercase
- TOLOWERCASE(string) to convert the whole string to lowercase
- NAME() to get the workflow definition name for the current workflow
- SOURCETYPE(string) to get the source type that started this workflow.
Possible source types are:
- Manual
- Alert
- Process.Workflow BOD
- Workflow
- Activation Policy
Note that when a workflow is started from a document flow the source type is Process.Wokflow BOD
- SOURCE(string) to get the identifier of the source that started this workflow instance. Depending on the source type, the identifier can be: the user identifier, the alert ID, the logical ID of the Process.Workflow BOD, the Activation Policy name or the workflow definition name..
- Ampersand (
- You can nest the string operators. Use square brackets for parameter placeholders and double quotes for constant string values.
- To select from a list of available parameters, press Ctrl+Spacebar. To select a parameter, use the arrow keys and press Enter, or use the mouse. To leave the list without selecting a parameter, press Esc.
- The expression is validated when you leave the input field.
If valid expressions are defined that fail at runtime, the workflow
execution fails in this set parameter step. These are examples of
failures:
- A parameter used in an expression has not been initialized and has value NULL.
- The result of a concatenation is a string with more than 4000 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 and time you can specify an expression using these operators:
- NOW() to receive the current date and time as UTC.
- STARTTIME() to receive the time when this workflow instance was started, as UTC time.
- Person Name for Person ID
- This field is displayed when you specified the Person Name for Person ID assignment type. Select a parameter that contains the person ID for which the user name should be retrieved. Any parameter of type string or User, other than the parameter to be assigned, is displayed and can be selected.
- If 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.
- If 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 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, 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, 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, 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, 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, the Default Value is returned. Decimal Get field value Returns the field value that is pecified in the path. The result is a decimal value. If there are no occurrences of this field, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, the empty string is returned. If the concatenated string values exceed a total length of 4000 characters, 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 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 zoom button (three dots) 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 This is the default option. This means 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 If you select 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 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 assignment type and used it 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.