Terminate the process instance. If you terminate
a process instance, you can terminate the process instance with or without
compensation.
To terminate the process instance with compensation:
PIID piid = processInstance.getID();
process.forceTerminate(piid, CompensationBehaviour.INVOKE_COMPENSATION);
To
terminate the process instance without compensation:
PIID piid = processInstance.getID();
process.forceTerminate(piid);
If you
terminate the process instance with compensation, the compensation handler
defined for the process template is called. If the process template does not
have a compensation handler defined, the default compensation handler is called. If you terminated the process instance without
compensation, the process instance is terminated immediately without waiting
for activities, participating tasks, or inline originating tasks to end normally.
Applications that are started by the process and standalone
tasks that are related to the process are not terminated by the force terminate
request. If these applications are to be terminated, you must add statements
to your process application that explicitly terminate the applications started
by the process.