Create task
Command Description
Dispatch the Commander to create the Individual Task to be executed by executing the command, so as to realize the circular call execution of the process itself, or chain call execution across process
Command Prototype
TaskID = Task.CreateTask(processId,departmentId,robotOption,count,priority,isRecord,maxRuningTime,optionArgs)
Command parameter
parameter | mandatory | type | default value | Instructions |
---|---|---|---|---|
processId | True | string | "" | Process ID: select a scheduled process based on the process authorized by the current user in the Commander |
departmentId | True | string | "" | Department ID, based on the department to which the current user belongs in the organizational structure (supports belonging to multiple departments), select a department to be scheduled |
robotOption | True | string | "" | Execute Worker, double-click to select Worker group, or click to select specified Worker for scheduling |
count | True | number | one | Number of task, specifying the number of task to be created, up to 100 |
priority | True | number | 0 | Task priority: high, medium and low |
isRecord | True | boolean | false | Enable screen recording. Whether to enable screen recording when the task is running. Default is "No" |
maxRuningTime | True | number | 0 | Maximum Run Time, which can limit the Maximum Run Time of task. The unit is minute, and the range cannot exceed 10080 minutes. If it is 0, there is no limit on the running time |
optionArgs | False | expression | {} | Task option parameter, process input (transfer the relevant process input value to the task) and validity period (in days, range 1~360, if the task does not run after the validity date, it will become invalid) |
Return result
TaskID, Assign the result of running the command to this variable.
Run instance
/**************************Create Task**************************
Command prototype:
TaskID = Task.CreateTask(processId, departmentId, robotOption, count, priority, isRecord, maxRuningTime, optionArgs)
Input parameters:
processId -- Process ID. Note: Process ID.
departmentId -- Department ID. Note: Department ID.
robotOption -- Execution Worker. Note: You can double-click to select a Worker group, or click to select a specified Worker for scheduling.
count -- Task quantity. Note: Specify the number of tasks to be created, up to 100.
priority -- Task priority.
isRecord -- Enable screen recording. Note: Whether to enable screen recording when the task is running, default is "No".
maxRuningTime -- Maximum running time. Note: You can limit the maximum running time of the task, in minutes. The range cannot exceed 10080 minutes. If it is 0, there is no time limit.
optionArgs -- Task option parameters. Note: Process input (pass relevant process input into the task) and validity period (in days, range 1 - 360. If the task has not been run after the validity period, it will be invalid).
Output parameters:
TaskID -- The variable where the output of the function call is saved.
Notes:
None
******************************************************************/
Dim sRet = ""
TaskID = Task.CreateTask("processId","departmentId","robotOption",1,0,false,0,{})
TracePrint(TaskID)