(info) This AI is still in early stages of development.

instance.removeTask()

Remove any matching tasks, or all tasks, from a process instance.

 

Syntax

Processes("myProcess").removeTask(task, taskName, scope);

Parameters

(warning) If a parameter is specified as null it will be ignored. Tasks will only be removed if all non-null parameters are matched.

(minus) If you don't specify any parameters, all tasks will be removed from the process instance!!

ParameterTypeMandatoryNotesPulse Version
task

Task

Null

(error)

A task function or null.

If a task function is specified, tasks can only be removed if they match that exact task function.

0.1
taskName

String

Null

(error)

A taskName or null.

If a taskName is specified, tasks can only be removed if they have that exact taskName.

Note that if you added tasks via an array in the instance.addTask() method, each of those tasks will have had the array index appended to it's taskName.

0.1
scope

Object

Null

(error)

A scope object or null.

If a scope object is specified, tasks can only be removed if they were added with that scope.

0.1

Return value

ValueTypeNotesProcess Version
<instance>Process Instance

The process instance is returned, so you can chain more instance methods, eg:

Processes("foo").removeTask(...).addTask(...).run();
0.1

Examples

 

Availability

Requires:

  • Warzone 3.1 or above
  • Process 0.1 or above

See also

Essential reading:

  • Tasks – how to define them
  • Process Instances – everything you wanted to know about process instances

Â