Skip to Content
0

How to get all active as well as inactive process definition version IDs using BPM APIs

Oct 13, 2017 at 02:19 PM

23

avatar image
Former Member

Hi,

My scenario is to retrieve all the process for a particular definition, i.e. belonging to a particular BPM process definition. I am using the code snippet given below, but will be able to retrieve only the latest active process definition's processes.

ProcessDefinitionManager processDefinitionManager = BPMFactory

.getProcessDefinitionManager();

ProcessDefinition processDefinition = processDefinitionManager

.getActiveProcessDefinition(" "," ", " ");

ProcessInstanceManager processInstanceManager = BPMFactory.getProcessInstanceManager();

List<ProcessInstance> canceled = processInstanceManager

.getProcessInstances(null,

new ProcessInstanceFilterCriteria(

ProcessInstanceProperty.STATUS,

ProcessInstanceFilterOperator.EQUALS,

ProcessStatus.CANCELLED),

new ProcessInstanceFilterCriteria(

ProcessInstanceProperty.DEFINITION_ID,

ProcessInstanceFilterOperator.EQUALS,

processDefinition.getId()),

new ProcessInstanceFilterCriteria(

ProcessInstanceProperty.START_DATE,

ProcessInstanceFilterOperator.FROM, date

.getStartDate()),

new ProcessInstanceFilterCriteria(

ProcessInstanceProperty.START_DATE,

ProcessInstanceFilterOperator.TO, date

.getEndDate()));

My requirement is to retrieve both active and inactive process definitions.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers