Package org.camunda.bpm.engine.variable.value

Examples of org.camunda.bpm.engine.variable.value.TypedValue


        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.
      TypedValue typedDefaultValue = type.convertToModelValue(Variables.untypedValue(defaultValue));
      // now convert to form value
      formField.setValue(type.convertToFormValue(typedDefaultValue));
    }

    // properties
View Full Code Here


  }

  // submit /////////////////////////////////////////////

  public void handleSubmit(VariableScope variableScope, VariableMap values, VariableMap allValues) {
    TypedValue submittedValue = (TypedValue) values.getValueTyped(id);
    values.remove(id);

    // perform validation
    for (FormFieldValidationConstraintHandler validationHandler : validationHandlers) {
      Object value = null;
      if(submittedValue != null) {
        value = submittedValue.getValue();
      }
      validationHandler.validate(value, allValues, this, variableScope);
    }

    // update variable(s)
    TypedValue modelValue = null;
    if (submittedValue != null) {
      if (type != null) {
        modelValue = type.convertToModelValue(submittedValue);
      }
      else {
        modelValue = submittedValue;
      }
    }
    else if (defaultValueExpression != null) {
      final TypedValue expressionValue = Variables.untypedValue(defaultValueExpression.getValue(variableScope));
      if (type != null) {
        // first, need to convert to model value since the default value may be a String Constant specified in the model xml.
        modelValue = type.convertToModelValue(Variables.untypedValue(expressionValue));
      }
      else if (expressionValue != null) {
        modelValue = Variables.stringValue(expressionValue.getValue().toString());
      }
    }

    if (modelValue != null) {
      if (id != null) {
View Full Code Here

    this.variableInstanceEntity = variableInstanceEntity;
  }

  public void flush() {
    // this first check verifies if the variable value was not overwritten with another object
    TypedValue cachedValue = variableInstanceEntity.getCachedValue();
    if (cachedValue != null && deserializedObject == cachedValue.getValue()) {
      try {
        byte[] bytes = serializer.serializeToByteArray(deserializedObject);
        if(!Arrays.equals(originalBytes, bytes)) {
          variableInstanceEntity
            .getByteArrayValue()
View Full Code Here

  }

  // type /////////////////////////////////////////////////////////////////////

  public Object getValue() {
    TypedValue typedValue = getTypedValue();
    if(typedValue != null) {
      return typedValue.getValue();
    } else {
      return null;
    }
  }
View Full Code Here

      .getTaskManager()
      .findTaskById(taskId);

    ensureNotNull("task " + taskId + " doesn't exist", "task", task);

    TypedValue value;

    if (isLocal) {
      value = task.getVariableLocalTyped(variableName, deserializeValue);
    } else {
      value = task.getVariableTyped(variableName, deserializeValue);
View Full Code Here

  public int getRevisionNext() {
    return revision+1;
  }

  public Object getValue() {
    TypedValue typedValue = getTypedValue();
    if(typedValue != null) {
      return typedValue.getValue();
    } else {
      return null;
    }
  }
View Full Code Here

  public boolean matches(Object argument) {
    if (argument == null || !TypedValue.class.isAssignableFrom(argument.getClass())) {
      return false;
    }

    TypedValue typedValue = (TypedValue) argument;

    if (typedValue.getType() != ValueType.NULL) {
      return false;
    }

    if (typedValue.getValue() != null) {
      return false;
    }

    return true;
  }
View Full Code Here

  public boolean matches(Object argument) {
    if (argument == null || !TypedValue.class.isAssignableFrom(argument.getClass())) {
      return false;
    }

    TypedValue typedValue = (TypedValue) argument;

    if (type != null &&
        !type.equals(typedValue.getType())) {
      return false;
    }

    return true;
  }
View Full Code Here

  public boolean matches(Object argument) {
    if (argument == null || !TypedValue.class.isAssignableFrom(argument.getClass())) {
      return false;
    }

    TypedValue typedValue = (TypedValue) argument;

    if (typedValue.getType() != null) {
      return false;
    }

    if (value == null) {
      if (typedValue.getValue() != null) {
        return false;
      }
    } else {
      if (!value.equals(typedValue.getValue())) {
        return false;
      }
    }

    return true;
View Full Code Here

TOP

Related Classes of org.camunda.bpm.engine.variable.value.TypedValue

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.