Properties of workflowinstance
Attribute |
Function |
Instanceid |
Obtain the unique identifier (guid) of the workflow instance) |
Workflowruntime |
Obtain the workflowruntime of this workflow instance. |
Workflowinstance Method
Method |
Function |
Applyworkflowchanges |
Apply for changes to the workflow instance through the workflowchanges object. This allows you to modify a workflow during execution (adding, removing, or changing activities). When a dynamic change is implemented, the workflow instance is paused. |
Getworkflowdefinition |
Search for the root activity of this workflow instance. |
Resume |
Resume the execution of the previously paused workflow instance. If the workflow instance is not paused, do not do anything. If the workflow instance is paused, The workflowresumed event is triggered after the workflow instance is restored. |
Start |
Start the execution of a workflow instance and call executeactivity on the Root Activity of the workflow instance. If a start exception occurs, it calls terminate to terminate the workflow instance and append the exception information as the cause of termination. |
Suspend |
Pause the workflow instance synchronously. If the workflow instance is already in the paused status, do not do anything. If the workflow instance is running, the instance will be paused when the workflow is running, and suspendorterminateinfoproperty (reasons) will be set and suspend will be triggered. |
Terminate |
Terminate this workflow instance synchronously. When the host needs to terminate a workflow instance, the instance is terminated and the final state of the instance is persisted. Then workflowinstance sets suspendorterminateinfoproperty (indicating the reason) and enters terminate. Finally, it triggers the workflowterminated event and transmits the cause of termination to the Message attribute in workflowterminateexception and includes it in the parameter of the workflowterminatedeventargs event. In addition, if an exception occurs during persistence, the exception will be uploaded to the workflowterminatedeventargs event parameter during workflow runtime. |