Skip to content

Wi

A "Wi" or workflow instance is an object that holds information about a workflow that has run or is running. The workflow instance contains all the data about the status of each task, trigger, edge and other entities as the workflow ran and can be used to reconstruct what happened as the workflow ran.

Instance Methods

getName()

Returns the name of the workflow

getName()

Returns the name of the workflow

getName()

Returns instance id of this workflow's execution.

getTimeStarted()

Returns the time this workflow started

getTimeStopped()

Returns the time this workflow stopped running. It may have completed or was canceled.

getLastTaskStatus()

Returns the last task status reported by this workflow instance. If complete or canceled, this will be a workflow status.

getStatus(objectName) → Status

Returns the task status of the last exeuction of the named object.

Returns: Status - A Status object or null if no object was found.

Parameters:

ParameterTypeDescription
objectNameStringThe name of the object (task, trigger, edge, etc.) of the status you are looking for.

getTaskStatus(objectName, instance) → Status

Returns the task status of the named object and instance. The instance is incremented each time an object runs within a thread. Therefore, the instance distingueshes the specific execution of the object if it has run more than once.

Returns: Status - A Status object or null if no object was found.

Parameters:

ParameterTypeDescription
objectNameStringThe name of the object (task, trigger, edge, etc.) of the status you are looking for.
instanceintThe run number you are looking for. This number should be 1 or more.

getTaskStatus(objectName, thread, instance) → Status

Returns the task status of the named object and instance. The instance is incremented each time an object runs within a thread. Therefore, the instance distingueshes the specific execution of the object if it has run more than once. It is also possible an object runs in a different thread. The thread argument describes which thread you are looking for.

Returns: Status - A Status object or null if no object was found.

Parameters:

ParameterTypeDescription
objectNameStringThe name of the object (task, trigger, edge, etc.) of the status you are looking for.
threadStringThe specific thread.
instanceintThe run number you are looking for. This number should be 1 or more.

getTriggerStatus()

Returns the status of the trigger used to start this workflow instance.

getWorkflowStatus()

Returns the status of the workflow.

getWorkflowStatus(run)

Returns the instance of a prior workflow run.

Parameters:

ParameterTypeDescription
runintThe run number. This value should be 1 or more.

getPriorRun() → Wi

Returns the instance of the prior workflow run.

Returns: Wi - The prior run or null if one does not exist.

getRuns()

Get the number of runs of this worklfow. This will be 1 plus the number of times the workflow was restarted. Calling this function in a prior run will only return the number of runs of that instance not including ones started after it.

getWorkflow()

returns the workflow associated with this instance.

reportToCI()

This workflow will begin reporting its status to the CI object indicated as id

confirm()

Confirm this workflow

isComplete(objectName) → boolean

Returns true if the task ran and completed successfully.

Returns: boolean - true if successful

Parameters:

ParameterTypeDescription
objectNameStringThe name of the object (task, trigger, edge, etc.) of the status you are looking for.

isComplete(objectName) → boolean

Returns true if the task ran and failed.

Returns: boolean - true if successful

Parameters:

ParameterTypeDescription
objectNameStringThe name of the object (task, trigger, edge, etc.) of the status you are looking for.

isComplete(objectName) → boolean

Returns true if the task ran and failed.

Returns: boolean - true if canceled

Parameters:

ParameterTypeDescription
objectNameStringThe name of the object (task, trigger, edge, etc.) of the status you are looking for.

isRunning(objectName) → boolean

Returns true if the task is currently running.

Returns: boolean - true if running

Parameters:

ParameterTypeDescription
objectNameStringThe name of the object (task, trigger, edge, etc.) of the status you are looking for.

Workload Automation and Orchestration