use of org.kie.server.api.model.instance.ProcessInstanceList in project droolsjbpm-integration by kiegroup.
the class RuntimeDataServiceBase method getProcessInstancesByDeploymentId.
public ProcessInstanceList getProcessInstancesByDeploymentId(String containerId, List<Integer> status, Integer page, Integer pageSize, String sort, boolean sortOrder) {
if (sort == null || sort.isEmpty()) {
sort = "ProcessInstanceId";
}
if (status == null || status.isEmpty()) {
status = new ArrayList<Integer>();
status.add(ProcessInstance.STATE_ACTIVE);
}
logger.debug("About to search for process instance belonging to container '{}' with page {} and page size {}", containerId, page, pageSize);
Collection<ProcessInstanceDesc> instances = runtimeDataService.getProcessInstancesByDeploymentId(containerId, status, buildQueryContext(page, pageSize, sort, sortOrder));
logger.debug("Found {} process instance for container '{}', statuses '{}'", instances.size(), containerId, status);
ProcessInstanceList processInstanceList = convertToProcessInstanceList(instances);
logger.debug("Returning result of process instance search: {}", processInstanceList);
return processInstanceList;
}
use of org.kie.server.api.model.instance.ProcessInstanceList in project droolsjbpm-integration by kiegroup.
the class RuntimeDataServiceBase method getProcessInstances.
public ProcessInstanceList getProcessInstances(List<Integer> status, String initiator, String processName, Integer page, Integer pageSize, String sort, boolean sortOrder) {
if (sort == null || sort.isEmpty()) {
sort = "ProcessInstanceId";
}
if (status == null || status.isEmpty()) {
status = new ArrayList<Integer>();
status.add(ProcessInstance.STATE_ACTIVE);
}
Collection<ProcessInstanceDesc> instances = null;
if (processName != null && !processName.isEmpty()) {
logger.debug("About to search for process instances with process name '{}' with page {} and page size {}", processName, page, pageSize);
instances = runtimeDataService.getProcessInstancesByProcessName(status, processName, nullEmpty(initiator), buildQueryContext(page, pageSize, sort, sortOrder));
logger.debug("Found {} process instances for process name '{}', statuses '{}'", instances.size(), processName, status);
} else {
logger.debug("About to search for process instances with page {} and page size {}", page, pageSize);
instances = runtimeDataService.getProcessInstances(status, nullEmpty(initiator), buildQueryContext(page, pageSize, sort, sortOrder));
logger.debug("Found {} process instances , statuses '{}'", instances.size(), status);
}
ProcessInstanceList processInstanceList = convertToProcessInstanceList(instances);
logger.debug("Returning result of process instance search: {}", processInstanceList);
return processInstanceList;
}
use of org.kie.server.api.model.instance.ProcessInstanceList in project droolsjbpm-integration by kiegroup.
the class JmsResponseHandlerIntegrationTest method testGetProcessInstancesUseOfAsyncResponseHandlerWithMarshaller.
@Test
public void testGetProcessInstancesUseOfAsyncResponseHandlerWithMarshaller() throws Exception {
ResponseCallback callback = new BlockingResponseCallback(createMarshaller());
testGetProcessInstancesResponseHandler(new AsyncResponseHandler(callback));
// now let's check if response has arrived
ProcessInstanceList processInstanceList = callback.get(ProcessInstanceList.class);
assertThat(processInstanceList).isNotNull();
assertThat(processInstanceList.getItems()).isNotNull().hasSize(1);
}
use of org.kie.server.api.model.instance.ProcessInstanceList in project droolsjbpm-integration by kiegroup.
the class ProcessServiceBase method getProcessInstancesByParent.
public ProcessInstanceList getProcessInstancesByParent(long parentProcessInstanceId, List<Integer> status, Integer page, Integer pageSize, String sort, boolean sortOrder) {
if (sort == null || sort.isEmpty()) {
sort = "ProcessInstanceId";
}
if (status == null || status.isEmpty()) {
status = new ArrayList<Integer>();
status.add(ProcessInstance.STATE_ACTIVE);
}
Collection<ProcessInstanceDesc> instances = runtimeDataService.getProcessInstancesByParent(parentProcessInstanceId, status, buildQueryContext(page, pageSize, sort, sortOrder));
logger.debug("Found {} process instances , statuses '{}'", instances.size(), status);
ProcessInstanceList processInstanceList = convertToProcessInstanceList(instances);
logger.debug("Returning result of process instance search: {}", processInstanceList);
return processInstanceList;
}
use of org.kie.server.api.model.instance.ProcessInstanceList in project droolsjbpm-integration by kiegroup.
the class RuntimeDataServiceBase method getProcessInstancesByProcessId.
public ProcessInstanceList getProcessInstancesByProcessId(String processId, List<Integer> status, String initiator, Integer page, Integer pageSize, String sort, boolean sortOrder) {
if (sort == null || sort.isEmpty()) {
sort = "ProcessInstanceId";
}
if (status == null || status.isEmpty()) {
status = new ArrayList<Integer>();
status.add(ProcessInstance.STATE_ACTIVE);
}
logger.debug("About to search for process instances with process id '{}' with page {} and page size {}", processId, page, pageSize);
Collection<ProcessInstanceDesc> instances = runtimeDataService.getProcessInstancesByProcessId(status, processId, nullEmpty(initiator), buildQueryContext(page, pageSize, sort, sortOrder));
logger.debug("Found {} process instance for process id '{}', statuses '{}'", instances.size(), processId, status);
ProcessInstanceList processInstanceList = convertToProcessInstanceList(instances);
logger.debug("Returning result of process instance search: {}", processInstanceList);
return processInstanceList;
}
Aggregations