AnsweredAssumed Answered

How to do spring transactions in a BPMN way

Question asked by tanzy831 on Jun 27, 2016
Latest reply on Jul 3, 2016 by tanzy831
Hi Everyone,

I am building a application with have modular logics inside, e.g. logic A, B, C, D. A typical user will summit his/her desired way of how to use these logics, telling the application whether he/she wants A->B->C->D or D->B->A->C by drawing and organizing these serviceTasks in the activiti explorer.

Now here comes the problem:

I want to add in a feature to allow users to "define" the boudary of transactions. We do not want the whole process of  A->B->C->D to roll back and start over if it fails halfway. What we want is to be able to tell the Activiti Engine that there is a boundary between B and C so that if C or D fails, task B will not be repeated, and the process will just starts over from C instead of A.

Now, I have read the user guide of Activiti and found that I can put a @Transactional tag when using Spring integration. All the thing you do inside that tag can be rolled back if it fails. Now, I am not sure how to implement the feature I mentioned above, so I wonder if anybody can help. I also worries that @Transactional is more of a hard-coded way to do this, and it will not be easy to let the user determine boundaries flexibly. I wonder whether there is some better way to do this, like, for example, to put a <transaction></transaction> tag inside the .bpmn file to set the boundary?

Please help ASAP, thanks!