Search in sources :

Example 1 with CaseInstance

use of org.kie.server.api.model.cases.CaseInstance in project droolsjbpm-integration by kiegroup.

the class CaseManagementRuntimeDataServiceBase method getCaseInstances.

public CaseInstanceList getCaseInstances(List<String> status, Integer page, Integer pageSize, String sort, boolean sortOrder, boolean withData) {
    List<CaseStatus> caseStatus = safeCaseStatus(status);
    sort = safeCaseInstanceSort(sort);
    Collection<org.jbpm.casemgmt.api.model.instance.CaseInstance> caseInstanceDescs = caseRuntimeDataService.getCaseInstances(caseStatus, withData, ConvertUtils.buildQueryContext(page, pageSize, sort, sortOrder));
    List<CaseInstance> caseInstances = ConvertUtils.transformCaseInstances(caseInstanceDescs);
    CaseInstanceList caseInstancesList = new CaseInstanceList(caseInstances);
    return caseInstancesList;
}
Also used : CaseInstanceList(org.kie.server.api.model.cases.CaseInstanceList) CaseInstance(org.kie.server.api.model.cases.CaseInstance) CaseStatus(org.jbpm.casemgmt.api.model.CaseStatus)

Example 2 with CaseInstance

use of org.kie.server.api.model.cases.CaseInstance in project droolsjbpm-integration by kiegroup.

the class CaseManagementRuntimeDataServiceBase method getCaseInstancesOwnedBy.

public CaseInstanceList getCaseInstancesOwnedBy(String owner, List<String> status, Integer page, Integer pageSize, String sort, boolean sortOrder, boolean withData) {
    List<CaseStatus> caseStatus = safeCaseStatus(status);
    owner = getUser(owner);
    sort = safeCaseInstanceSort(sort);
    Collection<org.jbpm.casemgmt.api.model.instance.CaseInstance> caseInstanceDescs = caseRuntimeDataService.getCaseInstancesOwnedBy(owner, caseStatus, withData, ConvertUtils.buildQueryContext(page, pageSize, sort, sortOrder));
    List<CaseInstance> caseInstances = ConvertUtils.transformCaseInstances(caseInstanceDescs);
    CaseInstanceList caseInstancesList = new CaseInstanceList(caseInstances);
    return caseInstancesList;
}
Also used : CaseInstanceList(org.kie.server.api.model.cases.CaseInstanceList) CaseInstance(org.kie.server.api.model.cases.CaseInstance) CaseStatus(org.jbpm.casemgmt.api.model.CaseStatus)

Example 3 with CaseInstance

use of org.kie.server.api.model.cases.CaseInstance in project droolsjbpm-integration by kiegroup.

the class CaseManagementRuntimeDataServiceBase method getCaseInstancesByCaseFileData.

public CaseInstanceList getCaseInstancesByCaseFileData(String dataItemName, String dataItemValue, List<String> status, Integer page, Integer pageSize, String sort, boolean sortOrder, boolean withData) {
    List<CaseStatus> caseStatus = safeCaseStatus(status);
    sort = safeCaseInstanceSort(sort);
    Collection<org.jbpm.casemgmt.api.model.instance.CaseInstance> caseInstanceDescs = null;
    if (dataItemValue != null && !dataItemValue.isEmpty()) {
        caseInstanceDescs = caseRuntimeDataService.getCaseInstancesByDataItemAndValue(dataItemName, dataItemValue, caseStatus, withData, ConvertUtils.buildQueryContext(page, pageSize, sort, sortOrder));
    } else {
        caseInstanceDescs = caseRuntimeDataService.getCaseInstancesByDataItem(dataItemName, caseStatus, withData, ConvertUtils.buildQueryContext(page, pageSize, sort, sortOrder));
    }
    List<CaseInstance> caseInstances = ConvertUtils.transformCaseInstances(caseInstanceDescs);
    CaseInstanceList caseInstancesList = new CaseInstanceList(caseInstances);
    return caseInstancesList;
}
Also used : CaseInstanceList(org.kie.server.api.model.cases.CaseInstanceList) CaseInstance(org.kie.server.api.model.cases.CaseInstance) CaseStatus(org.jbpm.casemgmt.api.model.CaseStatus)

Example 4 with CaseInstance

use of org.kie.server.api.model.cases.CaseInstance in project droolsjbpm-integration by kiegroup.

the class CaseManagementRuntimeDataServiceBase method getCaseInstancesByDefinition.

public CaseInstanceList getCaseInstancesByDefinition(String containerId, String caseDefinitionId, List<String> status, Integer page, Integer pageSize, String sort, boolean sortOrder, boolean withData) {
    List<CaseStatus> caseStatus = safeCaseStatus(status);
    sort = safeCaseInstanceSort(sort);
    Collection<org.jbpm.casemgmt.api.model.instance.CaseInstance> caseInstanceDescs = caseRuntimeDataService.getCaseInstancesByDefinition(caseDefinitionId, caseStatus, withData, ConvertUtils.buildQueryContext(page, pageSize, sort, sortOrder));
    List<CaseInstance> caseInstances = ConvertUtils.transformCaseInstances(caseInstanceDescs);
    CaseInstanceList caseInstancesList = new CaseInstanceList(caseInstances);
    return caseInstancesList;
}
Also used : CaseInstanceList(org.kie.server.api.model.cases.CaseInstanceList) CaseInstance(org.kie.server.api.model.cases.CaseInstance) CaseStatus(org.jbpm.casemgmt.api.model.CaseStatus)

Example 5 with CaseInstance

use of org.kie.server.api.model.cases.CaseInstance in project droolsjbpm-integration by kiegroup.

the class CaseManagementRuntimeDataServiceBase method getCaseInstancesByContainer.

public CaseInstanceList getCaseInstancesByContainer(String containerId, List<String> status, Integer page, Integer pageSize, String sort, boolean sortOrder, boolean withData) {
    List<CaseStatus> caseStatus = safeCaseStatus(status);
    sort = safeCaseInstanceSort(sort);
    Collection<org.jbpm.casemgmt.api.model.instance.CaseInstance> caseInstanceDescs = caseRuntimeDataService.getCaseInstancesByDeployment(containerId, caseStatus, withData, ConvertUtils.buildQueryContext(page, pageSize, sort, sortOrder));
    List<CaseInstance> caseInstances = ConvertUtils.transformCaseInstances(caseInstanceDescs);
    CaseInstanceList caseInstancesList = new CaseInstanceList(caseInstances);
    return caseInstancesList;
}
Also used : CaseInstanceList(org.kie.server.api.model.cases.CaseInstanceList) CaseInstance(org.kie.server.api.model.cases.CaseInstance) CaseStatus(org.jbpm.casemgmt.api.model.CaseStatus)

Aggregations

CaseInstance (org.kie.server.api.model.cases.CaseInstance)30 Test (org.junit.Test)17 JbpmKieServerBaseIntegrationTest (org.kie.server.integrationtests.jbpm.JbpmKieServerBaseIntegrationTest)17 CaseStatus (org.jbpm.casemgmt.api.model.CaseStatus)9 CaseInstanceList (org.kie.server.api.model.cases.CaseInstanceList)9 HashMap (java.util.HashMap)8 TaskSummary (org.kie.server.api.model.instance.TaskSummary)7 CaseFile (org.kie.server.api.model.cases.CaseFile)5 ArrayList (java.util.ArrayList)4 CaseRoleAssignment (org.kie.server.api.model.cases.CaseRoleAssignment)4 CaseStage (org.kie.server.api.model.cases.CaseStage)3 NodeInstance (org.kie.server.api.model.instance.NodeInstance)3 Arrays (java.util.Arrays)2 Collection (java.util.Collection)2 Collections (java.util.Collections)2 Iterator (java.util.Iterator)2 List (java.util.List)2 Map (java.util.Map)2 BiFunction (java.util.function.BiFunction)2 Function (java.util.function.Function)2