List<Deployment> dpls = dquery.list();
for(Deployment dpl : dpls)
{
DeploymentRef ref = ModelAdaptor.adoptDeployment(dpl);
// active processes
ProcessDefinitionQuery pdQuery = repositoryService.createProcessDefinitionQuery();
pdQuery.deploymentId(dpl.getId());
List<ProcessDefinition> activePds = pdQuery.list();
for(ProcessDefinition p : activePds)
{
ref.getDefinitions().add(p.getId());
}
// suspended processes
ProcessDefinitionQuery pdQuery2 = repositoryService.createProcessDefinitionQuery();
pdQuery2.deploymentId(dpl.getId());
pdQuery2.suspended();
List<ProcessDefinition> suspendedPds = pdQuery2.list();
for(ProcessDefinition p : suspendedPds)
{
ref.getDefinitions().add(p.getId());
}
results.add(ref);
}