Package org.camunda.bpm.engine.delegate

Examples of org.camunda.bpm.engine.delegate.Expression


    if (className != null) {
      caseExecutionListener = new ClassDelegateCaseExecutionListener(className, fieldDeclarations);

    } else if (expression != null) {
      Expression expressionExp = expressionManager.createExpression(expression);
      caseExecutionListener = new ExpressionCaseExecutionListener(expressionExp);

    } else if (delegateExpression != null) {
      Expression delegateExp = expressionManager.createExpression(delegateExpression);
      caseExecutionListener = new DelegateExpressionCaseExecutionListener(delegateExp, fieldDeclarations);

    } else if (scriptElement != null) {
      ExecutableScript executableScript = initializeScript(element, activity, context, scriptElement);
      if (executableScript != null) {
View Full Code Here


    CaseVariableListener variableListener = null;
    if (className != null) {
      variableListener = new ClassDelegateCaseVariableListener(className, fieldDeclarations);

    } else if (expression != null) {
      Expression expressionExp = expressionManager.createExpression(expression);
      variableListener = new ExpressionCaseVariableListener(expressionExp);

    } else if (delegateExpression != null) {
      Expression delegateExp = expressionManager.createExpression(delegateExpression);
      variableListener = new DelegateExpressionCaseVariableListener(delegateExp, fieldDeclarations);

    } else if (scriptElement != null) {
      ExecutableScript executableScript = initializeScript(element, activity, context, scriptElement);
      if (executableScript != null) {
View Full Code Here

    }

    // parse name
    String name = formField.attribute("label");
    if (name != null) {
      Expression nameExpression = expressionManager.createExpression(name);
      formFieldHandler.setLabel(nameExpression);
    }

    // parse properties
    parseProperties(formField, formFieldHandler, bpmnParse, expressionManager);

    // parse validation
    parseValidation(formField, formFieldHandler, bpmnParse, expressionManager);

    // parse type
    FormTypes formTypes = getFormTypes();
    AbstractFormFieldType formType = formTypes.parseFormPropertyType(formField, bpmnParse);
    formFieldHandler.setType(formType);

    // parse default value
    String defaultValue = formField.attribute("defaultValue");
    if(defaultValue != null) {
      Expression defaultValueExpression = expressionManager.createExpression(defaultValue);
      formFieldHandler.setDefaultValueExpression(defaultValueExpression);
    }

    formFieldHandlers.add(formFieldHandler);
View Full Code Here

      String variableName = formPropertyElement.attribute("variable");
      formPropertyHandler.setVariableName(variableName);

      String expressionText = formPropertyElement.attribute("expression");
      if (expressionText!=null) {
        Expression expression = expressionManager.createExpression(expressionText);
        formPropertyHandler.setVariableExpression(expression);
      }

      String defaultExpressionText = formPropertyElement.attribute("default");
      if (defaultExpressionText!=null) {
        Expression defaultExpression = expressionManager.createExpression(defaultExpressionText);
        formPropertyHandler.setDefaultExpression(defaultExpression);
      }

      formPropertyHandlers.add(formPropertyHandler);
    }
View Full Code Here

  }

  protected TimerDeclarationImpl parseTimer(Element timerEventDefinition, ScopeImpl timerActivity, String jobHandlerType) {
    // TimeDate
    TimerDeclarationType type = TimerDeclarationType.DATE;
    Expression expression = parseExpression(timerEventDefinition, "timeDate");
    // TimeCycle
    if (expression == null) {
      type = TimerDeclarationType.CYCLE;
      expression = parseExpression(timerEventDefinition, "timeCycle");
    }
    // TimeDuration
    if (expression == null) {
      type = TimerDeclarationType.DURATION;
      expression = parseExpression(timerEventDefinition, "timeDuration");
    }
    // neither date, cycle or duration configured!
    if (expression==null) {
      addError("Timer needs configuration (either timeDate, timeCycle or timeDuration is needed).", timerEventDefinition);
    }

    // Parse the timer declaration
    // TODO move the timer declaration into the bpmn activity or next to the
    // TimerSession
    TimerDeclarationImpl timerDeclaration = new TimerDeclarationImpl(expression, type, jobHandlerType);
    timerDeclaration.setJobHandlerConfiguration(timerActivity.getId());
    timerDeclaration.setExclusive("true".equals(timerEventDefinition.attributeNS(BpmnParser.ACTIVITI_BPMN_EXTENSIONS_NS, "exclusive", String.valueOf(JobEntity.DEFAULT_EXCLUSIVE))));
    if(timerActivity.getId() == null) {
      addError("Attribute \"id\" is required!",timerEventDefinition);
    }
    timerDeclaration.setActivityId(timerActivity.getId());
    timerDeclaration.setJobConfiguration(type.toString() + ": " +expression.getExpressionText());
    addJobDeclarationToProcessDefinition(timerDeclaration, timerActivity.getProcessDefinition());

    return timerDeclaration;
  }
View Full Code Here

        String businessKeyExpression = inElement.attribute("businessKey");
        if ((source != null || sourceExpression != null) && target == null) {
          addError("Missing attribute 'target' when attribute source or sourceExpression is set", inElement);
        }
        else if (sourceExpression != null) {
          Expression expression = expressionManager.createExpression(sourceExpression.trim());
          callActivityBehaviour.addDataInputAssociation(new DataAssociation(expression, target));
        } else if (variables != null && ("all").equals(variables)) {
          callActivityBehaviour.addDataInputAssociation(new DataAssociation(variables));
        } else if (businessKeyExpression != null) {
          Expression expression = expressionManager.createExpression(businessKeyExpression.trim());
          callActivityBehaviour.addDataInputAssociation(new DataAssociation(expression));
        } else {
          callActivityBehaviour.addDataInputAssociation(new DataAssociation(source, target));
        }
      }
      // output data elements
      for (Element outElement : extensionsElement.elementsNS(BpmnParser.ACTIVITI_BPMN_EXTENSIONS_NS, "out")) {
        String source = outElement.attribute("source");
        String sourceExpression = outElement.attribute("sourceExpression");
        String target = outElement.attribute("target");
        String variables = outElement.attribute("variables");
        if ((source != null || sourceExpression != null) && target == null) {
          addError("Missing attribute 'target' when attribute source or sourceExpression is set", outElement);
        }
        else if (sourceExpression != null) {
          Expression expression = expressionManager.createExpression(sourceExpression.trim());
          callActivityBehaviour.addDataOutputAssociation(new DataAssociation(expression, target));
        } else if (variables != null && ("all").equals(variables)) {
          callActivityBehaviour.addDataOutputAssociation(new DataAssociation(variables));
        } else {
          callActivityBehaviour.addDataOutputAssociation(new DataAssociation(source, target));
View Full Code Here

      variableDeclaration.setSourceVariableName(src);
    }

    String srcExpr = propertyElement.attributeNS(BpmnParser.ACTIVITI_BPMN_EXTENSIONS_NS, "srcExpr");
    if (srcExpr != null) {
      Expression sourceExpression = expressionManager.createExpression(srcExpr);
      variableDeclaration.setSourceExpression(sourceExpression);
    }

    String dst = propertyElement.attributeNS(BpmnParser.ACTIVITI_BPMN_EXTENSIONS_NS, "dst");
    if (dst != null) {
      variableDeclaration.setDestinationVariableName(dst);
    }

    String destExpr = propertyElement.attributeNS(BpmnParser.ACTIVITI_BPMN_EXTENSIONS_NS, "dstExpr");
    if (destExpr != null) {
      Expression destinationExpression = expressionManager.createExpression(destExpr);
      variableDeclaration.setDestinationExpression(destinationExpression);
    }

    String link = propertyElement.attributeNS(BpmnParser.ACTIVITI_BPMN_EXTENSIONS_NS, "link");
    if (link != null) {
      variableDeclaration.setLink(link);
    }

    String linkExpr = propertyElement.attributeNS(BpmnParser.ACTIVITI_BPMN_EXTENSIONS_NS, "linkExpr");
    if (linkExpr != null) {
      Expression linkExpression = expressionManager.createExpression(linkExpr);
      variableDeclaration.setLinkExpression(linkExpression);
    }

    for (BpmnParseListener parseListener : parseListeners) {
      parseListener.parseProperty(propertyElement, variableDeclaration, activity);
View Full Code Here

            constraint);

      } else {
        if(StringUtil.isExpression(config)) {
          // expression
          Expression validatorExpression = expressionManager.createExpression(config);
          return new DelegateFormFieldValidator(validatorExpression);
        } else {
          // classname
          return new DelegateFormFieldValidator(config);
        }
View Full Code Here

    // assignments
    initializeTaskAssignments(task, variableScope);
  }

  protected void initializeTaskName(TaskEntity task, VariableScope variableScope) {
    Expression nameExpression = taskDefinition.getNameExpression();
    if (nameExpression != null) {
      String name = (String) nameExpression.getValue(variableScope);
      task.setName(name);
    }
  }
View Full Code Here

      task.setName(name);
    }
  }

  protected void initializeTaskDescription(TaskEntity task, VariableScope variableScope) {
    Expression descriptionExpression = taskDefinition.getDescriptionExpression();
    if (descriptionExpression != null) {
      String description = (String) descriptionExpression.getValue(variableScope);
      task.setDescription(description);
    }
  }
View Full Code Here

TOP

Related Classes of org.camunda.bpm.engine.delegate.Expression

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.