Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Excerpt

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

 

Syntax

Code Block
themeRDark
languagejavascript
linenumberstrue
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:

Code Block
themeRDark
languagejavascript
linenumberstrue
Processes("foo").removeTask(...).addTask(...).run();
0.1

Examples

 

Div
classbox

Availability

Requires:

  • Warzone 3.1 or above
  • Process 0.1 or above
Div
classbox

See also

Essential reading: