Skip to main content

Overview

This document describes the classes whereby the Workflow Engine is made available in JavaScript.

RepositorySource

Repository source enumeration.

nameFromId

Returns a string representing the specified enumeration value. Arguments:

RepositoryState

Repository state enumeration.

nameFromId

Returns a string representing the specified enumeration value. Arguments:

RepositoryAction

Repository action enumeration.

nameFromId

Returns a string representing the specified enumeration value. Arguments:

Task

The task object represents a task run by a workflow. Typically direct access to task objects are not necessary because the workflowManager keeps track of all local and remote tasks. Because it is possible to run a workflow in a remote process, the task object is only accessible to tasks that are created in the current process space. Accessing the task object is mainly done when developing custom task handler’s in JavaScript.

addError

Adds an error to the task. Version: 5.1 Arguments: Return Value: Returns true if successful, false otherwise.

addWarning

Adds an warning to the task. Version: 5.1 Arguments: Return Value: Returns true if successful, false otherwise.

complete

Completes the task. Version: 5.1 Return Value: Returns true if successful, false otherwise. Arguments: Changes in 7.0:
  • Added complete object argument

isCancelled

Gets if the task has been cancelled or not. Version: 5.1 Return Type: boolean

isCompleted

Gets if the task has been completed or not. Version: 5.1 Return Type: boolean

getAutoPreventSystemSleep

Returns true if system sleep prevention is automatically handled, false otherwise. Version: 7.2.27 Return Type: boolean

getBooleanArgument

Gets a boolean argument from the task. Version: 5.1 Arguments: Return Value: Returns a boolean expanded value of the argument.

getError

Gets a particular error from the task. Version: 5.1 Arguments: Return Value: Returns the error message at the specified index.

getErrorCount

Gets the number of errors the task has. Version: 5.1 Return Type: number

getName

Gets the name of the task. Version: 5.1 Return Type: string

getNumberArgument

Gets a number argument from the task. Version: 5.1 Arguments: Return Value: Returns a number expanded value of the argument.

getStringArgument

Gets a string argument from the task. Version: 5.1 Arguments: Return Value: Returns a string expanded value of the argument.

getTimeElapsed

Gets the amount of time that the task took to complete in seconds. Version: 5.1 Return Type: number

getType

Get the task’s type. Version: 5.1 Return Type: string

getWarning

Gets a particular warning from the task. Version: 5.1 Arguments: Return Value: Returns the warning message at the specified index.

getWarningCount

Get the number of warnings the task has. Version: 5.1 Return Type: number

hasArgument

Checks to see if the task was constructed with a particular argument. Version: 5.1 Arguments: Return Type: boolean

hasError

Checks to see if a task has a particular error message. Version: 5.1 Arguments: Return Value: Returns true if task has specified error, false otherwise.

hasWarning

Checks to see if a task has a particular warning message. Version: 5.1 Arguments: Return Value: Returns true if task has specified warning, false otherwise.

print

Prints a message to the log associated with the task. Version: 5.1 Arguments:

runSubAction

Runs a task’s action. Version: 5.1 Arguments: Return Value: Returns true if successful, false otherwise. Changes in 7.0:
  • Added complete callback argument
Example:

setAutoPreventSystemSleep

Automatically prevent the system sleep based on number of active tasks. Version: 7.2.27 Arguments: Return Value: Returns true if successful, false otherwise.

setProgress

Sets the progress of a task. Version: 5.1 Arguments: Return Value: Returns true if successful, false otherwise.

setStatus

Sets the “status” string on the task. Version: 5.1 Arguments: Return Value: Returns true if successful, false otherwise.

setStatusNumber

Sets a status number on the task. Version: 5.1 Arguments: Return Value: Returns true if successful, false otherwise.

setStatusString

Sets a status string on the task. Version: 5.1 Arguments: Return Value: Returns true if successful, false otherwise.

start

Starts a task. Version: 5.1 Return Value: Returns true if successful, false otherwise.

Workflow

The workflow object represents a workflow that is returned by workflowManager.add . Because workflows can be run remotely in another process, it is only possible to call these functions on workflow’s in the current process - those in turn should know about their associated remote workflows and tasks.

addMacro

Adds a macro key value pair to the workflow. Version: 5.1 Arguments: Notes:
  • Macros in each workflow are isolated and separate from each other.
Return Value: Returns true if successful, false otherwise. Example:

addMacroJson

Adds a set of macro key value pairs to the workflow from a JSON string. Version: 5.2 Arguments: Notes:
  • Macros in each workflow are isolated and separate from each other.
Return Value: Returns true if successful, false otherwise. Example:

cancelTasks

Cancels queued and currently running tasks. Version: 5.1 Return Value: Returns true if successful, false otherwise.

canCreateTask

Checks to see if it is possible to create the task on the workflow. Version: 5.1 Arguments: Return Type: boolean Example:

complete

Completes the workflow Version: 5.1 Return Value: Returns true if successful, false otherwise.

expandString

Expands a string using the workflow’s macro key/value pairs. Version: 5.1 Arguments: Return Value: Returns expanded string. Example:

hasRemoteTask

Checks to see if a remote task is part of the workflow. Version: 5.1 Arguments:

hasRemoteWorkflow

Checks to see if a remote workflow is part of the workflow. Version: 5.1 Arguments:

hasTask

Checks to see if a task is part of the local workflow. Version: 5.1 Arguments:

isActivated

Checks to see if there are any events that are running. Version: 5.1

isGlobal

Checks to see if the workflow is global (not run by another workflow). Version: 5.1

isTaskQueued

Checks to see if a task is queued and waiting to be run. Version: 5.1 Arguments:

isTaskRunning

Checks to see if a task is running. Version: 5.1 Arguments:

queueTask

Queues a task. Will wait for any already running tasks to finish before running. Version: 5.1 Arguments: Return Value: Returns true if successful, false otherwise. Example:

queueTaskWithMacros

Queues a task with macros. Will wait for any already running tasks to finish before running. Version: 6.1 Arguments: Return Value: Returns true if successful, false otherwise. Example:

runTask

Runs a task immediately. Version: 5.1 Arguments: Return Value: Returns true if successful, false otherwise. Notes:
  • This function has a potential to be a blocking operation. Consider using queueTask instead.
Example:

runTaskWithMacros

Runs a task immediately with specified macros. Version: 6.1 Arguments: Return Value: Returns true if successful, false otherwise. Notes:
  • This function has a potential to be a blocking operation. Consider using queueTaskWithMacros instead.
Example:

setStatus

Sets the “status” string on the workflow. Version: 5.1 Arguments: Return Value: Returns true if successful, false otherwise.

setStatusNumber

Sets a status number on the workflow. Version: 5.1 Arguments: Return Value: Returns true if successful, false otherwise.

setStatusString

Sets a status string on the workflow. Version: 5.1 Arguments: Return Value: Returns true if successful, false otherwise.

WorkflowManager

The workflow manager has the responsibility of starting workflows and tracking all workflow events. It is necessary for it to track all task and workflow information that is sent to it due to the possibility of running workflows in an elevated process using the workflowRun task.

add

Adds new workflows. Version: 5.1 Arguments: Complete Callback Arguments: Example:

addDependency

Creates a new dependency using the ids associated with each workflow when they are started. Version: 5.2 Arguments: Return Value: True if successful, false otherwise.

clearTaskAvailability

Clears tasks available for a workflow to run. Version: 5.2 Arguments: Return Value: True if successful, false otherwise.

getFlowControl

Gets whether or not to manage triggering the start and unload tasks automatically. Version: 5.2

getMaximumActiveTasks

Gets the maximum number of tasks that can be active at any one time. Version: 5.2

isTaskInWorkflow

Checks to see if a particular task is run as part of a particular workflow. Version: 5.1 Arguments: Example:

isUnloaded

Checks to see if any loaded workflows remain running. Version: 5.1

isUnloading

Property used to indicate if the workflow manager is unloading workflows. Version: 5.1

queueAvailableTasks

Queues all the available tasks with a specific name across all workflows. Version: 5.2 Arguments: Return Value: True if successful, false otherwise.

queueAvailableTasksByWorkflow

Queues all the available tasks with a specific name for a certain workflow. Version: 5.2 Arguments: Return Value: True if successful, false otherwise.

queueTask

Starts a task if there are open spots, otherwise it queues the task. Version: 5.2 Arguments: Return Value: True if successful, false otherwise.

registerTaskHandler

Registers a custom task handler for a custom task type. Version: 5.1 Arguments: Example:

setDependencyTaskNames

Sets the names of the tasks that are checked for dependencies before starting. By default tasks are checked from in bottom-to-top order, but task names that start with an exclamation mark are checked from top-to-bottom order. Version: 5.2 Arguments: Return Value: True if successful, false otherwise.

setFlowControl

Sets whether or not to manage triggering the start and unload tasks automatically. Version: 5.2 Arguments: Return Value: True if successful, false otherwise.

setMaximumActiveTasks

Sets the maximum number of tasks that can be active at any one time. Version: 5.2 Arguments: Return Value: True if successful, false otherwise.

setProgress

Sets the progress for an active task. Version: 5.2 Arguments: Return Value: True if successful, false otherwise.

setProgressTaskNames

Sets the names of the tasks whose progress is tracked by the manager. Version: 5.2 Arguments: Return Value: True if successful, false otherwise.

setQueueTaskNames

Sets the names of the tasks that can be queued. If a task whose name matches one of these, it will be queued, otherwise it will be run immediately. Version: 5.2 Arguments: Return Value: True if successful, false otherwise.

setTaskAvailability

Sets whether or not a task is available for a workflow to run. Version: 5.2 Arguments: Return Value: True if successful, false otherwise.

unload

Unloads all the workflows and fires the complete callback when done. Version: 5.1 Arguments:

unregisterTaskHandler

Unregisters a custom task handler for a custom task type. Version: 5.1 Arguments: Example: