Package org.flowable.engine.delegate
Class DelegateHelper
java.lang.Object
org.flowable.engine.delegate.DelegateHelper
Class that provides helper operations for use in the
JavaDelegate, ActivityBehavior, ExecutionListener and TaskListener interfaces.- Author:
- Joram Barrez
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ExpressioncreateExpressionForField(FieldExtension fieldExtension) Creates anExpressionfor theFieldExtension.static BpmnModelgetBpmnModel(DelegateExecution execution) Returns theBpmnModelmatching the process definition bpmn model for the process definition of the passedDelegateExecution.static Map<String,List<ExtensionElement>> getExtensionElements(DelegateExecution execution) static FieldExtensiongetField(DelegateExecution execution, String fieldName) Returns theFieldExtensionmatching the provided 'fieldName' which is defined for the current activity of the providedDelegateExecution.static ExpressiongetFieldExpression(DelegateExecution execution, String fieldName) Returns theExpressionfor the field defined for the current activity of the providedDelegateExecution.static ExpressiongetFieldExpression(DelegateTask task, String fieldName) Similar togetFieldExpression(DelegateExecution, String), but for use within aTaskListener.static List<FieldExtension>getFields(DelegateExecution execution) Returns the list of field extensions, represented as instances ofFieldExtension, for the current activity of the passedDelegateExecution.static FlowElementgetFlowElement(DelegateExecution execution) Returns the currentFlowElementwhere theDelegateExecutionis currently at.static Map<String,List<ExtensionElement>> getFlowElementExtensionElements(DelegateExecution execution) static FieldExtensiongetFlowElementField(DelegateExecution execution, String fieldName) static ExpressiongetFlowElementFieldExpression(DelegateExecution execution, String fieldName) static List<FieldExtension>getFlowElementFields(DelegateExecution execution) static Map<String,List<ExtensionElement>> getListenerExtensionElements(DelegateExecution execution) static FieldExtensiongetListenerField(DelegateExecution execution, String fieldName) static ExpressiongetListenerFieldExpression(DelegateExecution execution, String fieldName) static List<FieldExtension>getListenerFields(DelegateExecution execution) static booleanisExecutingExecutionListener(DelegateExecution execution) Returns whether or not the provided execution is being use for executing anExecutionListener.static voidleaveDelegate(DelegateExecution delegateExecution) To be used in anActivityBehaviororJavaDelegate: leaves according to the default BPMN 2.0 rules: all sequenceflow with a condition that evaluates to true are followed.static voidleaveDelegate(DelegateExecution delegateExecution, String sequenceFlowId) To be used in anActivityBehaviororJavaDelegate: leaves the current activity via one specific sequenceflow.
-
Constructor Details
-
DelegateHelper
public DelegateHelper()
-
-
Method Details
-
leaveDelegate
To be used in anActivityBehaviororJavaDelegate: leaves according to the default BPMN 2.0 rules: all sequenceflow with a condition that evaluates to true are followed. -
leaveDelegate
To be used in anActivityBehaviororJavaDelegate: leaves the current activity via one specific sequenceflow. -
getBpmnModel
Returns theBpmnModelmatching the process definition bpmn model for the process definition of the passedDelegateExecution. -
getFlowElement
Returns the currentFlowElementwhere theDelegateExecutionis currently at. -
isExecutingExecutionListener
Returns whether or not the provided execution is being use for executing anExecutionListener. -
getExtensionElements
Returns for the activityId of the passedDelegateExecutiontheMapofExtensionElementinstances. 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 anExecutionListener, the extension elements of the listener will be used. Use thegetFlowElementExtensionElements(DelegateExecution)orgetListenerExtensionElements(DelegateExecution)instead to specifically get the extension elements of either the flow element or the listener. -
getFlowElementExtensionElements
public static Map<String,List<ExtensionElement>> getFlowElementExtensionElements(DelegateExecution execution) -
getListenerExtensionElements
public static Map<String,List<ExtensionElement>> getListenerExtensionElements(DelegateExecution execution) -
getFields
Returns the list of field extensions, represented as instances ofFieldExtension, for the current activity of the passedDelegateExecution. If the execution is currently being used for executing anExecutionListener, the fields of the listener will be returned. UsegetFlowElementFields(DelegateExecution)orgetListenerFields(DelegateExecution)if needing the flow element of listener fields specifically. -
getFlowElementFields
-
getListenerFields
-
getField
Returns theFieldExtensionmatching the provided 'fieldName' which is defined for the current activity of the providedDelegateExecution. Returns null if no suchFieldExtensioncan be found. If the execution is currently being used for executing anExecutionListener, the field of the listener will be returned. UsegetFlowElementField(DelegateExecution, String)orgetListenerField(DelegateExecution, String)for specifically getting the field from either the flow element or the listener. -
getFlowElementField
-
getListenerField
-
createExpressionForField
Creates anExpressionfor theFieldExtension. -
getFieldExpression
Returns theExpressionfor the field defined for the current activity of the providedDelegateExecution. Returns null if no such field was found in the process definition xml. If the execution is currently being used for executing anExecutionListener, it will return the field expression for the listener. UsegetFlowElementFieldExpression(DelegateExecution, String)orgetListenerFieldExpression(DelegateExecution, String)for specifically getting the flow element or listener field expression. -
getFieldExpression
Similar togetFieldExpression(DelegateExecution, String), but for use within aTaskListener. -
getFlowElementFieldExpression
public static Expression getFlowElementFieldExpression(DelegateExecution execution, String fieldName) -
getListenerFieldExpression
-