Terminating process doesn't stop and rollback action executed in Automatic Activity

Terminating process doesn't stop and rollback action executed in Automatic Activity

  

Hi,

We have a Process to run long simulations in chunks. And it works ok saving state each 5 minutes and re-executes itself if it’s not done and resume.

The flow is like this:

Process have automatic activity that executes a server action that runs in loop some other actions until the internal action timer (manually set to 3 minutes) time-out, saves its state, reexecutes the process and ends.

Then we've added a possibility to cancel simulation and resume it. 

Clicking cancel button executes ProcessTerminate action with process id that we've go from exposed process entity (is this a proper way?).

And while testing it  that ProcessTerminate is not aborting the underlying loop of simulation actions… Meaning then in Service Centre there are no active processes (only closed and terminated). 

What are we missing here ?

Thank you

Hi Mykola,


Terminate the process not roolback your Database content, Terminate is like an end. But Terminate stop all your activities.

So, you need to abort that transation in runtime.

Hi Fábio,

But what happens to the long running server action that was executed by automatic activity? Is it aborted or continues till it's the end node? And if it continues then there must be a check for "is Paused" flag to not start another process instance after timeout.

Mykola (Nick) Tkachenko wrote:

Hi Fábio,

But what happens to the long running server action that was executed by automatic activity? Is it aborted or continues till it's the end node? And if it continues then there must be a check for "is Paused" flag to not start another process instance after timeout.

Terminate "kill" all of the current activities, You have the Terminate process ill stop there no continus.


Hi Mykola,

The terminate will end all activities in that process instance. If you have another processes (sub processes) then you must kill them also, they do not be killed automatically by the parent process.

What do you mean by Timer? Is it a wait activity or a true Timer. In the first case, it will be closed when the parent process is terminated, for the second one as it runs in different session, it is better to open the servce to monitor the state of the timer.

As a Timer is also a process, i think you need to stop it also explicitly, like other sub processes.

Mykola (Nick) Tkachenko wrote:

Hi Fábio,

But what happens to the long running server action that was executed by automatic activity? Is it aborted or continues till it's the end node? And if it continues then there must be a check for "is Paused" flag to not start another process instance after timeout.

Hi Mykola,

Instead of forcibly terminating the process, you could have a Conditional Start that ends in a Process Terminate node. Then your button would just start the new Conditional Start. This way, the explicit aborting of the process would be part of the process definition itself.

According to documentation, a Process Terminate node would stop all its activity instances in the lifecycle state they were executing. That being said, I haven't tried it out recently, but would expect the ProcessTerminate action to have the same behaviour.