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

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


    // set the variable to null via untyped Api
    runtimeService.setVariable(instance.getId(), "varName", null);

    // variable is now untyped null
    TypedValue nullValue = runtimeService.getVariableTyped(instance.getId(), "varName");
    assertUntypedNullValue(nullValue);

  }
View Full Code Here


    // set the variable to null via untyped Api
    runtimeService.setVariable(instance.getId(), "varName", null);

    // variable is now untyped null
    TypedValue nullValue = runtimeService.getVariableTyped(instance.getId(), "varName");
    assertUntypedNullValue(nullValue);

  }
View Full Code Here

    return values;
  }

  @Override
  public VariableValueDto getVariable(String variableName, boolean deserializeValue) {
    TypedValue value = getTypedValueForVariable(variableName, deserializeValue);
    return VariableValueDto.fromTypedValue(value);

  }
View Full Code Here

    return VariableValueDto.fromTypedValue(value);

  }

  protected TypedValue getTypedValueForVariable(String variableName, boolean deserializeValue) {
    TypedValue value = null;
    try {
       value = getVariableEntity(variableName, deserializeValue);
    } catch (ProcessEngineException e) {
      String errorMessage = String.format("Cannot get %s variable %s: %s", getResourceTypeName(), variableName, e.getMessage());
      throw new RestException(Status.INTERNAL_SERVER_ERROR, e, errorMessage);
View Full Code Here

    }
    return value;
  }

  public InputStream getVariableBinary(String variableName) {
    TypedValue typedValue = getTypedValueForVariable(variableName, false);
    if(typedValue instanceof BytesValue) {
      byte[] valueBytes = ((BytesValue)typedValue).getValue();
      if (valueBytes == null) {
        valueBytes = new byte[0];
      }

      return new ByteArrayInputStream(valueBytes);
    }
    else {
      throw new InvalidRequestException(Status.BAD_REQUEST, "Variable '"+variableName+"' is not of type 'Bytes' but of type '"+typedValue.getType()+"'.");
    }
  }
View Full Code Here

  @Override
  public void putVariable(String variableName, VariableValueDto variable) {

    try {
      TypedValue typedValue = variable.toTypedValue(engine, objectMapper);
      setVariableEntity(variableName, typedValue);

    } catch (RestException e) {
      throw new InvalidRequestException(e.getStatus(), e,
        String.format("Cannot put %s variable %s: %s", getResourceTypeName(), variableName, e.getMessage()));
View Full Code Here

  protected void initializeCommandWithVariables(CaseExecutionCommandBuilder commandBuilder, Map<String, TriggerVariableValueDto> variables, String transition) {
    for(String variableName : variables.keySet()) {
      try {
        TriggerVariableValueDto variableValue = variables.get(variableName);
        TypedValue typedValue = variableValue.toTypedValue(engine, objectMapper);

        if (variableValue.isLocal()) {
          commandBuilder.setVariableLocal(variableName, typedValue);

        } else {
View Full Code Here

  protected TypedValue cachedValue;

  protected String errorMessage;

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

    this.formVariableNames = formVariableNames;
    this.deserializeObjectValues = deserializeObjectValues;
  }

  protected TypedValue createVariable(FormField formField, VariableScope variableScope) {
    TypedValue value = formField.getValue();

    if(value != null) {
      return value;
    }
    else {
View Full Code Here

      .getCaseExecutionManager()
      .findCaseExecutionById(caseExecutionId);

    ensureNotNull(CaseExecutionNotFoundException.class, "case execution " + caseExecutionId + " doesn't exist", "caseExecution", caseExecution);

    TypedValue value;

    if (isLocal) {
      value = caseExecution.getVariableLocalTyped(variableName, deserializeValue);
    } else {
      value = caseExecution.getVariableTyped(variableName, deserializeValue);
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.