Class DelegateHelper

java.lang.Object
org.flowable.engine.delegate.DelegateHelper

public class DelegateHelper extends Object
Class that provides helper operations for use in the JavaDelegate, ActivityBehavior, ExecutionListener and TaskListener interfaces.
Author:
Joram Barrez
  • Constructor Details

    • DelegateHelper

      public DelegateHelper()
  • Method Details

    • leaveDelegate

      public static void leaveDelegate(DelegateExecution delegateExecution)
      To be used in an ActivityBehavior or JavaDelegate: leaves according to the default BPMN 2.0 rules: all sequenceflow with a condition that evaluates to true are followed.
    • leaveDelegate

      public static void leaveDelegate(DelegateExecution delegateExecution, String sequenceFlowId)
      To be used in an ActivityBehavior or JavaDelegate: leaves the current activity via one specific sequenceflow.
    • getBpmnModel

      public static org.flowable.bpmn.model.BpmnModel getBpmnModel(DelegateExecution execution)
      Returns the BpmnModel matching the process definition bpmn model for the process definition of the passed DelegateExecution.
    • getFlowElement

      public static org.flowable.bpmn.model.FlowElement getFlowElement(DelegateExecution execution)
      Returns the current FlowElement where the DelegateExecution is currently at.
    • isExecutingExecutionListener

      public static boolean isExecutingExecutionListener(DelegateExecution execution)
      Returns whether or not the provided execution is being use for executing an ExecutionListener.
    • getExtensionElements

      public static Map<String,List<org.flowable.bpmn.model.ExtensionElement>> getExtensionElements(DelegateExecution execution)
      Returns for the activityId of the passed DelegateExecution the Map of ExtensionElement instances. These represent the extension elements defined in the BPMN 2.0 XML as part of that particular activity. If the execution is currently being used for executing an ExecutionListener, the extension elements of the listener will be used. Use the getFlowElementExtensionElements(DelegateExecution) or getListenerExtensionElements(DelegateExecution) instead to specifically get the extension elements of either the flow element or the listener.
    • getFlowElementExtensionElements

      public static Map<String,List<org.flowable.bpmn.model.ExtensionElement>> getFlowElementExtensionElements(DelegateExecution execution)
    • getListenerExtensionElements

      public static Map<String,List<org.flowable.bpmn.model.ExtensionElement>> getListenerExtensionElements(DelegateExecution execution)
    • getFields

      public static List<org.flowable.bpmn.model.FieldExtension> getFields(DelegateExecution execution)
      Returns the list of field extensions, represented as instances of FieldExtension, for the current activity of the passed DelegateExecution. If the execution is currently being used for executing an ExecutionListener, the fields of the listener will be returned. Use getFlowElementFields(DelegateExecution) or getListenerFields(DelegateExecution) if needing the flow element of listener fields specifically.
    • getFlowElementFields

      public static List<org.flowable.bpmn.model.FieldExtension> getFlowElementFields(DelegateExecution execution)
    • getListenerFields

      public static List<org.flowable.bpmn.model.FieldExtension> getListenerFields(DelegateExecution execution)
    • getField

      public static org.flowable.bpmn.model.FieldExtension getField(DelegateExecution execution, String fieldName)
      Returns the FieldExtension matching the provided 'fieldName' which is defined for the current activity of the provided DelegateExecution. Returns null if no such FieldExtension can be found. If the execution is currently being used for executing an ExecutionListener, the field of the listener will be returned. Use getFlowElementField(DelegateExecution, String) or getListenerField(DelegateExecution, String) for specifically getting the field from either the flow element or the listener.
    • getFlowElementField

      public static org.flowable.bpmn.model.FieldExtension getFlowElementField(DelegateExecution execution, String fieldName)
    • getListenerField

      public static org.flowable.bpmn.model.FieldExtension getListenerField(DelegateExecution execution, String fieldName)
    • createExpressionForField

      public static org.flowable.common.engine.api.delegate.Expression createExpressionForField(org.flowable.bpmn.model.FieldExtension fieldExtension)
      Creates an Expression for the FieldExtension.
    • getFieldExpression

      public static org.flowable.common.engine.api.delegate.Expression getFieldExpression(DelegateExecution execution, String fieldName)
      Returns the Expression for the field defined for the current activity of the provided DelegateExecution. Returns null if no such field was found in the process definition xml. If the execution is currently being used for executing an ExecutionListener, it will return the field expression for the listener. Use getFlowElementFieldExpression(DelegateExecution, String) or getListenerFieldExpression(DelegateExecution, String) for specifically getting the flow element or listener field expression.
    • getFieldExpression

      public static org.flowable.common.engine.api.delegate.Expression getFieldExpression(org.flowable.task.service.delegate.DelegateTask task, String fieldName)
    • getFlowElementFieldExpression

      public static org.flowable.common.engine.api.delegate.Expression getFlowElementFieldExpression(DelegateExecution execution, String fieldName)
    • getListenerFieldExpression

      public static org.flowable.common.engine.api.delegate.Expression getListenerFieldExpression(DelegateExecution execution, String fieldName)