on 01-05-2016 5:25 PM
Hi,
We have a requirement where we need to generate report based on Statuses READY, IN_PROGRESS, RESERVED tasks.
I have below code, which is not giving the READY task.
TaskAbstractQueryCriteria c2 = new TaskAbstractStatusCriteria(Status.READY);
TaskAbstractQueryCriteria c3 = new TaskAbstractStatusCriteria(Status.RESERVED);
TaskAbstractQueryCriteria c4 = new TaskAbstractStatusCriteria(Status.IN_PROGRESS);
QueryResultParameters qrp = new QueryResultParameters();
qrp.setFirstResult(0);
List<TaskAbstract> lstTaskAbstract = taskInstanceManager.getTaskAbstractsByLogonID(usrKey, qrp, c2, c3, c4);
A task can be assigned to more than one person, how can getTaskAbstractsByLogonID() will behave when the task status is in READY.
If the above code gives READY tasks, my problem resolves.
Another approach...
Get all the running processes instance Ids and from there using taskInstanceManager.getTaskAbstractsByParent(processInstanceId, statuses) this, we can achieve.
But using the below code I am getting only the activeProcess.
ProcessDefinitionManager proDefManager = BPMFactory.getProcessDefinitionManager();
ProcessDefinition proDefinition = proDefManager.getActiveProcessDefinition("Vendor", "DC Name", "Process Name");
Collection<ProcessInstance> proInstCollection = proInstanceManager.getRunningProcessInstances(proDefinition.getId());
But I need all the running process, the way they show in NWA, irrespective of active or inactive(because of some changes process might have deployed, then previous process will become inactive) using api.
Any help is appreciated.
Thanks
I met the same requirement like your second approach,
what I did was: create a job which regularly check the current active process definition and store it in a customized db table if not stored before.
next time when you want to retrieve all the running process which requires process definition(active/inactive), you can get all process definition from your db table.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Jun,
Your idea sounds great.
I have found something in API, where I can get all the active and inactive process details between fromDate and toDate.
ProcessInstanceManager processInstanceManager = BPMFactory.getProcessInstanceManager(); |
List<ProcessInstance> lstProcessInstances = processInstanceManager.getProcessInstances(null, new ProcessInstanceFilterCriteria(
ProcessInstanceProperty.START_DATE, ProcessInstanceFilterOperator.FROM, fromDate), new ProcessInstanceFilterCriteria(
ProcessInstanceProperty.START_DATE, ProcessInstanceFilterOperator.TO, toDate), new ProcessInstanceFilterCriteria( | |
ProcessInstanceProperty.STATUS, ProcessInstanceFilterOperator.EQUALS, ProcessStatus.IN_PROGRESS)); |
Once I get the processInstanceId, using getTaskAbstractsByParent I am getting all the READY tasks.
Thanks
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.