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
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.flowable.common.engine.api.delegate.Expression
createExpressionForField
(org.flowable.bpmn.model.FieldExtension fieldExtension) Creates anExpression
for theFieldExtension
.static org.flowable.bpmn.model.BpmnModel
getBpmnModel
(DelegateExecution execution) Returns theBpmnModel
matching the process definition bpmn model for the process definition of the passedDelegateExecution
.getExtensionElements
(DelegateExecution execution) static org.flowable.bpmn.model.FieldExtension
getField
(DelegateExecution execution, String fieldName) Returns theFieldExtension
matching the provided 'fieldName' which is defined for the current activity of the providedDelegateExecution
.static org.flowable.common.engine.api.delegate.Expression
getFieldExpression
(DelegateExecution execution, String fieldName) Returns theExpression
for the field defined for the current activity of the providedDelegateExecution
.static org.flowable.common.engine.api.delegate.Expression
getFieldExpression
(org.flowable.task.service.delegate.DelegateTask task, String fieldName) Similar togetFieldExpression(DelegateExecution, String)
, but for use within aTaskListener
.static List<org.flowable.bpmn.model.FieldExtension>
getFields
(DelegateExecution execution) Returns the list of field extensions, represented as instances ofFieldExtension
, for the current activity of the passedDelegateExecution
.static org.flowable.bpmn.model.FlowElement
getFlowElement
(DelegateExecution execution) Returns the currentFlowElement
where theDelegateExecution
is currently at.getFlowElementExtensionElements
(DelegateExecution execution) static org.flowable.bpmn.model.FieldExtension
getFlowElementField
(DelegateExecution execution, String fieldName) static org.flowable.common.engine.api.delegate.Expression
getFlowElementFieldExpression
(DelegateExecution execution, String fieldName) static List<org.flowable.bpmn.model.FieldExtension>
getFlowElementFields
(DelegateExecution execution) getListenerExtensionElements
(DelegateExecution execution) static org.flowable.bpmn.model.FieldExtension
getListenerField
(DelegateExecution execution, String fieldName) static org.flowable.common.engine.api.delegate.Expression
getListenerFieldExpression
(DelegateExecution execution, String fieldName) static List<org.flowable.bpmn.model.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
public static Map<String,List<org.flowable.bpmn.model.ExtensionElement>> getExtensionElements(DelegateExecution execution) 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<org.flowable.bpmn.model.ExtensionElement>> getFlowElementExtensionElements(DelegateExecution execution) -
getListenerExtensionElements
public static Map<String,List<org.flowable.bpmn.model.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
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 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
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 anExpression
for theFieldExtension
. -
getFieldExpression
public static org.flowable.common.engine.api.delegate.Expression getFieldExpression(DelegateExecution execution, String fieldName) 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
public static org.flowable.common.engine.api.delegate.Expression getFieldExpression(org.flowable.task.service.delegate.DelegateTask task, String fieldName) Similar togetFieldExpression(DelegateExecution, String)
, but for use within aTaskListener
. -
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)
-