Skip to main content

WorkflowInstance Methods

An object defining methods for the WorkflowInstance class.

Initialize(telemetryCollectorHolder)

Initializes the workflow instance by loading and setting up necessary parameters. This method performs actions like retrieving the version by process ID if in agent mode and loading initial and start parameters.

Parameters:

telemetryCollectorHolder (optional): ITelemetryCollectorHolder
Holds telemetry collection data for tracking and diagnostics during initialization. This parameter is optional and is used for advanced telemetry purposes.

Returns:

Type: Task<bool>
Returns a task that represents the asynchronous operation, containing a boolean value indicating success.

This is a async method. Method should be waited. Be careful if call this method without waiting.

See Also


Continue(telemetryCollectorHolder)

Continues the workflow instance by proceeding along the path defined by the StartingEvent value, following the configured workflow process.

Parameters:

telemetryCollectorHolder (optional): ITelemetryCollectorHolder
Holds telemetry collection data for tracking and diagnostics during the continuation process. Defaults to null if not provided, used for advanced telemetry purposes.

Returns:

Type: Task<FlowContinueResponse>
Returns a task that represents the asynchronous operation, containing the response from continuing the workflow.

This is a async method. Method should be waited. Be careful if call this method without waiting.

See Also


SaveAndContinue(telemetryCollectorHolder)

Saves the current state of the workflow instance and then continues along the path defined by the StartingEvent value, ensuring workflow progress is preserved and resumed.

Parameters:

telemetryCollectorHolder (optional): ITelemetryCollectorHolder
Holds telemetry collection data for tracking and diagnostics during the save and continuation process. Defaults to null if not provided, used for advanced telemetry purposes.

Returns:

Type: Task<FlowSaveAndContinueResponse>
Returns a task that represents the asynchronous operation, containing the response from saving and continuing the workflow.

This is a async method. Method should be waited. Be careful if call this method without waiting.

See Also


Start(telemetryCollectorHolder)

Initiates the workflow instance by starting the configured workflow process. This method executes the initial steps required to activate the workflow.

Parameters:

telemetryCollectorHolder (optional): ITelemetryCollectorHolder
Holds telemetry collection data for tracking and diagnostics during the start process. This parameter is optional and is used for advanced telemetry purposes.

Returns:

Type: Task<FlowStartResponse>
Returns a task that represents the asynchronous operation, containing the response from starting the workflow.

This is a async method. Method should be waited. Be careful if call this method without waiting.

See Also


SetStarterUserByUserName(userName, telemetryCollectorHolder)

Sets the starter user of the workflow instance by the specified username, retrieving user information from HR services to validate and assign the starter user.

Parameters:

userName (required): string
The username of the user to be set as the starter of the workflow instance. Cannot be null or empty.

telemetryCollectorHolder (optional): ITelemetryCollectorHolder
Holds telemetry collection data for tracking and diagnostics during the user setting process. Defaults to null if not provided, used for advanced telemetry purposes.

Returns:

Type: Task<bool>
Returns a task that represents the asynchronous operation, containing a boolean value indicating success.

This is a async method. Method should be waited. Be careful if call this method without waiting.

See Also


SetStarterUserByUserId(userId, telemetryCollectorHolder)

Sets the starter user of the workflow instance by the specified user ID, retrieving user information from HR services to validate and assign the starter user.

Parameters:

userId (required): long
The unique identifier of the user to be set as the starter of the workflow instance. Must be greater than 0.

telemetryCollectorHolder (optional): ITelemetryCollectorHolder
Holds telemetry collection data for tracking and diagnostics during the user setting process. Defaults to null if not provided, used for advanced telemetry purposes.

Returns:

Type: Task<bool>
Returns a task that represents the asynchronous operation, containing a boolean value indicating success.

This is a async method. Method should be waited. Be careful if call this method without waiting.

See Also


GetFlowHistory(telemetryCollectorHolder)

Retrieves the flow history of the workflow instance, providing detailed historical information for the workflow process, including actions, statuses, and associated data.

Parameters:

telemetryCollectorHolder (optional): ITelemetryCollectorHolder
Holds telemetry collection data for tracking and diagnostics while retrieving the flow history. Defaults to null if not provided, used for advanced telemetry purposes.

Returns:

Type: Task<ProcessHistoryWithML>
Returns a task that represents the asynchronous operation, containing the flow history of the workflow instance.

This is a async method. Method should be waited. Be careful if call this method without waiting.

See Also


UpdateFlowStatus(requestId, statusId, telemetryCollectorHolder)

Updates the status of the workflow instance based on the specified request ID and status ID, modifying the current state within the workflow.

Parameters:

requestId (required): long
The unique identifier for the request whose status needs to be updated within the workflow.

statusId (required): int
The identifier representing the new status to be set for the specified request.

telemetryCollectorHolder (optional): ITelemetryCollectorHolder
Holds telemetry collection data for tracking and diagnostics during the status update process. Defaults to null if not provided, used for advanced telemetry purposes.

Returns:

Type: Task<bool>
Returns a task that represents the asynchronous operation, containing a boolean value indicating success.

This is a async method. Method should be waited. Be careful if call this method without waiting.

See Also


DeleteSubProcesses(telemetryCollectorHolder)

Deletes all sub-processes associated with the current workflow instance, removing any nested workflows that are linked to it.

Parameters:

telemetryCollectorHolder (optional): ITelemetryCollectorHolder
Holds telemetry collection data for tracking and diagnostics during the sub-process deletion process. Defaults to null if not provided, used for advanced telemetry purposes.

Returns:

Type: Task<bool>
Returns a task that represents the asynchronous operation, containing a boolean value indicating success.

This is a async method. Method should be waited. Be careful if call this method without waiting.

See Also