use of org.camunda.bpm.engine.runtime.ProcessInstance in project camunda-bpm-platform by camunda.
the class ConnectProcessEnginePluginTest method testIntermediateMessageThrowEventWithConnector.
@Deployment
public void testIntermediateMessageThrowEventWithConnector() {
String outputParamValue = "someMessageThrowOutputValue";
String inputVariableValue = "someMessageThrowInputVariableValue";
TestConnector.responseParameters.put("someOutputParameter", outputParamValue);
Map<String, Object> vars = new HashMap<String, Object>();
vars.put("someInputVariable", inputVariableValue);
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("process_sending_with_connector", vars);
// validate input parameter
assertNotNull(TestConnector.requestParameters.get("reqParam1"));
assertEquals(inputVariableValue, TestConnector.requestParameters.get("reqParam1"));
// validate connector output
VariableInstance variable = runtimeService.createVariableInstanceQuery().variableName("out1").singleResult();
assertNotNull(variable);
assertEquals(outputParamValue, variable.getValue());
}
use of org.camunda.bpm.engine.runtime.ProcessInstance in project camunda-bpm-platform by camunda.
the class ConnectProcessEnginePluginTest method testMessageEndEventWithConnector.
@Deployment
public void testMessageEndEventWithConnector() {
String outputParamValue = "someMessageEndOutputValue";
String inputVariableValue = "someMessageEndInputVariableValue";
TestConnector.responseParameters.put("someOutputParameter", outputParamValue);
Map<String, Object> vars = new HashMap<String, Object>();
vars.put("someInputVariable", inputVariableValue);
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("process_sending_with_connector", vars);
assertProcessEnded(processInstance.getId());
// validate input parameter
assertNotNull(TestConnector.requestParameters.get("reqParam1"));
assertEquals(inputVariableValue, TestConnector.requestParameters.get("reqParam1"));
// validate connector output
HistoricVariableInstance variable = historyService.createHistoricVariableInstanceQuery().variableName("out1").singleResult();
assertNotNull(variable);
assertEquals(outputParamValue, variable.getValue());
}
use of org.camunda.bpm.engine.runtime.ProcessInstance in project camunda-bpm-platform by camunda.
the class BusinessProcess method startProcessByKey.
public ProcessInstance startProcessByKey(String key, String businessKey, Map<String, Object> variables) {
assertCommandContextNotActive();
VariableMap cachedVariables = getAndClearCachedVariableMap();
cachedVariables.putAll(variables);
ProcessInstance instance = processEngine.getRuntimeService().startProcessInstanceByKey(key, businessKey, cachedVariables);
if (!instance.isEnded()) {
setExecution(instance);
}
return instance;
}
use of org.camunda.bpm.engine.runtime.ProcessInstance in project camunda-bpm-platform by camunda.
the class BusinessProcess method startProcessByMessage.
public ProcessInstance startProcessByMessage(String messageName, Map<String, Object> processVariables) {
assertCommandContextNotActive();
VariableMap cachedVariables = getAndClearCachedVariableMap();
cachedVariables.putAll(processVariables);
ProcessInstance instance = processEngine.getRuntimeService().startProcessInstanceByMessage(messageName, cachedVariables);
if (!instance.isEnded()) {
setExecution(instance);
}
return instance;
}
use of org.camunda.bpm.engine.runtime.ProcessInstance in project camunda-bpm-platform by camunda.
the class BusinessProcess method startProcessByKey.
public ProcessInstance startProcessByKey(String key) {
assertCommandContextNotActive();
ProcessInstance instance = processEngine.getRuntimeService().startProcessInstanceByKey(key, getAndClearCachedVariableMap());
if (!instance.isEnded()) {
setExecution(instance);
}
return instance;
}
Aggregations