cancel
Showing results for 
Search instead for 
Did you mean: 

Issue in suspend or activate a process instance but the 'status' not refresh till 'restart' the J2EE Server

roundmonkey
Champ in-the-making
Champ in-the-making
Recently I am developing a system for our Gov and I found a issue during "Suspend/Activate" a process instance.

Following steps can recreate this issue:

1. Deployed the "activiti-rest" and the "activiti-explorer" into a same jboss, and make sure they connected to a same DB(I use the DB Jndi)

2. Suspend or activate a process instance in the "activiti-explore".

3. I found after I suspend or activate a process instance thru the activiti-explorer, I can still use the REST interface "http://localhost:8080/activiti-rest/service/runtime/process-instances" to start the process instance. Seems the "status" not refresh immediately…and I restart the JBOSS, then I tried to start the process instance like "myProcess" then I got the exception "myProcess:9:8451 is suspended, can not start".

My question is:

Why the activated or suspended status not refresh immediately? until I restart the JBOSS/TOMCAT, then the activated or suspended status will be effected? This is quite inconvenience, is there any way to activate or suspend the process instance immediately or I missed something else?
4 REPLIES 4

frederikherema1
Star Contributor
Star Contributor
I guess you're talking about suspending a process definition, rather than a process instance? The issue here has to do with process-definition caching. Parsed process definitions are cached in-memory for performance reasons. An entity updated in another JVM/activiti-engine will nog update the cache on other engines, leaving behind the "unsuspended" definition to use, when it should be suspended.

Hi Fred,

Yes, to suspend the definition in activiti-explorer, but the status was not changed in activiti-rest.

So, this issue caused by the process definition status is maintained in memory right?

jbarrez
Star Contributor
Star Contributor
Yes, correct. And also because you have two instances of the Activiti engine, with their own cache.

A solution would be to package both apps in one webapp, with one Activiti engine.
Another, way more advanced one, would be to use a distributed cache: http://www.jorambarrez.be/blog/2013/01/03/distributed-cache-activiti/

roundmonkey
Champ in-the-making
Champ in-the-making
Hi jbarrez,

According to your solution, merged two app into one, and the issue solved, thanks again.