docs: public static void leaveDelegate(DelegateExecution delegateExecution,
                                       String sequenceFlowId) {
          String processDefinitionId = delegateExecution.getProcessDefinitionId();
          Process process = ProcessDefinitionUtil.getProcess(processDefinitionId);
          FlowElement flowElement = process.getFlowElement(sequenceFlowId);
          if (flowElement instanceof SequenceFlow) {
              delegateExecution.setCurrentFlowElement(flowElement);
              Context.getAgenda().planTakeOutgoingSequenceFlowsOperation((ExecutionEntity) delegateExecution,
                                                                         false);
          } else {
              throw new ActivitiException(sequenceFlowId + " does not match a sequence flow");
          }
      }