Search in sources :

Example 6 with ProcessInstance

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());
}
Also used : RouteBuilder(org.apache.camel.builder.RouteBuilder) ProcessInstance(org.activiti.engine.runtime.ProcessInstance) Deployment(org.activiti.engine.test.Deployment)

Example 7 with ProcessInstance

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());
}
Also used : RouteBuilder(org.apache.camel.builder.RouteBuilder) ProcessInstance(org.activiti.engine.runtime.ProcessInstance) Deployment(org.activiti.engine.test.Deployment)

Example 8 with ProcessInstance

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());
}
Also used : RouteBuilder(org.apache.camel.builder.RouteBuilder) ProcessInstance(org.activiti.engine.runtime.ProcessInstance) Deployment(org.activiti.engine.test.Deployment)

Example 9 with ProcessInstance

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;
}
Also used : ProcessInstance(org.activiti.engine.runtime.ProcessInstance)

Example 10 with ProcessInstance

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;
}
Also used : ProcessInstance(org.activiti.engine.runtime.ProcessInstance)

Aggregations

ProcessInstance (org.activiti.engine.runtime.ProcessInstance)822 Deployment (org.activiti.engine.test.Deployment)708 Task (org.activiti.engine.task.Task)374 HashMap (java.util.HashMap)242 HistoricProcessInstance (org.activiti.engine.history.HistoricProcessInstance)182 Execution (org.activiti.engine.runtime.Execution)76 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)64 CloseableHttpResponse (org.apache.http.client.methods.CloseableHttpResponse)57 Job (org.activiti.engine.runtime.Job)55 Date (java.util.Date)53 JsonNode (com.fasterxml.jackson.databind.JsonNode)49 Calendar (java.util.Calendar)48 ActivitiException (org.activiti.engine.ActivitiException)41 ArrayList (java.util.ArrayList)38 ProcessDefinition (org.activiti.engine.repository.ProcessDefinition)38 HttpGet (org.apache.http.client.methods.HttpGet)38 HistoricVariableInstance (org.activiti.engine.history.HistoricVariableInstance)27 StringEntity (org.apache.http.entity.StringEntity)27 HttpPost (org.apache.http.client.methods.HttpPost)25 HistoricActivityInstance (org.activiti.engine.history.HistoricActivityInstance)24