How do I programatically track the progress of a workflow?
How can I query activiti to find out which task it is currently executing?
Currently this is how I execute a BPMN 2.0 workflow:
ProcessEngineConfiguration processEngineConfiguration =
StandaloneInMemProcessEngineConfiguration.createStandaloneInMemProcessEngineConfiguration();
try {
processEngineConfiguration.setClassLoader(Thread.currentThread().getContextClassLoader());
} finally {
}
ProcessEngine processEngine = processEngineConfiguration.buildProcessEngine();
RepositoryService repositoryService = processEngine.getRepositoryService();
RuntimeService runtimeService = processEngine.getRuntimeService();
try {
repositoryService.createDeployment()
.addInputStream("BPMN.xml", new FileInputStream("BPMN.xml"))
.deploy();
ProcessInstance proc = runtimeService.startProcessInstanceByKey(BPMNCreator.INSTANCE.getWorkflowProcessID());
if(proc!=null) {
JOptionPane.showMessageDialog(activeWindow, "Workflow Execution Complete.");
}
} catch (FileNotFoundException e1) {
_logger.log(Level.WARNING, "Batch Processing - Error Loading BPMN xml file", e1);
} finally {
ProcessEngines.destroy();
FileAndGUIUtils.setWaitCursor(activeWindow, false);
}