Package org.camunda.bpm.engine.delegate

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


    String dueDateString = null;
    Date duedate = null;

    // ACT-1415: timer-declaration on start-event may contain expressions NOT
    // evaluating variables but other context, evaluating should happen nevertheless
    VariableScope scopeForExpression = execution;
    if(scopeForExpression == null) {
      scopeForExpression = StartProcessVariableScope.getSharedInstance();
    }

    Object dueDateValue = description.getValue(scopeForExpression);
View Full Code Here


  public Object getValue(ELContext context, Object base, Object property)  {

    Object object = context.getContext(VariableScope.class);
    if (object instanceof VariableScope) {
      VariableScope variableScope = (VariableScope) object;
      if (base == null) {
        String variable = (String) property; // according to javadoc, can only be a String

        if( (EXECUTION_KEY.equals(property) && variableScope instanceof ExecutionEntity)
                || (TASK_KEY.equals(property) && variableScope instanceof TaskEntity)
                || (variableScope instanceof CaseExecutionEntity
                && (CASE_EXECUTION_KEY.equals(property) || EXECUTION_KEY.equals(property))) ) {
          context.setPropertyResolved(true);
          return variableScope;
        } else if (EXECUTION_KEY.equals(property) && variableScope instanceof TaskEntity) {
          context.setPropertyResolved(true);
          return ((TaskEntity) variableScope).getExecution();
        } else if(LOGGED_IN_USER_KEY.equals(property)){
          context.setPropertyResolved(true);
          return Context.getCommandContext().getAuthenticatedUserId();
        } else {
          if (variableScope.hasVariable(variable)) {
            context.setPropertyResolved(true); // if not set, the next elResolver in the CompositeElResolver will be called
            return variableScope.getVariable(variable);
          }
        }
      }
    }
View Full Code Here

  public void setValue(ELContext context, Object base, Object property, Object value) {
    if (base == null) {
      String variable = (String) property;
      Object object = context.getContext(VariableScope.class);
      if (object instanceof VariableScope) {
        VariableScope variableScope = (VariableScope) object;
        if (variableScope.hasVariable(variable)) {
          variableScope.setVariable(variable, value);
        }
      }
    }
  }
View Full Code Here

  public void notify(DelegateTask delegateTask) {
    // Note: we can't cache the result of the expression, because the
    // execution can change: eg. delegateExpression='${mySpringBeanFactory.randomSpringBean()}'

    VariableScope variableScope = delegateTask.getExecution();
    if (variableScope == null) {
      variableScope = delegateTask.getCaseExecution();
    }

    Object delegate = expression.getValue(variableScope);
View Full Code Here

    // set id
    formField.setId(id);

    // set label (evaluate expression)
    VariableScope variableScope = executionEntity != null ? executionEntity : StartProcessVariableScope.getSharedInstance();
    Object labelValueObject = label.getValue(variableScope);
    if(labelValueObject != null) {
      formField.setLabel(labelValueObject.toString());
    }

    // set type
    formField.setType(type);

    // set default value (evaluate expression)
    Object defaultValue = null;
    if(defaultValueExpression != null) {
      defaultValue = defaultValueExpression.getValue(variableScope);
      if(defaultValue != null) {
        formField.setDefaultValue(type.convertFormValueToModelValue(defaultValue));
      } else {
        formField.setDefaultValue(null);
      }
    }

    // value
    TypedValue value = variableScope.getVariableTyped(id);
    if(value != null) {
      formField.setValue(type.convertToFormValue(value));
    }
    else {
      // first, need to convert to model value since the default value may be a String Constant specified in the model xml.
View Full Code Here

TOP

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

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.