Examples of ObjectValue


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

    // validate untyped value
    JavaSerializable value = (JavaSerializable) runtimeService.getVariable(instance.getId(), "simpleBean");
    assertEquals(javaSerializable, value);

    // validate typed value
    ObjectValue typedValue = runtimeService.getVariableTyped(instance.getId(), "simpleBean");
    assertObjectValueDeserialized(typedValue, javaSerializable);
    assertObjectValueSerializedJava(typedValue, javaSerializable);
  }
View Full Code Here

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

    // get null value via untyped api
    assertNull(runtimeService.getVariable(instance.getId(), "nullObject"));

    // get null via typed api
    ObjectValue typedValue = runtimeService.getVariableTyped(instance.getId(), "nullObject");
    assertObjectValueDeserializedNull(typedValue);

  }
View Full Code Here

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

    // get null value via untyped api
    assertNull(runtimeService.getVariable(instance.getId(), "nullObject"));

    // get null via typed api
    ObjectValue deserializedTypedValue = runtimeService.getVariableTyped(instance.getId(), "nullObject");
    assertObjectValueDeserializedNull(deserializedTypedValue);

    ObjectValue serializedTypedValue = runtimeService.getVariableTyped(instance.getId(), "nullObject", false);
    assertObjectValueSerializedNull(serializedTypedValue);
  }
View Full Code Here

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

    // get null value via untyped api
    assertNull(runtimeService.getVariable(instance.getId(), "nullObject"));

    // get null via typed api
    ObjectValue deserializedTypedValue = runtimeService.getVariableTyped(instance.getId(), "nullObject");
    assertNotNull(deserializedTypedValue);
    assertTrue(deserializedTypedValue.isDeserialized());
    assertEquals(JAVA_DATA_FORMAT, deserializedTypedValue.getSerializationDataFormat());
    assertNull(deserializedTypedValue.getValue());
    assertNull(deserializedTypedValue.getValueSerialized());
    assertNull(deserializedTypedValue.getObjectType());
    assertEquals(typeName, deserializedTypedValue.getObjectTypeName());

    ObjectValue serializedTypedValue = runtimeService.getVariableTyped(instance.getId(), "nullObject", false);
    assertNotNull(serializedTypedValue);
    assertFalse(serializedTypedValue.isDeserialized());
    assertEquals(JAVA_DATA_FORMAT, serializedTypedValue.getSerializationDataFormat());
    assertNull(serializedTypedValue.getValueSerialized());
    assertEquals(typeName, serializedTypedValue.getObjectTypeName());
  }
View Full Code Here

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

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

    // variable is still of type object
    ObjectValue typedValue = runtimeService.getVariableTyped(instance.getId(), "varName");
    assertObjectValueDeserializedNull(typedValue);
  }
View Full Code Here

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

         .singleResult()
         .getId();

     // when
     StringValue stringValue = caseService.getVariableTyped(caseExecutionId, "aVariableName");
     ObjectValue objectValue = caseService.getVariableTyped(caseExecutionId, "aSerializedObject");
     ObjectValue serializedObjectValue = caseService.getVariableTyped(caseExecutionId, "aSerializedObject", false);

     // then
     assertNotNull(stringValue.getValue());
     assertNotNull(objectValue.getValue());
     assertTrue(objectValue.isDeserialized());
     assertEquals(Arrays.asList("1", "2"), objectValue.getValue());
     assertFalse(serializedObjectValue.isDeserialized());
     assertNotNull(serializedObjectValue.getValueSerialized());
  }
View Full Code Here

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

        .setVariableLocal("aSerializedObject", Variables.objectValue(Arrays.asList("1", "2")).create())
        .execute();

     // when
     StringValue stringValue = caseService.getVariableLocalTyped(caseExecutionId, "aVariableName");
     ObjectValue objectValue = caseService.getVariableLocalTyped(caseExecutionId, "aSerializedObject");
     ObjectValue serializedObjectValue = caseService.getVariableLocalTyped(caseExecutionId, "aSerializedObject", false);

     // then
     assertNotNull(stringValue.getValue());
     assertNotNull(objectValue.getValue());
     assertTrue(objectValue.isDeserialized());
     assertEquals(Arrays.asList("1", "2"), objectValue.getValue());
     assertFalse(serializedObjectValue.isDeserialized());
     assertNotNull(serializedObjectValue.getValueSerialized());
  }
View Full Code Here

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

    assertEquals(ValueType.STRING, execution.getVariableLocalTyped("aStringVariable").getType());

    SimpleSerializableBean objectValue = (SimpleSerializableBean) execution.getVariable("anObjectValue");
    assertNotNull(objectValue);
    assertEquals(10, objectValue.getIntProperty());
    ObjectValue variableTyped = execution.getVariableTyped("anObjectValue");
    assertEquals(10, variableTyped.getValue(SimpleSerializableBean.class).getIntProperty());
    assertEquals(JavaObjectSerializer.SERIALIZATION_DATA_FORMAT, variableTyped.getSerializationDataFormat());

    objectValue = (SimpleSerializableBean) execution.getVariable("anUntypedObjectValue");
    assertNotNull(objectValue);
    assertEquals(30, objectValue.getIntProperty());
    variableTyped = execution.getVariableTyped("anUntypedObjectValue");
    assertEquals(30, variableTyped.getValue(SimpleSerializableBean.class).getIntProperty());
    assertEquals(Context.getProcessEngineConfiguration().getDefaultSerializationFormat(), variableTyped.getSerializationDataFormat());

  }
View Full Code Here

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

    if(typedValue instanceof UntypedValueImpl) {
      objectToSerialize = typedValue.getValue();
      requestedDataformat = null;
    }
    else if(typedValue instanceof ObjectValue) {
      ObjectValue objectValue = (ObjectValue) typedValue;
      String requestedDataFormat = objectValue.getSerializationDataFormat();

      if(!objectValue.isDeserialized()) {
        // serialized object => dataformat must match
        return serializationDataFormat.equals(requestedDataFormat);
      }
      else {
        objectToSerialize = typedValue.getValue();
        requestedDataformat = objectValue.getSerializationDataFormat();
      }
    } else {
      // not an object value
      return false;
    }
View Full Code Here

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

    assertEquals(2, variableInstances.size());

    for (HistoricVariableInstance variableInstance : variableInstances) {
      assertNull(variableInstance.getErrorMessage());

      ObjectValue typedValue = (ObjectValue) variableInstance.getTypedValue();
      assertNotNull(typedValue);
      assertFalse(typedValue.isDeserialized());
      // cannot access the deserialized value
      try {
        typedValue.getValue();
      }
      catch(IllegalStateException e) {
        assertTextPresent("Object is not deserialized", e.getMessage());
      }
      assertNotNull(typedValue.getValueSerialized());
    }

    taskService.deleteTask(newTask.getId(), true);

  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.