Modify Task logic
  • 11 Feb 2022
  • 6 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

Modify Task logic

  • Dark
    Light
  • PDF

Allows to modify (update) task in other available process.

There are two required requirements for modifying tasks via Modify Task logic:

Task reference can be specified with:

  • any system parameter of the current process. For example, {{root.ref}} or {{root.task_id}}
  • any other parameter of the current task {{parameter_name}}
  • constant. For example, config, ref etc.

modify

Nodes in the gray box are added automatically for error handling.

Basic settings

copy_tasks_settings(1)

Process - selection of a process for copying from "tree of folders". It can be found by its name or its ID or using the {{conv_id}} (parameter of the task).

Reference - the reference of a new task that is created in another process.

New task reference can be specified by:

  • any system parameter. For example, {{root.ref}} or {{root.task_id}}
  • any other task parameter {{parameter_name}}
  • constant. For example, config, ref etc.

Copy all parameters - this option gives a possibility to copy all parameters to a new task.

Note

If both tasks have a parameter with the same name, parameter value will be updated by Modify Task.
Parameters that were not in the updated request will be added there.

Parameters

copy_tasks_params(1)

Button + Add "key-value" adds new parameter

Key - parameter name
Value can be specified by:

  • constant
  • {{parameter_name}} from task which name will be pasted
  • any system parameter of the current process. For example, {{root.ref}} or {{root.task_id}}

If Copy all parameters flag is enabled, it is not required to add new parameters.

Otherwise be sure to add at least one parameter.

Additionally

modify_additionally

Alert when there is tasks queue

Critical amount of tasks in the node.

Learn more about how it works here.

Limit the time of the task in the node

Time interval value at which task will go further through process in case if Copy task logic does not reply.

Learn more about how it works here.

Synchronous callback

Synchronous callback - checking this box enables modification of tasks synchronously. It means that tasks will be updated sequentially - strictly one after another.
With that, only the tasks located in Waiting for Callback logic nodes are modified. Thus, if the specified task is located in any node of a type other than Waiting for Callback at the moment of Modify Task work, the task will not be modified and the system will display the corresponding error.

Note

If you modify one task at the same time, the duplicate_callback error will occur.

Modify Task operation in asynchronous and synchronous modes

In asynchronous mode (default), after receiving a task from the Corezoid API, the Modify Task node performs the following checks for the task:

  1. Checking for the task in the system:
    It is performed to find out if there is a task with the specified Reference number in the system. If no such task is found in the system, the current task is discarded, and the Modify Task node proceeds to process the next task received from the Corezoid API;

  2. Checking for the availability of a Waiting for Callback/Set State node:
    It is performed to find out if there is an available Waiting for Callback or Set State node, to which the task can be sent after the processing. If such node is unavailable at the time of the check, the task is moved to one of the waiting queues*. When a queue waiting interval elapses, the task is retrieved from the waiting queue and the checks are performed for it again;

  3. Checking for the expected database response after Modify Task execution:
    It is performed to find out if the database responds in the expected manner. If the expected response is received, the modification of the task in the database has been successful, and the task is processed further. If the expected response is not received, the task is moved to one of the waiting queues*. When a queue waiting interval elapses, the task is retrieved from the waiting queue and the checks are performed for it again.

*When point 2 or 3 check requirements are not met for the first time, the task is moved to the queue with 1-second waiting interval. After the waiting interval is over the task is retrieved and rechecked. When the requirements are not met at the second check, the task is moved to the 2-second waiting queue, and then rechecked. When the check requirements are not met for the third time, it is moved to the 3-second waiting queue. After the fourth failure to meet the check requirements, the task is deleted. Thus, the task can spend up to 6 seconds in waiting queues before being processed.

After passing through all the steps, the task is moved to Waiting for Callback or Set State target node and processed further.

Working in synchronous mode is similar to working in asynchronous mode, except that two additional operations (2 and 5) are performed on the task:

  1. Checking for the task in the system;
  2. Blocking the task processing for the Corezoid API;
  3. Checking for the availability of a Waiting for Callback/Set State node;
  4. Checking for the expected database response after Modify Task execution;
  5. Unblocking the task processing for the Corezoid API.

*Operation 2, blocking the task processing, allows preventing Corezoid API from sending multiple requests to the same process.

Types of error

Internal system error when copying

Parameter name Value
conveyor_copy_task_return_type_error hardware
conveyor_copy_task_return_type_tag copy_task_fatal_error
conveyor_copy_task_return_description Error running copy task
Parameter name Value
conveyor_copy_task_return_type_error hardware
conveyor_copy_task_return_type_tag crash_api
conveyor_copy_task_return_description Error copy_task request
Parameter name Value
conveyor_copy_task_return_type_error hardware
conveyor_copy_task_return_type_tag copy_task_timeout
conveyor_copy_task_return_description timeout for executing copy_task request

Not found task

Parameter name Value
conveyor_copy_task_return_type_error software
conveyor_copy_task_return_type_tag not_found_task
conveyor_copy_task_return_description not found task

There is no task with specified reference in the process.

Incorrect parameters

Parameter name Value
conveyor_copy_task_return_type_error software
conveyor_copy_task_return_type_tag wrong_validate_params
conveyor_copy_task_return_description Param: , Error:

Failed to validate one of the parameters.

Failed to convert parameter

Parameter name Value
conveyor_copy_task_return_type_error software
conveyor_copy_task_return_type_tag copy_task_wrong_convert_param
conveyor_copy_task_return_description Param: , Value: , Try convert to:

For example, you parameter type is Number, but value is string or parameter is missed.

Inactive process

Parameter name Value
conveyor_copy_task_return_type_error software
conveyor_copy_task_return_type_tag conveyor_is_not_active
conveyor_copy_task_return_description conveyor is not active

Process must be in the Active state.

Access is denied

Parameter name Value
conveyor_copy_task_return_type_error software
conveyor_copy_task_return_type_tag access_denied
conveyor_copy_task_return_description user: <user_id>, conv_id: <proc_id>

User must have Task management access to copy task.

Task size overflow

Parameter name Value
conveyor_copy_task_return_type_error software
conveyor_copy_task_return_type_tag copy_task_size_overflow_limit
conveyor_copy_task_return_description Your task size: bytes, Max available task size: <max_size> bytes, Try to change your data or try to split your task

Maximum allowed size - 128 Kb.

Duplicate modification of the task

Parameter name Value
conveyor_copy_task_return_type_error software
conveyor_copy_task_return_type_tag duplicate_callback
conveyor_copy_task_return_description The last one callback is still running. You should wait

It appears only with the flag turned on Synchronous callback. The new changement of the request will not be activated until the previous one finishes.
Standardly if this mistake occurs the request goes to the node with the logic Delay for the second try in 30 seconds.

No callback logic in node with the task

Parameter name Value
conveyor_copy_task_return_type_error software
conveyor_copy_task_return_type_tag no_api_callback_in_node_with_task
conveyor_copy_task_return_description no api callback logic in node with task

This error occurs if Synchronous callback is enabled.
Otherwise the result is __conveyor_copy_task_result__": "ok".


Was this article helpful?

What's Next