public class DelegateHelper extends Object
JavaDelegate
,
ActivityBehavior
, ExecutionListener
and TaskListener
interfaces.Constructor and Description |
---|
DelegateHelper() |
Modifier and Type | Method and Description |
---|---|
static Expression |
createExpressionForField(org.activiti.bpmn.model.FieldExtension fieldExtension)
Creates an
Expression for the FieldExtension . |
static org.activiti.bpmn.model.BpmnModel |
getBpmnModel(DelegateExecution execution)
Returns the
BpmnModel matching the process definition bpmn model
for the process definition of the passed DelegateExecution . |
static Map<String,List<org.activiti.bpmn.model.ExtensionElement>> |
getExtensionElements(DelegateExecution execution)
|
static org.activiti.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 . |
static Expression |
getFieldExpression(DelegateExecution execution,
String fieldName)
Returns the
Expression for the field defined for the current
activity of the provided DelegateExecution . |
static Expression |
getFieldExpression(DelegateTask task,
String fieldName)
Similar to
getFieldExpression(DelegateExecution, String) , but for use within a TaskListener . |
static List<org.activiti.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 . |
static org.activiti.bpmn.model.FlowElement |
getFlowElement(DelegateExecution execution)
Returns the current
FlowElement where the DelegateExecution is currently at. |
static Map<String,List<org.activiti.bpmn.model.ExtensionElement>> |
getFlowElementExtensionElements(DelegateExecution execution) |
static org.activiti.bpmn.model.FieldExtension |
getFlowElementField(DelegateExecution execution,
String fieldName) |
static Expression |
getFlowElementFieldExpression(DelegateExecution execution,
String fieldName) |
static List<org.activiti.bpmn.model.FieldExtension> |
getFlowElementFields(DelegateExecution execution) |
static Map<String,List<org.activiti.bpmn.model.ExtensionElement>> |
getListenerExtensionElements(DelegateExecution execution) |
static org.activiti.bpmn.model.FieldExtension |
getListenerField(DelegateExecution execution,
String fieldName) |
static Expression |
getListenerFieldExpression(DelegateExecution execution,
String fieldName) |
static List<org.activiti.bpmn.model.FieldExtension> |
getListenerFields(DelegateExecution execution) |
static boolean |
isExecutingExecutionListener(DelegateExecution execution)
Returns whether or not the provided execution is being use for executing an
ExecutionListener . |
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. |
static void |
leaveDelegate(DelegateExecution delegateExecution,
String sequenceFlowId)
To be used in an
ActivityBehavior or JavaDelegate : leaves
the current activity via one specific sequenceflow. |
public static void leaveDelegate(DelegateExecution delegateExecution)
ActivityBehavior
or JavaDelegate
: leaves
according to the default BPMN 2.0 rules: all sequenceflow with a condition
that evaluates to true are followed.public static void leaveDelegate(DelegateExecution delegateExecution, String sequenceFlowId)
ActivityBehavior
or JavaDelegate
: leaves
the current activity via one specific sequenceflow.public static org.activiti.bpmn.model.BpmnModel getBpmnModel(DelegateExecution execution)
BpmnModel
matching the process definition bpmn model
for the process definition of the passed DelegateExecution
.public static org.activiti.bpmn.model.FlowElement getFlowElement(DelegateExecution execution)
FlowElement
where the DelegateExecution
is currently at.public static boolean isExecutingExecutionListener(DelegateExecution execution)
ExecutionListener
.public static Map<String,List<org.activiti.bpmn.model.ExtensionElement>> getExtensionElements(DelegateExecution execution)
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.public static Map<String,List<org.activiti.bpmn.model.ExtensionElement>> getFlowElementExtensionElements(DelegateExecution execution)
public static Map<String,List<org.activiti.bpmn.model.ExtensionElement>> getListenerExtensionElements(DelegateExecution execution)
public static List<org.activiti.bpmn.model.FieldExtension> getFields(DelegateExecution execution)
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.public static List<org.activiti.bpmn.model.FieldExtension> getFlowElementFields(DelegateExecution execution)
public static List<org.activiti.bpmn.model.FieldExtension> getListenerFields(DelegateExecution execution)
public static org.activiti.bpmn.model.FieldExtension getField(DelegateExecution execution, String fieldName)
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.public static org.activiti.bpmn.model.FieldExtension getFlowElementField(DelegateExecution execution, String fieldName)
public static org.activiti.bpmn.model.FieldExtension getListenerField(DelegateExecution execution, String fieldName)
public static Expression createExpressionForField(org.activiti.bpmn.model.FieldExtension fieldExtension)
Expression
for the FieldExtension
.public static Expression getFieldExpression(DelegateExecution execution, String fieldName)
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.public static Expression getFieldExpression(DelegateTask task, String fieldName)
getFieldExpression(DelegateExecution, String)
, but for use within a TaskListener
.public static Expression getFlowElementFieldExpression(DelegateExecution execution, String fieldName)
public static Expression getListenerFieldExpression(DelegateExecution execution, String fieldName)
Copyright © 2017 Alfresco. All rights reserved.