Пример #1
0
  public void execute(ActivityExecution execution) throws Exception {
    List<PvmActivity> startActivities = new ArrayList<PvmActivity>();
    for (PvmActivity activity : execution.getActivity().getActivities()) {
      if (activity.getIncomingTransitions().isEmpty()) {
        startActivities.add(activity);
      }
    }

    for (PvmActivity startActivity : startActivities) {
      execution.executeActivity(startActivity);
    }
  }
Пример #2
0
 @SuppressWarnings("unchecked")
 public void timerFires(ActivityExecution execution, String signalName, Object signalData)
     throws Exception {
   PvmActivity timerActivity = execution.getActivity();
   boolean isInterrupting = (Boolean) timerActivity.getProperty("isInterrupting");
   List<ActivityExecution> recyclableExecutions = null;
   if (isInterrupting) {
     recyclableExecutions = removeAllExecutions(execution);
   } else {
     recyclableExecutions = Collections.EMPTY_LIST;
   }
   execution.takeAll(timerActivity.getOutgoingTransitions(), recyclableExecutions);
 }
Пример #3
0
  @SuppressWarnings("unchecked")
  public void lastExecutionEnded(ActivityExecution execution) {

    ActivityExecution outgoingExecution = execution.getParent().createExecution();
    outgoingExecution.setConcurrent(false);
    ((InterpretableExecution) outgoingExecution)
        .setActivity((ActivityImpl) execution.getActivity());

    execution.setConcurrent(false);
    execution.setActive(false);
    ((InterpretableExecution) execution).setEventScope(true);

    List<PvmTransition> outgoingTransitions = execution.getActivity().getOutgoingTransitions();
    if (outgoingTransitions.isEmpty()) {
      outgoingExecution.end();
    } else {
      outgoingExecution.takeAll(outgoingTransitions, Collections.EMPTY_LIST);
    }
  }