AnsweredAssumed Answered

How to track the progress of a workflow

Question asked by afshad on Apr 4, 2012
Latest reply on Apr 13, 2012 by afshad
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);
        }

Outcomes