WorkflowInstance
The WorkflowInstance
class manages the execution and state of a workflow, providing methods to initialize, start, continue, and manage workflow processes.
Properties
Name | Description |
---|---|
Reasons | Stores a dictionary of reasons associated with the workflow instance, often used for capturing feedback or notes at different workflow stages. |
AgentMode | Gets a value indicating whether the workflow instance is in agent mode. |
ParentProcessId | Gets or sets the parent process identifier for the workflow instance, if applicable. |
ProjectName | Gets the name of the project associated with the workflow instance. |
DocumentParameters | Gets the document parameters for the workflow instance. |
Version | Gets or sets the version of the workflow instance. Default value is "latest". |
FlowSecretKey | Gets the secret key for the workflow flow. |
ProcessRequestObjectName | Gets or sets the name of the process request object for the workflow instance. |
Variables | Gets the variables associated with the workflow instance. |
RequestId | Gets the request identifier for the workflow instance, if applicable. |
StartingEvent | Gets or sets the starting event for the workflow instance. |
DocumentOptions | Gets the list of document options for the workflow instance. |
Documents | Gets the documents associated with the workflow instance. |
DeploymentUrl | Gets the deployment URL for the workflow instance. |
Events | Gets the events associated with the workflow instance. |
ProcessId | Gets the process identifier for the workflow instance. |
FlowName | Gets the name of the flow associated with the workflow instance. |
Constructors
Name | Description |
---|---|
WorkflowInstance(projectName, flowName, processId, agentMode, api, documentOptions) | Initializes a new instance of the WorkflowInstance class with specified project details, workflow settings, API connection, and document options. |
WorkflowInstance(projectName, flowName, processId, agentMode, api) | Initializes a new instance of the WorkflowInstance class with specified project and flow names, process ID, agent mode, and API instance. |
WorkflowInstance(options) | Initializes a new instance of the WorkflowInstance class with specified initial options for configuration. |
Methods
Name | Description |
---|---|
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. |
Continue(telemetryCollectorHolder) | Continues the workflow instance by proceeding along the path defined by the StartingEvent value, following the configured workflow process. |
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. |
Start(telemetryCollectorHolder) | Initiates the workflow instance by starting the configured workflow process. This method executes the initial steps required to activate the workflow. |
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. |
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. |
GetFlowHistory(telemetryCollectorHolder) | Retrieves the flow history of the workflow instance, providing detailed historical information for the workflow process, including actions, statuses, and associated data. |
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. |
DeleteSubProcesses(telemetryCollectorHolder) | Deletes all sub-processes associated with the current workflow instance, removing any nested workflows that are linked to it. |