use of org.activiti.engine.runtime.ProcessInstance in project Activiti by Activiti.
the class ErrorMapExceptionTest method testCamelParentMap.
@Deployment(resources = { "process/mapExceptionParentMap.bpmn20.xml" })
public void testCamelParentMap() throws Exception {
camelContext.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
from("activiti:mapExceptionParentProcess:exceptionRoute").throwException(new MapExceptionChild("test exception"));
}
});
FlagJavaDelegate.reset();
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("mapExceptionParentProcess");
assertTrue(FlagJavaDelegate.isFlagSet());
}
use of org.activiti.engine.runtime.ProcessInstance in project Activiti by Activiti.
the class ErrorMapExceptionTest method testCamelDefaultMap.
@Deployment(resources = { "process/mapExceptionDefaultMap.bpmn20.xml" })
public void testCamelDefaultMap() throws Exception {
camelContext.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
from("activiti:mapExceptionDefaultProcess:exceptionRoute").throwException(new NullPointerException("test exception"));
}
});
FlagJavaDelegate.reset();
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("mapExceptionDefaultProcess");
assertTrue(FlagJavaDelegate.isFlagSet());
}
use of org.activiti.engine.runtime.ProcessInstance in project Activiti by Activiti.
the class ErrorMapExceptionTest method testCamelSingleDirectMap.
@Deployment(resources = { "process/mapExceptionSingleMap.bpmn20.xml" })
public void testCamelSingleDirectMap() throws Exception {
camelContext.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
from("activiti:mapExceptionProcess:exceptionRoute").throwException(new MapExceptionParent("test exception"));
}
});
FlagJavaDelegate.reset();
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("mapExceptionProcess");
assertTrue(FlagJavaDelegate.isFlagSet());
}
use of org.activiti.engine.runtime.ProcessInstance in project Activiti by Activiti.
the class BusinessProcess method startProcessByKey.
public ProcessInstance startProcessByKey(String key, String businessKey, Map<String, Object> variables) {
validateValidUsage();
Map<String, Object> cachedVariables = getAndClearCachedVariables();
cachedVariables.putAll(variables);
ProcessInstance instance = processEngine.getRuntimeService().startProcessInstanceByKey(key, businessKey, cachedVariables);
if (!instance.isEnded()) {
setExecution(instance);
}
return instance;
}
use of org.activiti.engine.runtime.ProcessInstance in project Activiti by Activiti.
the class BusinessProcess method startProcessByMessage.
public ProcessInstance startProcessByMessage(String messageName, Map<String, Object> processVariables) {
validateValidUsage();
Map<String, Object> cachedVariables = getAndClearCachedVariables();
cachedVariables.putAll(processVariables);
ProcessInstance processInstance = processEngine.getRuntimeService().startProcessInstanceByMessage(messageName, cachedVariables);
if (!processInstance.isEnded()) {
setExecution(processInstance);
}
return processInstance;
}
Aggregations