Hello,
i am looking for a handy approach to handle the following situation:
Let’s assume i have a process with some tasks. From the beginning of the process it is possible to terminate it by receiving a cancel-message until some task is reached. When the task is reached, i want to be sure, that the process instance can not be canceled anymore. Currently i am modelling that in this way:
Note: I don’t want to attach a message cancel incoming event on each task. This will be dirty.
At the beginning of the process i am using the event based gateway in order to wait for cancel or signal event. If some state in the instance is reached it should not be possible anymore to terminate this instance.
- How would you handle such a situation? Is there a cleaner way?
- What appens to subproces-instances? Are they canceled, too? That would be nice
- Assuming i have defined some attatched compensation tasks and i want them to be executed before termination: I would just put a compnsation intermediate throw event between the incoming cancel message and the terminate task.
- Assuming situation 3) but i also have attached compensation events inside subprocesses. Are the compensations done also in the subprocesses or only in parent process? If not how can i archieve that?
- Is it possible to terminate an instance from the java api? (for me it is okay, that the process instance will be deleted from history) - i saw the runtimeService provides adeleteProcessinstance method.
I would be really glad for your help.
Thanks a lot!
Andy