- Print
- DarkLight
- PDF
Overview
The Set Parameters node offers a simple and efficient way to work with task variables. By using this node, you can:
- Create new variables
- Clean up variable names
- Perform operations with variables that are too trivial for the Set Parameters node
Settings
The Set Parameters node has the following parameters:
(Optional) Title and Description: Name and details of the node.
Parameters:
- Key: Key to specify variables; use a unique name. When updating existing variables, use their original names as a key.
- Value: The value you want to assign to the corresponding Key parameter. The value can be a constant, a variable reference, or a function applied to a variable.
- Type of data:
- String (S)
- Number (N)
- Boolean (B)
- Array (A)
- Object (O)
- Code editor: Shows the JSON format of the entered key and value. You can write and include additional code, which will be executed when a task enters the node.
- To add a key-value, click + Add “key-value” below the Key field.
- To delete the key-value line, click the trash icon on the right side of the key-value line.
Other:
- Alert if the number of tasks in the node queue reaches the following number: Helps monitor whether the number of tasks in the node exceeds the specified threshold. When selecting the checkbox, you have to enter the needed number of tasks in the field that appears below.
- Maximum interval, for which the task stays in the node before being forwarded: The amount of time a task is allowed to be in the node can be set in seconds, minutes, hours, and days.
Note: The checkbox has a minimum value of 30 seconds. You can set a shorter interval by using the Unixtime function.
Examples
Defining a new parameter
In the example below, you can see how to define a new parameter as a constant in a Process.
The value of a new parameter doesn't have to be a constant. You can assign it a value based on a task parameter or a value stored in a State Diagram.
Changing parameter value
Below, you can see examples of two ways of modifying the parameter value:
Replacing a value of an existing parameter with a new one.
To perform the replacement, the parameter key specified in the Set Parameters node must exactly match the key of an existing task parameter. The parameter matching the key ensures that the correct parameter value is updated and prevents accidentally creating a new parameter with the same name.
Modifying a value of an existing parameter by using the $.math() function to add or subtract a certain value from the original value.
If the task goes to the Error node for any reason after passing through the Set Parameters node, no parameters will be modified or added, and none of the changes specified by the Set Parameters node will be applied.
You can access a single task parameter or a whole task stored in a State Diagram by Getting Task Parameters from State Diagrams.
Error handling & troubleshooting
When an error occurs during the task processing, you may see the following error parameter names in the task.
Error parameter name | Parameter type |
---|---|
__conveyor_set_param_return_type_error__ | Hardware (system error), Software (error in a node logic/settings). |
__conveyor_set_param_return_type_tag__ | *Error tag. |
__conveyor_set_param_return_type_description__ | Error description in human-readable language; can be static or dynamic. |
*The error __conveyor_set_param_return_type_tag__
may have the following values.
Value | Cause | Solution |
---|---|---|
access_denied | You don't have access to the Process. | Contact the Process owner to give you access. |
access_denied | You are trying to send or receive tasks from another stage. | Getting and sending tasks between stages is not permitted. Use the same stage to send and receive tasks. |
access_refused | The Process you are working in is not a State Diagram but it must be a State Diagram. | Check the logic of using a State Diagram. For more information, go to State Diagram. |
conv_not_found_or_deleted | You are trying to work with a non-existent Process. | Use an existing Process. |
not_found_conv_by_alias | Your alias refers to a Process that no longer exists. | Use an existing Process. |
set_param_task_size_overflow_limit | The size of the task data exceeds the specified limit set for your environment. | Reduce the size of your task. |
set_param_wrong_convert_param | Parameter value conversion failed with the specified parameter type. | Check and correct the parameter's data type specified in the error message. |
set_param_wrong_create_obj | Object conversion failed. | Contact the support team to send ExceptionReason. |
bad_callback_node | The Process you are calling doesn't have the Callback node. | Create the Callback node in the Process you are calling. |
When working with your Process or State Diagram, you may encounter the following issues.
Issue | Cause | Solution |
---|---|---|
The Set Parameters node sends its tasks to the associated Error End node. | The function was called by using a missing or incorrectly formatted parameter. | Ensure all parameters used by your functions are declared and have the appropriate type. For example, to use the $.math({{x}}+{{y}}) function in a task, both x and y parameters must exist and have the Number type values. |
The parameter accessed from another State diagram using conv/proc is missing in the State Diagram or has a different type than specified. | Change the parameter type you are requesting or add the required parameter to the State Diagram. Note: Parameters of the String type are an exception. If the String parameter requested using conv/proc doesn’t exist in a State Diagram, the Set Parameters node will work without errors, but the new parameter will be empty. | |
The parameter has a non-numerical value, even though it was declared a Number. For example, x = 1abc (Number). | When declaring the parameter, remove everything that isn’t numeric (values that are not 0-9 numbers, decimal points, negative signs, and so on) from the Value field. | |
The parameter was initialized in one key-value input field of the Set Parameters node, and then the same parameter was assigned a new value in another input field. | Parameters get assigned a value after passing through the node. Therefore, you cannot modify the parameter in the same node it was initially set. To solve this issue, assign the parameter the needed value immediately or modify it later by using another node. |