01-27-2016 09:47 AM
public static String create (String processName, JSONObject inputData) {
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
// Get Activiti services
RuntimeService runtimeService = processEngine.getRuntimeService();
Map<String, Object> variables = new HashMap<String, Object>();
for (String key:inputData.getJSONObject("data").keySet()) {
System.out.println("Data Key:" + key);
variables.put(key, inputData.getJSONObject("data").get(key));
}
RepositoryService repositoryService = processEngine.getRepositoryService();
DeploymentQuery deploymentQuery = repositoryService.createDeploymentQuery();
deploymentQuery.processDefinitionKey(processName);
long deploymentCount = deploymentQuery.count();
Deployment testDeployment = deploymentQuery.singleResult();
log.info("Deployment ID = " + testDeployment.getId());
variables.put("startDate", new Date());
variables.put("employeeName", "Test Cloud Logic");
ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(processName, variables);
log.info("Process instance ID: " + processInstance.getId());
return "test";
}
01-28-2016 03:04 AM
01-28-2016 07:33 AM
01-28-2016 08:05 AM
01-28-2016 09:10 AM
01-29-2016 02:52 AM
org.activiti.engine.test.bpmn.usertask.InitiatorTest#testInitiator
in Activiti source. jUnit tests are the best way to describe the behaviour.Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.