long start = System.currentTimeMillis();
ProcessEngine engine = getProcessEngine(ctx);
org.jbpm.api.ProcessInstance pi = engine.getExecutionService().findProcessInstanceById(internalId);
final ExecutionImpl execution = (ExecutionImpl) pi.getProcessInstance();
final List<String> transitionNames = new ArrayList<String>();
engine.execute(new Command() {
public Object execute(Environment env) {
for (Transition transition : execution.getActivity().getOutgoingTransitions()) {
transitionNames.add(transition.getDestination().getName());
}
return null;