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 Expression
createExpressionForField
(FieldExtension fieldExtension) Creates anExpression
for theFieldExtension
.static BpmnModel
getBpmnModel
(DelegateExecution execution) Returns theBpmnModel
matching the process definition bpmn model for the process definition of the passedDelegateExecution
.static Map<String,
List<ExtensionElement>> getExtensionElements
(DelegateExecution execution) static FieldExtension
getField
(DelegateExecution execution, String fieldName) Returns theFieldExtension
matching the provided 'fieldName' which is defined for the current activity of the providedDelegateExecution
.static Expression
getFieldExpression
(DelegateExecution execution, String fieldName) Returns theExpression
for the field defined for the current activity of the providedDelegateExecution
.static Expression
getFieldExpression
(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 FlowElement
getFlowElement
(DelegateExecution execution) Returns the currentFlowElement
where theDelegateExecution
is currently at.static Map<String,
List<ExtensionElement>> getFlowElementExtensionElements
(DelegateExecution execution) static FieldExtension
getFlowElementField
(DelegateExecution execution, String fieldName) static Expression
getFlowElementFieldExpression
(DelegateExecution execution, String fieldName) static List<FieldExtension>
getFlowElementFields
(DelegateExecution execution) static Map<String,
List<ExtensionElement>> getListenerExtensionElements
(DelegateExecution execution) static FieldExtension
getListenerField
(DelegateExecution execution, String fieldName) static Expression
getListenerFieldExpression
(DelegateExecution execution, String fieldName) static List<FieldExtension>
getListenerFields
(DelegateExecution execution) static boolean
isExecutingExecutionListener
(DelegateExecution execution) Returns whether or not the provided execution is being use for executing anExecutionListener
.static void
leaveDelegate
(DelegateExecution delegateExecution) To be used in anActivityBehavior
orJavaDelegate
: leaves according to the default BPMN 2.0 rules: all sequenceflow with a condition that evaluates to true are followed.static void
leaveDelegate
(DelegateExecution delegateExecution, String sequenceFlowId) To be used in anActivityBehavior
orJavaDelegate
: leaves the current activity via one specific sequenceflow.
-
Constructor Details
-
DelegateHelper
public DelegateHelper()
-
-
Method Details
-
leaveDelegate
To be used in anActivityBehavior
orJavaDelegate
: 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 anActivityBehavior
orJavaDelegate
: leaves the current activity via one specific sequenceflow. -
getBpmnModel
Returns theBpmnModel
matching the process definition bpmn model for the process definition of the passedDelegateExecution
. -
getFlowElement
Returns the currentFlowElement
where theDelegateExecution
is currently at. -
isExecutingExecutionListener
Returns whether or not the provided execution is being use for executing anExecutionListener
. -
getExtensionElements
Returns for the activityId of the passedDelegateExecution
theMap
ofExtensionElement
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 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 theFieldExtension
matching the provided 'fieldName' which is defined for the current activity of the providedDelegateExecution
. Returns null if no suchFieldExtension
can 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 anExpression
for theFieldExtension
. -
getFieldExpression
Returns theExpression
for 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
-