TerminateProcess system function

The TerminateProcess system function ends the processing of all work items in a running workflow.

NOTE  Most well-designed workflows end normally after a final step in the workflow—there is generally no need to use the TerminateProcess system function. The TerminateProcess system function is intended for those workflows that have parallel processing where it is desirable to end all work items when processing reaches a particular step. For example, in a workflow with a Web Services Receive step in one branch and other processing in another branch, at the end of processing in the branch, it could be useful to use the TerminateProcess system function to end the workflow, removing the work item and the waiting Receive web service from the Web Services queue.

To use the TerminateProcess system function