AnsweredAssumed Answered

Multi level approve task probem

Question asked by gnevzmaja on Nov 15, 2011
Latest reply on Nov 28, 2011 by trademak
[img]https://lh4.googleusercontent.com/-m2LQMp2zZrk/TsJPnYhXUpI/AAAAAAAAEUw/jziJlzE4Fr0/s846/Capture.PNG[/img]

The idea is as follows:
1. user makes a request
2. at the same time both Level 1  and boss should be able to see the approval task
3. when Level 1approves boss should get the mail that he is on the move

I cut out all other branching for the simplicity of it, since the problems are flollowing:

Problem1.
Inside L1 approval there is form with property L1comment because of which Exception is thrown, which was expected at first since once L1 approval was skipped, no L1comment has been defined. Then I tried to create "take" listener to make definition  of variable L1comment
but with no success, Im getting same exception
com.vaadin.event.ListenerMethod$MethodException
Cause: com.vaadin.event.ListenerMethod$MethodException
Cause: org.activiti.engine.ActivitiException: Unknown property used in expression
So at the end workaround was to create start form with L1comment variable but that is rather dirty and unwanted, so my question is: What is the right expression  to define initial variable inside listener?


After dirty workaround mentioned second problem poped out:
Problem2.
Now when process starts and L1 approval is completed there are two tasks for Boss approval.
Is there a way that instance of boss approval created by request task gets destroyed when L1 approval task gets completed and new (more recent) instance of boss approval task appears?
Also, in case boss approves first L1 approval task should be destroyed. Is this possible?

Outcomes