public static Expression getListenerFieldExpression(DelegateExecution execution, String fieldName) { FieldExtension fieldExtension = getListenerField(execution, fieldName); if (fieldExtension != null) { return createExpressionForField(fieldExtension); } return null; } }
public static List<FieldExtension> getFlowElementFields(DelegateExecution execution) { FlowElement flowElement = getFlowElement(execution); if (flowElement instanceof TaskWithFieldExtensions) { return ((TaskWithFieldExtensions) flowElement).getFieldExtensions(); } return new ArrayList<FieldExtension>(); }
/** * Returns for the activityId of the passed {@link DelegateExecution} the * {@link Map} of {@link ExtensionElement} instances. These represent the * extension elements defined in the BPMN 2.0 XML as part of that particular * activity. * <p> * If the execution is currently being used for executing an * {@link ExecutionListener}, the extension elements of the listener will be * used. Use the {@link #getFlowElementExtensionElements(DelegateExecution)} * or {@link #getListenerExtensionElements(DelegateExecution)} instead to * specifically get the extension elements of either the flow element or the * listener. */ public static Map<String, List<ExtensionElement>> getExtensionElements(DelegateExecution execution) { if (isExecutingExecutionListener(execution)) { return getListenerExtensionElements(execution); } else { return getFlowElementExtensionElements(execution); } }
public static Expression getFlowElementFieldExpression(DelegateExecution execution, String fieldName) { FieldExtension fieldExtension = getFlowElementField(execution, fieldName); if (fieldExtension != null) { return createExpressionForField(fieldExtension); } return null; }
/** * Returns the {@link FieldExtension} matching the provided 'fieldName' which * is defined for the current activity of the provided * {@link DelegateExecution}. * <p> * Returns null if no such {@link FieldExtension} can be found. * <p> * If the execution is currently being used for executing an * {@link ExecutionListener}, the field of the listener will be returned. Use * {@link #getFlowElementField(DelegateExecution, String)} or * {@link #getListenerField(DelegateExecution, String)} for specifically * getting the field from either the flow element or the listener. */ public static FieldExtension getField(DelegateExecution execution, String fieldName) { if (isExecutingExecutionListener(execution)) { return getListenerField(execution, fieldName); } else { return getFlowElementField(execution, fieldName); } }
/** * Returns the list of field extensions, represented as instances of * {@link FieldExtension}, for the current activity of the passed * {@link DelegateExecution}. * <p> * If the execution is currently being used for executing an * {@link ExecutionListener}, the fields of the listener will be returned. Use * {@link #getFlowElementFields(DelegateExecution)} or * {@link #getListenerFields(DelegateExecution)} if needing the flow element * of listener fields specifically. */ public static List<FieldExtension> getFields(DelegateExecution execution) { if (isExecutingExecutionListener(execution)) { return getListenerFields(execution); } else { return getFlowElementFields(execution); } }
/** * Returns the {@link Expression} for the field defined for the current * activity of the provided {@link DelegateExecution}. * <p> * Returns null if no such field was found in the process definition xml. * <p> * If the execution is currently being used for executing an * {@link ExecutionListener}, it will return the field expression for the * listener. Use * {@link #getFlowElementFieldExpression(DelegateExecution, String)} or * {@link #getListenerFieldExpression(DelegateExecution, String)} for * specifically getting the flow element or listener field expression. */ public static Expression getFieldExpression(DelegateExecution execution, String fieldName) { if (isExecutingExecutionListener(execution)) { return getListenerFieldExpression(execution, fieldName); } else { return getFlowElementFieldExpression(execution, fieldName); } }
/** * Returns the current {@link FlowElement} where the {@link DelegateExecution} is currently at. */ public static FlowElement getFlowElement(DelegateExecution execution) { BpmnModel bpmnModel = getBpmnModel(execution); FlowElement flowElement = bpmnModel.getFlowElement(execution.getCurrentActivityId()); if (flowElement == null) { throw new ActivitiException("Could not find a FlowElement for activityId " + execution.getCurrentActivityId()); } return flowElement; }
public static FieldExtension getFlowElementField(DelegateExecution execution, String fieldName) { List<FieldExtension> fieldExtensions = getFlowElementFields(execution); if (fieldExtensions == null || fieldExtensions.size() == 0) { return null; } for (FieldExtension fieldExtension : fieldExtensions) { if (fieldExtension.getFieldName() != null && fieldExtension.getFieldName().equals(fieldName)) { return fieldExtension; } } return null; }
/** * Similar to {@link #getFieldExpression(DelegateExecution, String)}, but for use within a {@link TaskListener}. */ public static Expression getFieldExpression(DelegateTask task, String fieldName) { if (task.getCurrentActivitiListener() != null) { List<FieldExtension> fieldExtensions = task.getCurrentActivitiListener().getFieldExtensions(); if (fieldExtensions != null && fieldExtensions.size() > 0) { for (FieldExtension fieldExtension : fieldExtensions) { if (fieldName.equals(fieldExtension.getFieldName())) { return createExpressionForField(fieldExtension); } } } } return null; }
public void execute(DelegateExecution execution) { FieldExtension fieldExtension = DelegateHelper.getFlowElementField(execution, EXPRESSION_DECISION_TABLE_REFERENCE_KEY); if (fieldExtension == null || ((fieldExtension.getStringValue() == null || fieldExtension.getStringValue().length() == 0) && (fieldExtension.getExpression() == null || fieldExtension.getExpression().length() == 0))) {
/** * Returns the {@link FieldExtension} matching the provided 'fieldName' which * is defined for the current activity of the provided * {@link DelegateExecution}. * * Returns null if no such {@link FieldExtension} can be found. * * If the execution is currently being used for executing an * {@link ExecutionListener}, the field of the listener will be returned. Use * {@link #getFlowElementField(DelegateExecution, String)} or * {@link #getListenerField(DelegateExecution, String)} for specifically * getting the field from either the flow element or the listener. */ public static FieldExtension getField(DelegateExecution execution, String fieldName) { if (isExecutingExecutionListener(execution)) { return getListenerField(execution, fieldName); } else { return getFlowElementField(execution, fieldName); } }
/** * Returns the list of field extensions, represented as instances of * {@link FieldExtension}, for the current activity of the passed * {@link DelegateExecution}. * * If the execution is currently being used for executing an * {@link ExecutionListener}, the fields of the listener will be returned. Use * {@link #getFlowElementFields(DelegateExecution)} or * {@link #getListenerFields(DelegateExecution)} if needing the flow element * of listener fields specifically. */ public static List<FieldExtension> getFields(DelegateExecution execution) { if (isExecutingExecutionListener(execution)) { return getListenerFields(execution); } else { return getFlowElementFields(execution); } }
/** * Returns the {@link Expression} for the field defined for the current * activity of the provided {@link DelegateExecution}. * * Returns null if no such field was found in the process definition xml. * * If the execution is currently being used for executing an * {@link ExecutionListener}, it will return the field expression for the * listener. Use * {@link #getFlowElementFieldExpression(DelegateExecution, String)} or * {@link #getListenerFieldExpression(DelegateExecution, String)} for * specifically getting the flow element or listener field expression. */ public static Expression getFieldExpression(DelegateExecution execution, String fieldName) { if (isExecutingExecutionListener(execution)) { return getListenerFieldExpression(execution, fieldName); } else { return getFlowElementFieldExpression(execution, fieldName); } }
public static Expression getFlowElementFieldExpression(DelegateExecution execution, String fieldName) { FieldExtension fieldExtension = getFlowElementField(execution, fieldName); if (fieldExtension != null) { return createExpressionForField(fieldExtension); } return null; }
/** * Returns the current {@link FlowElement} where the {@link DelegateExecution} is currently at. */ public static FlowElement getFlowElement(DelegateExecution execution) { BpmnModel bpmnModel = getBpmnModel(execution); FlowElement flowElement = bpmnModel.getFlowElement(execution.getCurrentActivityId()); if (flowElement == null) { throw new ActivitiException("Could not find a FlowElement for activityId " + execution.getCurrentActivityId()); } return flowElement; }
public static FieldExtension getFlowElementField(DelegateExecution execution, String fieldName) { List<FieldExtension> fieldExtensions = getFlowElementFields(execution); if (fieldExtensions == null || fieldExtensions.size() == 0) { return null; } for (FieldExtension fieldExtension : fieldExtensions) { if (fieldExtension.getFieldName() != null && fieldExtension.getFieldName().equals(fieldName)) { return fieldExtension; } } return null; }
/** * Similar to {@link #getFieldExpression(DelegateExecution, String)}, but for use within a {@link TaskListener}. */ public static Expression getFieldExpression(DelegateTask task, String fieldName) { if (task.getCurrentActivitiListener() != null) { List<FieldExtension> fieldExtensions = task.getCurrentActivitiListener().getFieldExtensions(); if (fieldExtensions != null && fieldExtensions.size() > 0) { for (FieldExtension fieldExtension : fieldExtensions) { if (fieldName.equals(fieldExtension.getFieldName())) { return createExpressionForField(fieldExtension); } } } } return null; }
/** * Returns for the activityId of the passed {@link DelegateExecution} the * {@link Map} of {@link 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 * {@link ExecutionListener}, the extension elements of the listener will be * used. Use the {@link #getFlowElementExtensionElements(DelegateExecution)} * or {@link #getListenerExtensionElements(DelegateExecution)} instead to * specifically get the extension elements of either the flow element or the * listener. */ public static Map<String, List<ExtensionElement>> getExtensionElements(DelegateExecution execution) { if (isExecutingExecutionListener(execution)) { return getListenerExtensionElements(execution); } else { return getFlowElementExtensionElements(execution); } }
public static Expression getListenerFieldExpression(DelegateExecution execution, String fieldName) { FieldExtension fieldExtension = getListenerField(execution, fieldName); if (fieldExtension != null) { return createExpressionForField(fieldExtension); } return null; }