use of org.camunda.bpm.engine.runtime.ProcessInstanceWithVariables in project camunda-bpm-platform by camunda.
the class ProcessInstantiationWithVariablesInReturnTest method testReturnVariablesFromExecution.
@Test
@Deployment(resources = SET_VARIABLE_IN_DELEGATE_PROCESS)
public void testReturnVariablesFromExecution() {
// given executed process which sets variables in java delegate
ProcessInstanceWithVariables procInstance = engineRule.getRuntimeService().createProcessInstanceByKey("variableProcess").executeWithVariablesInReturn();
// when returned instance contains variables
VariableMap map = procInstance.getVariables();
assertNotNull(map);
// then variables equal to variables which are accessible via query
checkVariables(map, 8);
}
use of org.camunda.bpm.engine.runtime.ProcessInstanceWithVariables in project camunda-bpm-platform by camunda.
the class ProcessInstantiationWithVariablesInReturnTest method testReturnVariablesFromStartWithWaitstateStartInSubProcess.
@Test
@Deployment(resources = SUBPROCESS_PROCESS)
public void testReturnVariablesFromStartWithWaitstateStartInSubProcess() {
// given execute process with variables and wait state in sub process
ProcessInstanceWithVariables procInstance = engineRule.getRuntimeService().createProcessInstanceByKey("subprocess").setVariable("aVariable1", "aValue1").setVariableLocal("aVariable2", "aValue2").setVariables(Variables.createVariables().putValue("aVariable3", "aValue3")).setVariablesLocal(Variables.createVariables().putValue("aVariable4", new byte[] { 127, 34, 64 })).startBeforeActivity("innerTask").executeWithVariablesInReturn(true, true);
// when returned instance contains variables
VariableMap map = procInstance.getVariables();
assertNotNull(map);
// then variables equal to variables which are accessible via query
checkVariables(map, 4);
}
use of org.camunda.bpm.engine.runtime.ProcessInstanceWithVariables in project camunda-bpm-platform by camunda.
the class ProcessInstantiationWithVariablesInReturnTest method testReturnVariablesFromStart.
@Test
@Deployment(resources = SIMPLE_PROCESS)
public void testReturnVariablesFromStart() {
// given execute process with variables
ProcessInstanceWithVariables procInstance = engineRule.getRuntimeService().createProcessInstanceByKey("simpleProcess").setVariable("aVariable1", "aValue1").setVariableLocal("aVariable2", "aValue2").setVariables(Variables.createVariables().putValue("aVariable3", "aValue3")).setVariablesLocal(Variables.createVariables().putValue("aVariable4", new byte[] { 127, 34, 64 })).executeWithVariablesInReturn(false, false);
// when returned instance contains variables
VariableMap map = procInstance.getVariables();
assertNotNull(map);
// then variables equal to variables which are accessible via query
checkVariables(map, 4);
}
use of org.camunda.bpm.engine.runtime.ProcessInstanceWithVariables in project camunda-bpm-platform by camunda.
the class ProcessInstantiationWithVariablesInReturnTest method testReturnVariablesFromExecutionWithWaitstate.
@Test
@Deployment(resources = SET_VARIABLE_IN_DELEGATE_WITH_WAIT_STATE_PROCESS)
public void testReturnVariablesFromExecutionWithWaitstate() {
// given executed process which sets variables in java delegate
ProcessInstanceWithVariables procInstance = engineRule.getRuntimeService().createProcessInstanceByKey("variableProcess").executeWithVariablesInReturn();
// when returned instance contains variables
VariableMap map = procInstance.getVariables();
assertNotNull(map);
// then variables equal to variables which are accessible via query
checkVariables(map, 8);
}
use of org.camunda.bpm.engine.runtime.ProcessInstanceWithVariables in project camunda-bpm-platform by camunda.
the class ProcessInstantiationWithVariablesInReturnTest method testReturnVariablesFromStartAndExecutionWithWaitstate.
@Test
@Deployment(resources = SET_VARIABLE_IN_DELEGATE_WITH_WAIT_STATE_PROCESS)
public void testReturnVariablesFromStartAndExecutionWithWaitstate() {
// given executed process which overwrites these four variables in java delegate
// and adds four additional variables
ProcessInstanceWithVariables procInstance = engineRule.getRuntimeService().createProcessInstanceByKey("variableProcess").setVariable("stringVar", "aValue1").setVariableLocal("integerVar", 56789).setVariables(Variables.createVariables().putValue("longVar", 123L)).setVariablesLocal(Variables.createVariables().putValue("byteVar", new byte[] { 127, 34, 64 })).executeWithVariablesInReturn(false, false);
// when returned instance contains variables
VariableMap map = procInstance.getVariables();
assertNotNull(map);
// then variables equal to variables which are accessible via query
checkVariables(map, 8);
}
Aggregations