Class DelegateHelper
- java.lang.Object
-
- org.activiti.engine.delegate.DelegateHelper
-
public class DelegateHelper extends java.lang.ObjectClass that provides helper operations for use in theJavaDelegate,ActivityBehavior,ExecutionListenerandTaskListenerinterfaces.
-
-
Constructor Summary
Constructors Constructor Description DelegateHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ExpressioncreateExpressionForField(org.activiti.bpmn.model.FieldExtension fieldExtension)Creates anExpressionfor theFieldExtension.static org.activiti.bpmn.model.BpmnModelgetBpmnModel(DelegateExecution execution)Returns theBpmnModelmatching the process definition bpmn model for the process definition of the passedDelegateExecution.static java.util.Map<java.lang.String,java.util.List<org.activiti.bpmn.model.ExtensionElement>>getExtensionElements(DelegateExecution execution)static org.activiti.bpmn.model.FieldExtensiongetField(DelegateExecution execution, java.lang.String fieldName)Returns theFieldExtensionmatching the provided 'fieldName' which is defined for the current activity of the providedDelegateExecution.static ExpressiongetFieldExpression(DelegateExecution execution, java.lang.String fieldName)Returns theExpressionfor the field defined for the current activity of the providedDelegateExecution.static ExpressiongetFieldExpression(DelegateTask task, java.lang.String fieldName)Similar togetFieldExpression(DelegateExecution, String), but for use within aTaskListener.static java.util.List<org.activiti.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.activiti.bpmn.model.FlowElementgetFlowElement(DelegateExecution execution)Returns the currentFlowElementwhere theDelegateExecutionis currently at.static java.util.Map<java.lang.String,java.util.List<org.activiti.bpmn.model.ExtensionElement>>getFlowElementExtensionElements(DelegateExecution execution)static org.activiti.bpmn.model.FieldExtensiongetFlowElementField(DelegateExecution execution, java.lang.String fieldName)static ExpressiongetFlowElementFieldExpression(DelegateExecution execution, java.lang.String fieldName)static java.util.List<org.activiti.bpmn.model.FieldExtension>getFlowElementFields(DelegateExecution execution)static java.util.Map<java.lang.String,java.util.List<org.activiti.bpmn.model.ExtensionElement>>getListenerExtensionElements(DelegateExecution execution)static org.activiti.bpmn.model.FieldExtensiongetListenerField(DelegateExecution execution, java.lang.String fieldName)static ExpressiongetListenerFieldExpression(DelegateExecution execution, java.lang.String fieldName)static java.util.List<org.activiti.bpmn.model.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, java.lang.String sequenceFlowId)To be used in anActivityBehaviororJavaDelegate: leaves the current activity via one specific sequenceflow.
-
-
-
Method Detail
-
leaveDelegate
public static void leaveDelegate(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.
-
leaveDelegate
public static void leaveDelegate(DelegateExecution delegateExecution, java.lang.String sequenceFlowId)
To be used in anActivityBehaviororJavaDelegate: leaves the current activity via one specific sequenceflow.
-
getBpmnModel
public static org.activiti.bpmn.model.BpmnModel getBpmnModel(DelegateExecution execution)
Returns theBpmnModelmatching the process definition bpmn model for the process definition of the passedDelegateExecution.
-
getFlowElement
public static org.activiti.bpmn.model.FlowElement getFlowElement(DelegateExecution execution)
Returns the currentFlowElementwhere theDelegateExecutionis currently at.
-
isExecutingExecutionListener
public static boolean isExecutingExecutionListener(DelegateExecution execution)
Returns whether or not the provided execution is being use for executing anExecutionListener.
-
getExtensionElements
public static java.util.Map<java.lang.String,java.util.List<org.activiti.bpmn.model.ExtensionElement>> getExtensionElements(DelegateExecution execution)
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 an
ExecutionListener, 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 java.util.Map<java.lang.String,java.util.List<org.activiti.bpmn.model.ExtensionElement>> getFlowElementExtensionElements(DelegateExecution execution)
-
getListenerExtensionElements
public static java.util.Map<java.lang.String,java.util.List<org.activiti.bpmn.model.ExtensionElement>> getListenerExtensionElements(DelegateExecution execution)
-
getFields
public static java.util.List<org.activiti.bpmn.model.FieldExtension> getFields(DelegateExecution execution)
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 an
ExecutionListener, the fields of the listener will be returned. UsegetFlowElementFields(DelegateExecution)orgetListenerFields(DelegateExecution)if needing the flow element of listener fields specifically.
-
getFlowElementFields
public static java.util.List<org.activiti.bpmn.model.FieldExtension> getFlowElementFields(DelegateExecution execution)
-
getListenerFields
public static java.util.List<org.activiti.bpmn.model.FieldExtension> getListenerFields(DelegateExecution execution)
-
getField
public static org.activiti.bpmn.model.FieldExtension getField(DelegateExecution execution, java.lang.String fieldName)
Returns theFieldExtensionmatching the provided 'fieldName' which is defined for the current activity of the providedDelegateExecution.Returns null if no such
FieldExtensioncan be found.If the execution is currently being used for executing an
ExecutionListener, 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.activiti.bpmn.model.FieldExtension getFlowElementField(DelegateExecution execution, java.lang.String fieldName)
-
getListenerField
public static org.activiti.bpmn.model.FieldExtension getListenerField(DelegateExecution execution, java.lang.String fieldName)
-
createExpressionForField
public static Expression createExpressionForField(org.activiti.bpmn.model.FieldExtension fieldExtension)
Creates anExpressionfor theFieldExtension.
-
getFieldExpression
public static Expression getFieldExpression(DelegateExecution execution, java.lang.String fieldName)
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 an
ExecutionListener, 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 Expression getFieldExpression(DelegateTask task, java.lang.String fieldName)
Similar togetFieldExpression(DelegateExecution, String), but for use within aTaskListener.
-
getFlowElementFieldExpression
public static Expression getFlowElementFieldExpression(DelegateExecution execution, java.lang.String fieldName)
-
getListenerFieldExpression
public static Expression getListenerFieldExpression(DelegateExecution execution, java.lang.String fieldName)
-
-