cancel
Showing results for 
Search instead for 
Did you mean: 

Undo Activiti

activiti-admin
Champ in-the-making
Champ in-the-making
Hi,

Wanted to know if Undo of any activitity (so that user can go back to previous task) is builtin to activiti? I'm using jbpm 4.x currently and had to write undo api for myself by finding out what entries are made into all tables when a task is completed. Undo is commonly used, i think it's a good
feature which would make more popular..

Thanks,
-Rams
8 REPLIES 8

jbarrez
Star Contributor
Star Contributor
A generic 'undo' activity is not planned (also not part of BPMN 2.0), since it requires business specific code most of the times.

BPMN 2.0 does have compensating transactions, which could be used for exactly that purpose, but then you still would need to write the compensation logic yourself.

tombaeyens
Champ in-the-making
Champ in-the-making
Rams, please explain what you exactly expect to get from the Undo activiti.  Do you want to roll back the process state to how it was at a certain moment in time?  How should we deal with concurrency in case of Undo.  What about all kinds of side effects.  Rolling back the state of the process to where it was at a certain moment is doable.  But what about invoked web services or java code that was invoked?  What are your expectations there for Undo.  It's because these kind of combinations can get quite tricky that we didn't prioritize it in jBPM 4.  If we get a clear understanding of what the exact scope and use case is of this, then we can surely consider to put it on our roadmap.

unknown-user
Champ on-the-rise
Champ on-the-rise
I've thoughts similar to Rams.

Consider a production process, which has several tasks/steps.
Successors of previous steps may find that the quality of the product does not meet the requirements for the current production stage, which makes it necessary to go back one or more steps.
Using a BPMN 2.0 process that supports the production process you will have to model either gateways after each task or exception events that allow to "jump" back, don't you?
This is quite clumsy from my point of view. I think having possibilities to reset the process to a certain stage would be more elegant. It would be even more interesting to have possibilities to leave the predefined path and to define further steps for handling the exception on the fly (ACM? :-)).

Since I'm working on a comprehensive system for production logistics that is based on Activiti, I'd be interested in ideas/hints about how to approach this with the current Activiti Version.

Thanks,
Markus

partizano
Champ in-the-making
Champ in-the-making
Hi,

I also want that there was "undo mechanism" in activiti, but also I understand that it is not trivial…
My vision is that people can make a mistake while working with application, and they can complete task by accident.

I am right, that activiti has no mechanism to undo "complete" action in user task that was made by accident?

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
yes you are right. activiti does no support that

abentan
Champ in-the-making
Champ in-the-making
Hi,
I agree with partizano, that's what a think: a simple user mistake, like two wrong mouse clicks, can lead to a user task becomes completed. In that case, without "undo", the whole process becomes wrong. I think it is a too common case, to be avoided. I can think in two strategies to face this problem:

1) A general 'go back', after each user task (task1), there will be a gateway with a path to the previous user task (parent of task1). Managing variables you can go back any task you want. I think this approach is very complicated, it requires to write this logic for each task, the diagram would be too confusing. The real model would be 'hidden' by all this. Also there would be more than one task of the same type completed, which I think it is not good for several reasons.

2) A complete delete, the actual process would be modeled as a subprocess, with a boundary signal. That signal would be the 'delete' signal triggered in case of user input error. This approach forces the user to create a new process, with the corrections. All the information about time completeness tasks, etc. would be lost. It is more manageable than the previous one, it is easier to implement. There should be user warnings for non-undoable changes.

Some variations of the ones above:

3) That after a delete like in 2, all the information significant to the process, the collection of all the forms, in a VO for example, there be used to build another process instance, automatically by the system, with the corrections included.

4) Also compensation does not really undo a completed user task, but I think it could be used to redo one task, also the current execution should be canceled. I am not still very acquainted about it, but when I studied it some weeks before, I could not find a good solution.

None of these approaches are good enough. Does anyone have other ideas? What should be the best approach to this problem?

I think that at least, it would be a good idea to provide a basic undo, to undo the last change, of the last user task. Maybe something similar to 1), but transparent to a bmpn designer.

Regards.

jbarrez
Star Contributor
Star Contributor
1) is indeed a lot of work to get right. Maybe you could inject such behavior automatically with a BpmnParseHandler, but it will still be complicated to implement and get working for each case.

2) and 3) are conceptually ok … but the history would be seriously messed up

4) That would indeed be a valid approach. But as you say it is not a generic solution and requires designing.

If you are only concerned about user tasks, another path you could go is to move the execution pointer yourself from the next step back to the user task. You can find which variables were set (runtime / history) and remove/roll those back. Of course, that is only valid for user tasks.

samueel
Champ on-the-rise
Champ on-the-rise

Hi JOram Barrez

I'm facing this problem too, our customer request a undo proposal for us and I didn't find any solution about this here.

There are many situations that this feature would be usefull. Is there any evoluttion about this theme?