It is good practice to provide us with a small unittest that demonstrates the problem. We cannot guess what you try to do...
Thanks for your reply and also sorry for the confusion.
This is what i am trying to to.
Using Query API and process instance id i am getting ProcessInstance in my code.
After getting the ProcessInstance, using ExecutionImpl i am trying to get the Outgoing Transitions for a state in a workflow.
ProcessInstance processInstance = getExecutionService().createProcessInstanceQuery().processInstanceId(pProcessInstanceID).uniqueResult();
ExecutionImpl activeExecution = ((ExecutionImpl)processInstance).findActiveExecutionIn(StateName);
List<Transition> outgoingTransitionList = activeExecution.getActivity().getOutgoingTransitions();
With this code i am getting 'No Environment Exception'. Did i miss something over here?
Thanks for the response, but to be honest, it is no unittest. But I can partially get some info from it.
What you do is using *Impl classes. These should normally not be used since they are in the internal package and not in the api package. These classes are normally used in commands (that are in turn used in the services). They are 'bootstrapped' with the correct data among which is the 'Environment'
But interestingly, (as you can see in a post in the dev forum), the current trunk and upcomming 4.4 release has some support for this, at least regarding accessing transitions in other nodes then tasks.
Thanks for clarifying me. I hope now you can understand my unittest.
Below is my sample process definition xml.
<transition name="TN1" to="state1"/>
<transition name="S1T1" to="state2"/>
<transition name="S1T2" to="state3"/>
<transition name="S1T3" to="complete"/>
<transition name="S2T1" to="complete"/>
<transition name="S3T1" to="complete"/>
<end name="complete" state="completed">
In my application, now the exeuction is at state1 (<state name="state1">"). Here i need to get the list of possible transitions at state1.
What would be the correct way to achieve this. Which API i should use to get the outgoing transitions at a particular state.
Please help me. Thanks a lot!
I already mentioned in my previous reply that this is in trunk and will be in 4.4 and that this (including some code) is in the developer forum...So there currently is no (good) way to do this, other then change the jBPM source yourself in one way or another.
thanks for your clarification
I have to add here that there is no 'other' (good) way of doing this other then using the source from trunk
Can you please provide me the link to get the source from trunk as i have no idea about the trunk.