cancel
Showing results for 
Search instead for 
Did you mean: 

Suspended process definition is executed

kayj
Champ in-the-making
Champ in-the-making
Hi,

we have a BPMN Model ErrorHandling which calls a CallActivity with the BPMN Model id "projectSpecificErrorHandling".
We further do have 2 BPMN models with the id "projectSpecificErrorHandling".
* One for a default error handling and
* one for a customer specific error handling.
Dependent on our project configuration we want to use one of these error handling models.

In the DB both BPMN models are deployed (also different versions might exist). As an example we want to use the default error handling. In order to assure that the project-specific error handling is called in the CallActivity, we suspend the process definitions of the project-specific error handling by ´processEngine.getRepositoryService().suspendProcessDefinitionById( currentProcDef.getId() );´

This is an extract of the table ´ACT_RE_PROCDEF´:

ID, Name, Key, SuspensionState
projectSpecificErrorHandling:2:24, Standard Error Handling, projectSpecificErrorHandling, 1    
projectSpecificErrorHandling:3:2512, Standard Error Handling, projectSpecificErrorHandling, 1
projectSpecificErrorHandling:4:2520, Demo Specific Error Handling, projectSpecificErrorHandling, 2


In the next step a process is started, which runs in an error and starts the error handling process, which triggers the CallActivity "projectSpecificErrorHandling" to be started. Since the latest version is suspended, I'd assume that the process definition with id "projectSpecificErrorHandling:3:2512" is executed when the CallActivity is called. But instead "projectSpecificErrorHandling:4:2520" is executed.

Is there something else I have to do to make it work? I also tried to set:

<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
<property name="processDefinitionCacheLimit" value="0" />

in activiti.cfg.xml after I came across this thread. https://forums.activiti.org/content/suspended-process-definition-starting-process-instances-urgent

Thanks!

KayJ
3 REPLIES 3

kayj
Champ in-the-making
Champ in-the-making
I just noticed that I made a mistake in the description. Instead of
"In order to assure that the project-specific error handling is called in the CallActivity…"
the correct sentence would be:
"In order to assure that the default error handling is called in the CallActivity…"

Any help regarding this issue would be great!

kayj
Champ in-the-making
Champ in-the-making
By writing a Unit Test I figured out that it depends on whether a suspended process definition is called directly, or from within another process.

To make it more clear: if the latest version of a process definition is set to "suspended", it is not possible to start it by key (startProcessInstanceByKey).
If the process is called via a CallActiviti, it is started even though it is set to "suspended".

Is this behaviour intended?

kayj
Champ in-the-making
Champ in-the-making
Guess it has been fixed in Activiti 5.18.0. https://activiti.atlassian.net/browse/ACT-2185

But I'd still expect the last deployed version, which is not suspended, to be executed since not the whole process definition has been suspended. Any statements regarding this?