cancel
Showing results for 
Search instead for 
Did you mean: 

Signalling parallel execution in service task

activator
Champ in-the-making
Champ in-the-making
Hi,

we are currently trying to model two parallel executions where one execution signals the other to terminate. We have tried to use signals to trigger the termination:

[IMG]http://i.imgur.com/WU3SV5o.png[/IMG]

As signals are broadcasted to all executions in all running process instances, we use a service task to only signal executions in the current process instance. However, in our test case, we receive the following exception:


  org.apache.ibatis.exceptions.PersistenceException:
  ### Error updating database.  Cause: org.h2.jdbc.JdbcSQLException: Referentielle Integrität verletzt: "ACT_FK_TASK_EXE: PUBLIC.ACT_RU_TASK FOREIGN KEY(EXECUTION_ID_) REFERENCES PUBLIC.ACT_RU_EXECUTION(ID_) ('9')"
  Referential integrity constraint violation: "ACT_FK_TASK_EXE: PUBLIC.ACT_RU_TASK FOREIGN KEY(EXECUTION_ID_) REFERENCES PUBLIC.ACT_RU_EXECUTION(ID_) ('9')"; SQL statement:
  delete from ACT_RU_EXECUTION where ID_ = ? and REV_ = ? [23503-168]
  ### The error may involve org.activiti.engine.impl.persistence.entity.ExecutionEntity.deleteExecution-Inline
  ### The error occurred while setting parameters
  ### SQL: delete from ACT_RU_EXECUTION where ID_ = ? and REV_ = ?

In our real live application, the service task terminates the parallel execution just fine, but the service task itself remains active.

We think that there is an issue with the service task trying to influence the control flow by sending signals.

Two questions:

  • Do you think, this is a bug?
  •  
  • How would you otherwise model this use case?
Please keep in mind that we cannot use intermediate signal throwing events as this would broadcast the signal to all process instances. Also, we could use a sub process and a terminate event. However, we would prefer to keep the three user tasks on the same level as this documents the business process more concisely. (We would like to use swimlanes and sub processes cannot span several lanes.)

Attached you will find the test case and stack trace.

Thank you very much for your help
Michael
5 REPLIES 5

jbarrez
Star Contributor
Star Contributor
> As signals are broadcasted to all executions in all running process instances,

A signal has also an optional 'activiti:scope' property, which you can set to 'process instance' to not be broadcasted that wide. Did you try that?

Signal catching on service tasks is dodgy im afraid, as you can't kill java logic executing that easy.

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

The property 'activiti:scope' sounds just like the feature we need!

However, I constructed a small test example very similar to my picture above with a signal throwing event instead of a service task. Executing the example still throws an exception:



Referential integrity constraint violation: "ACT_FK_TASK_EXE: PUBLIC.ACT_RU_TASK FOREIGN KEY(EXECUTION_ID_) REFERENCES PUBLIC.ACT_RU_EXECUTION(ID_) ('9')"; SQL statement:
delete from ACT_RU_EXECUTION where ID_ = ? and REV_ = ? [23503-168]


It seems that activiti tries to delete the execution of the upper parallel branch, however, the user task is not deleted first.

We use activiti v5.14. Are there known issues with the signal boundary event being used on a user task?

I can provide the unit test, if you like. How do I upload a file other than simple text file?

jbarrez
Star Contributor
Star Contributor
It's not a known issue for sure.

A unit test would be appreciated. You can always rename the file to have a .txt extension here 😉

activator
Champ in-the-making
Champ in-the-making
Attached the unit test built on top of the activiti-unit-test-template.

Thanks for your help!
Michael

jbarrez
Star Contributor
Star Contributor
Verified, indeed a bug.

Bugfix has been pushed: https://github.com/Activiti/Activiti/commit/0eeca1883e64b6218228d61b39bb45803ab75f54

It will be part of Activiti 5.15.1, which will be released later this week.