Dtgov List processes. Audit information
virchete Jun 26, 2014 6:51 AMRelated jira issue:
https://issues.jboss.org/browse/DTGOV-117
We need to list all the active dtgov processes, displaying the current status and being able to stop the workflow process.
For obtaining the information firstly we tried to see the data that is stored in the ProcessInstanceDesc:
I took a look to the listProcessInstances method inside of the org.overlord.dtgov.jbpm.ProcessBean and this is the info we can take for every process that is running.
(org.jbpm.kie.services.impl.model.ProcessInstanceDesc) ProcessInstanceDesc{id=1, processId=overlord.demo.SimplifiedProjectLifeCycle, processName=Simplified ProjectLifeCycle Demo, processVersion=1, state=1, deploymentId=org.overlord.dtgovtgov-workflows:1.2.1-SNAPSHOT:SRAMPPackage:ksessionSRAMP, initiator=dummy, dataTimeStamp=2014-06-25 17:29:14.138}
We can take the processName and the state, that is a number. Is this enough for the development? I was expecting the status as a String.
Also for the development was required a stop process action. Taking a look to the ProcessEngineService class, it does not have a method like stopProcess, the only method that i have seen could accomplish this is the processEngineService.undeployUnit(KModuleDeploymentUnit unit);
This information is not enough.
The solution provided by Eric is to store the workflow data in another s-ramp artifact. Right now the workflow information is being stored in a custom property of the artifact being processed.
Then Gary proposed also to make an implementation that take in consideration auditing the information. But it is important that the audit information is not directly dependent with s-ramp.
To consider:
- Audit information --> Do we store the audit information in s-ramp as artifacts, one artifact by audit entry? Or maybe we could store this information in a dtgov table, having a reference to the uuid that they belong to?
- Current workflow information? I consider that we should remove the workflow custom property and create an artifact with this information. This artifact will include the current active workflow information. It would be derived of the artifact processed.
- How to stop the process --> I think this is the code to be used:
RuntimeManager runtimeManager = kieSrampUtil.getRuntimeManager(processEngineService, deploymentId);
RuntimeEngine runtime = runtimeManager.getRuntimeEngine(ProcessInstanceIdContext.get(processInstanceId));
KieSession ksession = runtime.getKieSession();
ksession.abortProcessInstance(processInstance);
I see this actions, as 2 separate functionalities, for two different pages:
- ListProcesses View. --> we see a table of all the processes,and also it will contain a stop button per process.
- ViewProcess View --> here we can see all the audit information and also will be capable of stopping the process.