Search in sources :

Example 6 with JsonValue

use of org.camunda.spin.plugin.variable.value.JsonValue in project camunda-bpm-platform by camunda.

the class JsonValueTest method testJsonValueInCondition.

@Deployment(resources = "org/camunda/spin/plugin/jsonConditionProcess.bpmn20.xml")
public void testJsonValueInCondition() {
    // given
    String jsonString = "{\"age\": 22 }";
    JsonValue value = jsonValue(jsonString).create();
    VariableMap variables = Variables.createVariables().putValueTyped("customer", value);
    // when
    runtimeService.startProcessInstanceByKey("process", variables);
    // then
    Task task = taskService.createTaskQuery().singleResult();
    assertEquals("task1", task.getTaskDefinitionKey());
}
Also used : Task(org.camunda.bpm.engine.task.Task) VariableMap(org.camunda.bpm.engine.variable.VariableMap) JsonValue(org.camunda.spin.plugin.variable.value.JsonValue) Deployment(org.camunda.bpm.engine.test.Deployment)

Aggregations

Deployment (org.camunda.bpm.engine.test.Deployment)6 JsonValue (org.camunda.spin.plugin.variable.value.JsonValue)6 VariableMap (org.camunda.bpm.engine.variable.VariableMap)4 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)2 SpinRuntimeException (org.camunda.spin.SpinRuntimeException)2 SpinJsonNode (org.camunda.spin.json.SpinJsonNode)2 VariableInstance (org.camunda.bpm.engine.runtime.VariableInstance)1 Task (org.camunda.bpm.engine.task.Task)1 JSONException (org.json.JSONException)1