AnsweredAssumed Answered

Using BPM for Form Validation?

Question asked by mxc4 on Oct 29, 2012
Latest reply on Oct 29, 2012 by frederikheremans1
Hi all,

I am new to using a  workflow engine and just trying to get a handle on the use cases that best suit using one and when to use plain old server side validation in the service layer. I see a tendency for business people to want to abstract out the form validation into task . i.e does this customer exist in the database, do they exist on external systems etc.

One the one hand this is great as it introduces flexibility into the validation process but it makes the coding for providing synchronous user feedback a bit more involved. If the process is inherently asynchronous, like requiring user approval etc, then workflow is great but if the user is filling out a form and can get feedback immediately it not so great.

My current knowledge of activiti is that the process is asynchronous. Once the process has been started you return to your code and then need to "poll" the process for progress. (If there is something I am missing please let me know :) ) It seems difficult to get the status of the process in an easy way. i.e have we reached an end or wait state? What is that state? Then using that info to decide what to show the user next. This is from the service layer and not inside the activiti process itself. Currently I need to use processInstance,00 Historyservice, task query etc to get this status. If the process take several seconds then I need to put the thread to sleep and check again till a wait/end state is reached.

Can someone please explain how to do this the right way? I am pretty sure its my limted experience with workflow concepts that is inhibiting my approach to using activiti.

thanks

Outcomes