Skip to Content
avatar image
Former Member

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

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers