cancel
Showing results for 
Search instead for 
Did you mean: 

Anyone know how to get the next available transitions?

nicholas234
Champ in-the-making
Champ in-the-making
when the process arrive the usertask node before the fork node ,I want to get the next transition or task node which the process will flow to, and all the outgoing transitions from the  fork node have condition ,how can i do? :?:
5 REPLIES 5

frederikherema1
Star Contributor
Star Contributor
You should get hold of the ReadonlyProcessDefinition, find out what activity you want and get it (it's a PvmActivity, which allows you to inspect the transitions): http://forums.activiti.org/en/viewtopic.php?f=6&t=1930&hilit=ReadonlyProcessDefinition

nicholas234
Champ in-the-making
Champ in-the-making
You should get hold of the ReadonlyProcessDefinition, find out what activity you want and get it (it's a PvmActivity, which allows you to inspect the transitions): http://forums.activiti.org/en/viewtopic.php?f=6&t=1930&hilit=ReadonlyProcessDefinition
thanks for your reply.
But this is not the result I want.I have got all the activities of the processdefinition,but I don't know how to execute the expression which was defined in the condintion of the transition,this is the key

frederikherema1
Star Contributor
Star Contributor
Not really sure why you need it… Expressions can only be evaluated when you are in activiti-context (eg. service-task, tasklistener) where you have access to a VariableScope. This object can be used to evaluate an expression, using the ExpressionManager (can be obtained through the ProcessEngineConfiguration, beware, it's internal stuff).

nicholas234
Champ in-the-making
Champ in-the-making
Not really sure why you need it… Expressions can only be evaluated when you are in activiti-context (eg. service-task, tasklistener) where you have access to a VariableScope. This object can be used to evaluate an expression, using the ExpressionManager (can be obtained through the ProcessEngineConfiguration, beware, it's internal stuff).
yes ,I got the instance of the UelExpressionCondition,like this:
UelExpressionCondition condition = (UelExpressionCondition)nextTr.getProperty(BpmnParse.PROPERTYNAME_CONDITION);//the "nextTr" is a instance of PvmTransition
And now,I want get the execution result of the condition,but I can't find any method to do.Do you have some suggestions?

frederikherema1
Star Contributor
Star Contributor
As I said, evaluate the UELExpression using the ExpressionManager