Sometimes it is needed to abort a process. Bizagi offers a function that can abort cases and those related to them.
To abort a process you can use the following function:
CHelper.abortProcess(Me, CaseId, AbortOption, AbortReason)
The following attributes are needed:
•Me: this parameter is fixed.
•CaseId: the ID for the case to be aborted.
•AbortOption: The type of operation you wish to execute. The options are as follows:
o1: Abort the process and its children.
o2: Abort the process, its children, parent and siblings.
o3: Abort the process's parent process, its siblings and children excluding the process received as parameter.
•AbortReason: A string where the abort reason is given.
Let's suppose we need to abort case number 12, its parent, siblings and children. The expression would be as follows:
CHelper.abortProcess(Me, 12, 2, "System Failure");
To abort only the case and its children, the expression would be:
CHelper.abortProcess(Me, 12, 1, "System Failure");
Finally, to abort the case's parent, siblings and children ignoring the case, the expression would be:
CHelper.abortProcess(Me, 12, 3, "System Failure");