Search in sources :

Example 1 with SimpleSerializableBean

use of org.camunda.bpm.engine.test.api.runtime.util.SimpleSerializableBean in project camunda-bpm-platform by camunda.

the class RuntimeServiceTest method testGetVariableInstancesFromVariableScope.

@Deployment
@Test
public void testGetVariableInstancesFromVariableScope() {
    VariableMap variables = createVariables().putValue("anIntegerVariable", 1234).putValue("anObjectValue", objectValue(new SimpleSerializableBean(10)).serializationDataFormat(Variables.SerializationDataFormats.JAVA)).putValue("anUntypedObjectValue", new SimpleSerializableBean(30));
    runtimeService.startProcessInstanceByKey("testProcess", variables);
// assertions are part of the java delegate AssertVariableInstancesDelegate
// only there we can access the VariableScope methods
}
Also used : VariableMap(org.camunda.bpm.engine.variable.VariableMap) SimpleSerializableBean(org.camunda.bpm.engine.test.api.runtime.util.SimpleSerializableBean) Test(org.junit.Test) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 2 with SimpleSerializableBean

use of org.camunda.bpm.engine.test.api.runtime.util.SimpleSerializableBean in project camunda-bpm-platform by camunda.

the class RuntimeServiceTest method testUpdateVariableInProcessWithoutWaitstate.

@Deployment
@Test
public void testUpdateVariableInProcessWithoutWaitstate() {
    // when a process instance is started
    runtimeService.startProcessInstanceByKey("oneScriptTaskProcess", Collections.<String, Object>singletonMap("var", new SimpleSerializableBean(10)));
    // then it should succeeds successfully
    ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().singleResult();
    assertNull(processInstance);
}
Also used : ProcessInstance(org.camunda.bpm.engine.runtime.ProcessInstance) SimpleSerializableBean(org.camunda.bpm.engine.test.api.runtime.util.SimpleSerializableBean) Test(org.junit.Test) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 3 with SimpleSerializableBean

use of org.camunda.bpm.engine.test.api.runtime.util.SimpleSerializableBean in project camunda-bpm-platform by camunda.

the class RuntimeServiceTest method testSetUpdateAndDeleteComplexVariable.

@Deployment
@Test
public void testSetUpdateAndDeleteComplexVariable() {
    // when a process instance is started
    runtimeService.startProcessInstanceByKey("oneUserTaskProcess", Collections.<String, Object>singletonMap("var", new SimpleSerializableBean(10)));
    // then it should wait at the user task
    ProcessInstance processInstance = runtimeService.createProcessInstanceQuery().singleResult();
    assertNotNull(processInstance);
}
Also used : ProcessInstance(org.camunda.bpm.engine.runtime.ProcessInstance) SimpleSerializableBean(org.camunda.bpm.engine.test.api.runtime.util.SimpleSerializableBean) Test(org.junit.Test) Deployment(org.camunda.bpm.engine.test.Deployment)

Aggregations

Deployment (org.camunda.bpm.engine.test.Deployment)3 SimpleSerializableBean (org.camunda.bpm.engine.test.api.runtime.util.SimpleSerializableBean)3 Test (org.junit.Test)3 ProcessInstance (org.camunda.bpm.engine.runtime.ProcessInstance)2 VariableMap (org.camunda.bpm.engine.variable.VariableMap)1