docs: @Override
    public void doLeave(ActivityExecution execution) {
  
      LOG.leavingActivity(execution.getActivity().getId());
  
      PvmTransition outgoingSeqFlow = null;
      String defaultSequenceFlow = (String) execution.getActivity().getProperty("default");
      Iterator<PvmTransition> transitionIterator = execution.getActivity().getOutgoingTransitions().iterator();
      while (outgoingSeqFlow == null && transitionIterator.hasNext()) {
        PvmTransition seqFlow = transitionIterator.next();
  
        Condition condition = (Condition) seqFlow.getProperty(BpmnParse.PROPERTYNAME_CONDITION);
        if ( (condition == null && (defaultSequenceFlow == null || !defaultSequenceFlow.equals(seqFlow.getId())) )
                || (condition != null && condition.evaluate(execution)) ) {
  
          LOG.outgoingSequenceFlowSelected(seqFlow.getId());
          outgoingSeqFlow = seqFlow;
        }
      }
  
      if (outgoingSeqFlow != null) {
        execution.leaveActivityViaTransition(outgoingSeqFlow);
      } else {
  
        if (defaultSequenceFlow != null) {
          PvmTransition defaultTransition = execution.getActivity().findOutgoingTransition(defaultSequenceFlow);
          if (defaultTransition != null) {
            execution.leaveActivityViaTransition(defaultTransition);
          } else {
            throw LOG.missingDefaultFlowException(execution.getActivity().getId(), defaultSequenceFlow);
          }
        } else {
          //No sequence flow could be found, not even a default one
          throw LOG.stuckExecutionException(execution.getActivity().getId());
        }
      }
    }