Tabnine Logo
SerializableValueType
Code IndexAdd Tabnine to your IDE (free)

How to use
SerializableValueType
in
org.camunda.bpm.engine.variable.type

Best Java code snippets using org.camunda.bpm.engine.variable.type.SerializableValueType (Showing top 20 results out of 315)

origin: camunda/camunda-bpm-platform

 throw new InvalidRequestException(Status.BAD_REQUEST, "Must provide 'null' or String value for value of SerializableValue type '"+type+"'.");
return ((SerializableValueType) valueType).createValueFromSerialized((String) value, valueInfo);
origin: camunda/camunda-bpm-platform

@Test
@Deployment(resources={"org/camunda/bpm/engine/test/api/runtime/oneTaskProcess.bpmn20.xml"})
public void testGetValueOfSerializableVar() {
 // given
 List<String> serializable = new ArrayList<String>();
 serializable.add("one");
 serializable.add("two");
 serializable.add("three");
 Map<String, Object> variables = new HashMap<String, Object>();
 variables.put("serializableVar", serializable);
 ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("oneTaskProcess", variables);
 // when
 VariableInstanceQuery query = runtimeService.createVariableInstanceQuery().processInstanceIdIn(processInstance.getId());
 // then
 List<VariableInstance> result = query.list();
 assertFalse(result.isEmpty());
 assertEquals(1, result.size());
 VariableInstance instance = result.get(0);
 assertEquals("serializableVar", instance.getName());
 assertNotNull(instance.getValue());
 assertEquals(serializable, instance.getValue());
 assertEquals(ValueType.OBJECT.getName(), instance.getTypeName());
}
origin: camunda/camunda-bpm-platform

@Test
public void testPutSingleLocalVariableFromSerializedWithNoValue() {
 String variableKey = "aVariableKey";
 Map<String, Object> requestJson = VariablesBuilder
   .getObjectValueMap(null, ValueType.OBJECT.getName(), null, null);
 given().pathParam("id", MockProvider.EXAMPLE_TASK_ID).pathParam("varId", variableKey)
  .contentType(ContentType.JSON).body(requestJson)
  .then().expect().statusCode(Status.NO_CONTENT.getStatusCode())
  .when().put(SINGLE_TASK_PUT_SINGLE_VARIABLE_URL);
 verify(taskServiceMock).setVariableLocal(
   eq(MockProvider.EXAMPLE_TASK_ID), eq(variableKey),
   argThat(EqualsObjectValue.objectValueMatcher()));
}
origin: camunda/camunda-bpm-platform

 throw new InvalidRequestException(Status.BAD_REQUEST, "Must provide 'null' or String value for value of SerializableValue type '"+type+"'.");
return ((SerializableValueType) valueType).createValueFromSerialized((String) value, valueInfo);
origin: camunda/camunda-bpm-platform

@Test
public void testPutSingleVariableFromSerializedWithNoValue() {
 String variableKey = "aVariableKey";
 Map<String, Object> requestJson = VariablesBuilder
   .getObjectValueMap(null, ValueType.OBJECT.getName(), null, null);
 given().pathParam("id", MockProvider.EXAMPLE_TASK_ID).pathParam("varId", variableKey)
  .contentType(ContentType.JSON).body(requestJson)
  .then().expect().statusCode(Status.NO_CONTENT.getStatusCode())
  .when().put(SINGLE_TASK_PUT_SINGLE_VARIABLE_URL);
 verify(taskServiceMock).setVariable(
   eq(MockProvider.EXAMPLE_TASK_ID), eq(variableKey),
   argThat(EqualsObjectValue.objectValueMatcher()));
}
origin: org.camunda.bpm/camunda-engine-rest-jaxrs2

 throw new InvalidRequestException(Status.BAD_REQUEST, "Must provide 'null' or String value for value of SerializableValue type '"+type+"'.");
return ((SerializableValueType) valueType).createValueFromSerialized((String) value, valueInfo);
origin: camunda/camunda-bpm-platform

@Test
public void testPutSingleVariableFromSerializedWithNoValue() {
 String variableKey = "aVariableKey";
 Map<String, Object> requestJson = VariablesBuilder
   .getObjectValueMap(null, ValueType.OBJECT.getName(), null, null);
 given().pathParam("id", MockProvider.EXAMPLE_PROCESS_INSTANCE_ID).pathParam("varId", variableKey)
  .contentType(ContentType.JSON).body(requestJson)
  .then().expect().statusCode(Status.NO_CONTENT.getStatusCode())
  .when().put(SINGLE_PROCESS_INSTANCE_VARIABLE_URL);
 verify(runtimeServiceMock).setVariable(
   eq(MockProvider.EXAMPLE_PROCESS_INSTANCE_ID), eq(variableKey),
   argThat(EqualsObjectValue.objectValueMatcher()));
}
origin: camunda/camunda-bpm-platform

@Test
public void testPutSingleLocalVariableFromSerializedWithNoValue() {
 String variableKey = "aVariableKey";
 Map<String, Object> requestJson = VariablesBuilder
   .getObjectValueMap(null, ValueType.OBJECT.getName(), null, null);
 given().pathParam("id", MockProvider.EXAMPLE_EXECUTION_ID).pathParam("varId", variableKey)
  .contentType(ContentType.JSON).body(requestJson)
  .then().expect().statusCode(Status.NO_CONTENT.getStatusCode())
  .when().put(SINGLE_EXECUTION_LOCAL_VARIABLE_URL);
 verify(runtimeServiceMock).setVariableLocal(eq(MockProvider.EXAMPLE_EXECUTION_ID), eq(variableKey),
   argThat(EqualsObjectValue
    .objectValueMatcher()
    .serializationFormat(null)
    .objectTypeName(null)
    .serializedValue(null)));
}
origin: camunda/camunda-bpm-platform

@Test
public void testPutSingleLocalVariableFromSerialized() {
 String serializedValue = "{\"prop\" : \"value\"}";
 Map<String, Object> requestJson = VariablesBuilder
   .getObjectValueMap(serializedValue, ValueType.OBJECT.getName(), "aDataFormat", "aRootType");
 String variableKey = "aVariableKey";
 given()
  .pathParam("id", MockProvider.EXAMPLE_EXECUTION_ID).pathParam("varId", variableKey)
  .contentType(ContentType.JSON)
  .body(requestJson)
 .expect()
  .statusCode(Status.NO_CONTENT.getStatusCode())
 .when()
  .put(SINGLE_EXECUTION_LOCAL_VARIABLE_URL);
 verify(runtimeServiceMock).setVariableLocal(eq(MockProvider.EXAMPLE_EXECUTION_ID), eq(variableKey),
   argThat(EqualsObjectValue
    .objectValueMatcher()
    .serializationFormat("aDataFormat")
    .objectTypeName("aRootType")
    .serializedValue(serializedValue)));
}
origin: camunda/camunda-bpm-platform

@Test
public void testPutSingleVariableFromSerialized() throws Exception {
 String serializedValue = "{\"prop\" : \"value\"}";
 Map<String, Object> requestJson = VariablesBuilder
   .getObjectValueMap(serializedValue, ValueType.OBJECT.getName(), "aDataFormat", "aRootType");
 String variableKey = "aVariableKey";
 given()
  .pathParam("id", MockProvider.EXAMPLE_PROCESS_INSTANCE_ID).pathParam("varId", variableKey)
  .contentType(ContentType.JSON)
  .body(requestJson)
 .expect()
  .statusCode(Status.NO_CONTENT.getStatusCode())
 .when()
  .put(SINGLE_PROCESS_INSTANCE_VARIABLE_URL);
 verify(runtimeServiceMock).setVariable(
   eq(MockProvider.EXAMPLE_PROCESS_INSTANCE_ID), eq(variableKey),
   argThat(EqualsObjectValue.objectValueMatcher()
    .serializedValue(serializedValue)
    .serializationFormat("aDataFormat")
    .objectTypeName("aRootType")));
}
origin: camunda/camunda-bpm-platform

@Deployment(resources = {"org/camunda/bpm/engine/test/api/runtime/RuntimeServiceTest.testBasicVariableOperations.bpmn20.xml"})
@Test
public void testChangeTypeFromSerializableUsingApi() {
 Map<String, Object> variables = new HashMap<String, Object>();
 variables.put("aVariable", new SerializableVariable("foo"));
 ProcessInstance pi = runtimeService.startProcessInstanceByKey("taskAssigneeProcess", variables);
 VariableInstanceQuery query = runtimeService.createVariableInstanceQuery().variableName("aVariable");
 VariableInstance variable = query.singleResult();
 assertEquals(ValueType.OBJECT.getName(), variable.getTypeName());
 runtimeService.setVariable(pi.getId(), "aVariable", null);
 variable = query.singleResult();
 assertEquals(ValueType.NULL.getName(), variable.getTypeName());
}
origin: camunda/camunda-bpm-platform

@Test
public void testPutSingleLocalVariableFromSerialized() throws Exception {
 String serializedValue = "{\"prop\" : \"value\"}";
 Map<String, Object> requestJson = VariablesBuilder
   .getObjectValueMap(serializedValue, ValueType.OBJECT.getName(), "aDataFormat", "aRootType");
 String variableKey = "aVariableKey";
 given()
  .pathParam("id", MockProvider.EXAMPLE_TASK_ID).pathParam("varId", variableKey)
  .contentType(ContentType.JSON)
  .body(requestJson)
 .expect()
  .statusCode(Status.NO_CONTENT.getStatusCode())
 .when()
  .put(SINGLE_TASK_PUT_SINGLE_VARIABLE_URL);
 verify(taskServiceMock).setVariableLocal(
   eq(MockProvider.EXAMPLE_TASK_ID), eq(variableKey),
   argThat(EqualsObjectValue.objectValueMatcher()
    .serializedValue(serializedValue)
    .serializationFormat("aDataFormat")
    .objectTypeName("aRootType")));
}
origin: camunda/camunda-bpm-platform

  .variable("var1", "val1")
  .variable("var2", "val2", "String")
  .variable("var3", ValueType.OBJECT.getName(), "val3", "aFormat", "aRootType")
  .getVariables();
parameters.put("variables", variables);
origin: camunda/camunda-bpm-platform

@Deployment(resources = {"org/camunda/bpm/engine/test/api/runtime/RuntimeServiceTest.testBasicVariableOperations.bpmn20.xml"})
@Test
public void testChangeToSerializableUsingApi() {
 Map<String, Object> variables = new HashMap<String, Object>();
 variables.put("aVariable", "test");
 ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("taskAssigneeProcess", variables);
 VariableInstanceQuery query = runtimeService.createVariableInstanceQuery().variableName("aVariable");
 VariableInstance variable = query.singleResult();
 assertEquals(ValueType.STRING.getName(), variable.getTypeName());
 runtimeService.setVariable(processInstance.getId(), "aVariable", new SerializableVariable("foo"));
 variable = query.singleResult();
 assertEquals(ValueType.OBJECT.getName(), variable.getTypeName());
}
origin: camunda/camunda-bpm-platform

@Test
public void testPutSingleVariableFromSerialized() throws Exception {
 String serializedValue = "{\"prop\" : \"value\"}";
 Map<String, Object> requestJson = VariablesBuilder
   .getObjectValueMap(serializedValue, ValueType.OBJECT.getName(), "aDataFormat", "aRootType");
 String variableKey = "aVariableKey";
 given()
  .pathParam("id", MockProvider.EXAMPLE_TASK_ID).pathParam("varId", variableKey)
  .contentType(ContentType.JSON)
  .body(requestJson)
 .expect()
  .statusCode(Status.NO_CONTENT.getStatusCode())
 .when()
  .put(SINGLE_TASK_PUT_SINGLE_VARIABLE_URL);
 verify(taskServiceMock).setVariable(
   eq(MockProvider.EXAMPLE_TASK_ID), eq(variableKey),
   argThat(EqualsObjectValue.objectValueMatcher()
    .serializedValue(serializedValue)
    .serializationFormat("aDataFormat")
    .objectTypeName("aRootType")));
}
origin: camunda/camunda-bpm-platform

@Test
public void testSubmitStartFormWithSerializedVariableValue() {
 String jsonValue = "{}";
 Map<String, Object> variables = VariablesBuilder.create()
   .variable("aVariable", "aStringValue")
   .variable("aSerializedVariable", ValueType.OBJECT.getName(), jsonValue, "aFormat", "aRootType")
   .getVariables();
 Map<String, Object> json = new HashMap<String, Object>();
 json.put("variables", variables);
 given().pathParam("id", MockProvider.EXAMPLE_PROCESS_DEFINITION_ID)
  .contentType(POST_JSON_CONTENT_TYPE).body(json)
  .then().expect()
   .statusCode(Status.OK.getStatusCode())
   .body("id", equalTo(MockProvider.EXAMPLE_PROCESS_INSTANCE_ID))
   .body("definitionId", equalTo(MockProvider.EXAMPLE_PROCESS_DEFINITION_ID))
   .body("businessKey", equalTo(MockProvider.EXAMPLE_PROCESS_INSTANCE_BUSINESS_KEY))
   .body("ended", equalTo(MockProvider.EXAMPLE_PROCESS_INSTANCE_IS_ENDED))
   .body("suspended", equalTo(MockProvider.EXAMPLE_PROCESS_INSTANCE_IS_SUSPENDED))
  .when().post(SUBMIT_FORM_URL);
 verify(formServiceMock).submitStartForm(eq(MockProvider.EXAMPLE_PROCESS_DEFINITION_ID),
   argThat(
     new EqualsVariableMap()
      .matcher("aVariable", EqualsUntypedValue.matcher().value("aStringValue"))
      .matcher("aSerializedVariable", EqualsObjectValue
                       .objectValueMatcher()
                       .serializedValue(jsonValue)
                       .serializationFormat("aFormat")
                       .objectTypeName("aRootType"))));
}
origin: camunda/camunda-bpm-platform

  .variable("var1", "val1")
  .variable("var2", "val2", "String")
  .variable("var3", ValueType.OBJECT.getName(), "val3", "aFormat", "aRootType")
  .getVariables();
parameters.put("localVariables", variables);
origin: camunda/camunda-bpm-platform

@SuppressWarnings("unchecked")
protected void verifySerializedValue(Map<String, Object> serializedValue) {
 ObjectValue exampleValue = MockProvider.EXAMPLE_HISTORIC_DECISION_SERIALIZED_VALUE;
 assertThat(serializedValue, hasEntry("type", (Object) VariableValueDto.toRestApiTypeName(exampleValue.getType().getName())));
 assertThat(serializedValue, hasEntry("value", exampleValue.getValue()));
 Map<String, String> valueInfo = (Map<String, String>) serializedValue.get("valueInfo");
 assertThat(valueInfo, hasEntry("serializationDataFormat", exampleValue.getSerializationDataFormat()));
 assertThat(valueInfo, hasEntry("objectTypeName", exampleValue.getObjectTypeName()));
}
origin: camunda/camunda-bpm-platform

  .variable("var1", "val1")
  .variable("var2", "val2", "String")
  .variable("var3", ValueType.OBJECT.getName(), "val3", "aFormat", "aRootType")
  .getVariables();
parameters.put("variables", variables);
origin: org.camunda.bpm/camunda-engine

@Test
@Deployment(resources={"org/camunda/bpm/engine/test/api/runtime/oneTaskProcess.bpmn20.xml"})
public void testGetValueOfSerializableVar() {
 // given
 List<String> serializable = new ArrayList<String>();
 serializable.add("one");
 serializable.add("two");
 serializable.add("three");
 Map<String, Object> variables = new HashMap<String, Object>();
 variables.put("serializableVar", serializable);
 ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("oneTaskProcess", variables);
 // when
 VariableInstanceQuery query = runtimeService.createVariableInstanceQuery().processInstanceIdIn(processInstance.getId());
 // then
 List<VariableInstance> result = query.list();
 assertFalse(result.isEmpty());
 assertEquals(1, result.size());
 VariableInstance instance = result.get(0);
 assertEquals("serializableVar", instance.getName());
 assertNotNull(instance.getValue());
 assertEquals(serializable, instance.getValue());
 assertEquals(ValueType.OBJECT.getName(), instance.getTypeName());
}
org.camunda.bpm.engine.variable.typeSerializableValueType

Most used methods

  • createValueFromSerialized
    Creates a new TypedValue using this type.
  • getName

Popular in Java

  • Reading from database using SQL prepared statement
  • getApplicationContext (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • scheduleAtFixedRate (Timer)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • JComboBox (javax.swing)
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now