AnsweredAssumed Answered

how to evaluate with UelExpressionCondition

Question asked by zhengke on Sep 25, 2012
Latest reply on Sep 28, 2012 by kafeitu
i want to get the next node from Transition, but the Transition is exclusiveGateway,so i want to get the UelExpressionCondition from the Transition and get the evaluate result using UelExpressionCondition.evaluate

code:
List<ActivityImpl> activitiList = new ArrayList<ActivityImpl>();
TaskEntity taskEntity = (TaskEntity) taskService.createTaskQuery().taskId("202").singleResult();
      
String processDefinitionId = taskEntity.getProcessDefinitionId();
activitiList = (List<ActivityImpl>) ((RepositoryServiceImpl)repositoryService).getDeployedProcessDefinition(processDefinitionId).getActivities();
ExecutionEntity executionEntity = (ExecutionEntity) runtimeService.createExecutionQuery().executionId(taskEntity.getExecutionId()).singleResult();//执行实例
      
String activitiId = executionEntity.getActivityId();
for(ActivityImpl activityImpl : activitiList) {
  if(activitiId.equals(activityImpl.getId())) {
    List<PvmTransition> transitionImpls = activityImpl.getOutgoingTransitions();
    for(int i = 0; i < transitionImpls.size(); i++) {
   TransitionImpl transitionImpl = (TransitionImpl) transitionImpls.get(i);
   if(transitionImpl.getDestination().getProperty("type") != null && "exclusiveGateway".equals(transitionImpl.getDestination().getProperty("type"))) {
            //how can i get the DelegateExecution object
       System.out.println(((UelExpressionCondition)transitionImpl.getDestination().getOutgoingTransitions().get(0).getProperty("condition")).evaluate(execution));
   }
               
    }
  }
}

Outcomes