cancel
Showing results for 
Search instead for 
Did you mean: 

Using Activiti in a large Spring web app

vireswali
Champ in-the-making
Champ in-the-making
We have a large reporting webapp, which has a part subsystem that does request tracking and routing. Since Activiti is spring absed liek our app, so we closed on activiti as our workflow and routing engine. However we intend to use activiti as a service layer integration pattern instead of direct UI based one.

I know we can create spring based services and use activiti's spring integration beans and services to work together. What i have queris about is data sharing. e.g: in our business flow when a new user is created, it goes through a 3 step user base manual approval process before the newly created user reflects in our active user database. How should i integrate this in activiti's tasks. I can see that soem data sharing woudl happen using the form properties, e.g: our activiti task can have a form property like firstLevelApproval whose value we can populate manually in service from User data object. The user data obejct will reside in our DB and not in Activiti's DB. How do i keep the state in synch between the variables in the task and in our application object. Since if i employ business logic in activit's service tasks then the mutations they do on the obejct's properties needs to be persisted back into DB. how to I go about that? Should i keep mutation logic outside activiti?

Please provide some patterns or integration ideas.
4 REPLIES 4

smirzai
Champ on-the-rise
Champ on-the-rise
Actually you need to push only the variables which have some workflow effect to activiti. If you are rendering your forms, it is your freedom to populate the form from database, based by some ID got from Activiti, and modify them on submit and just let activiti know to forward to the next step.

vireswali
Champ in-the-making
Champ in-the-making
okie. so that essentially means to keep out all mutation logic from workflows. Only routing in there. And always give the workflow task variables the latest values that would result. By the way I was also thinking along the lines of evens. Would it be the right approach to allow mutations of DOs in workflow asks and delegates and then have post events on the task to synch the data in DB?

jbarrez
Star Contributor
Star Contributor
Only routing in there would be very strict. You can inject services into your delegates and do the changes there. I don't see a problem with that.

vireswali
Champ in-the-making
Champ in-the-making
Thanks Joram. that helps immensely.