Search in sources :

Example 1 with CaseManagementServiceBase

use of org.kie.server.services.casemgmt.CaseManagementServiceBase in project droolsjbpm-integration by kiegroup.

the class CaseRestApplicationComponentsService method getAppComponents.

@Override
public Collection<Object> getAppComponents(String extension, SupportedTransports type, Object... services) {
    // skip calls from other than owning extension
    if (!OWNER_EXTENSION.equals(extension)) {
        return Collections.emptyList();
    }
    CaseManagementServiceBase caseManagementServiceBase = null;
    CaseManagementRuntimeDataServiceBase caseManagementRuntimeDataServiceBase = null;
    CaseAdminServiceBase caseAdminServiceBase = null;
    KieServerRegistry context = null;
    for (Object object : services) {
        // in case given service is null (meaning was not configured) continue with next one
        if (object == null) {
            continue;
        }
        if (CaseManagementServiceBase.class.isAssignableFrom(object.getClass())) {
            caseManagementServiceBase = (CaseManagementServiceBase) object;
            continue;
        } else if (CaseManagementRuntimeDataServiceBase.class.isAssignableFrom(object.getClass())) {
            caseManagementRuntimeDataServiceBase = (CaseManagementRuntimeDataServiceBase) object;
            continue;
        } else if (CaseAdminServiceBase.class.isAssignableFrom(object.getClass())) {
            caseAdminServiceBase = (CaseAdminServiceBase) object;
            continue;
        } else if (KieServerRegistry.class.isAssignableFrom(object.getClass())) {
            context = (KieServerRegistry) object;
            continue;
        }
    }
    List<Object> components = new ArrayList<Object>();
    components.add(new CaseResource(caseManagementServiceBase, caseManagementRuntimeDataServiceBase, context));
    components.add(new CaseQueryResource(caseManagementRuntimeDataServiceBase, context));
    components.add(new CaseAdminResource(caseManagementRuntimeDataServiceBase, caseAdminServiceBase, context));
    return components;
}
Also used : KieServerRegistry(org.kie.server.services.api.KieServerRegistry) CaseManagementRuntimeDataServiceBase(org.kie.server.services.casemgmt.CaseManagementRuntimeDataServiceBase) CaseManagementServiceBase(org.kie.server.services.casemgmt.CaseManagementServiceBase) ArrayList(java.util.ArrayList) CaseAdminServiceBase(org.kie.server.services.casemgmt.CaseAdminServiceBase)

Example 2 with CaseManagementServiceBase

use of org.kie.server.services.casemgmt.CaseManagementServiceBase in project droolsjbpm-integration by kiegroup.

the class SpringBootCaseKieServerExtension method configureServices.

@Override
protected void configureServices(KieServerImpl kieServer, KieServerRegistry registry) {
    this.caseManagementServiceBase = new CaseManagementServiceBase(caseService, caseRuntimeDataService, registry);
    this.caseManagementRuntimeDataService = new CaseManagementRuntimeDataServiceBase(caseRuntimeDataService, advanceCaseRuntimeDataService, registry);
    this.caseAdminServiceBase = new CaseAdminServiceBase(caseInstanceMigrationService, registry);
}
Also used : CaseManagementRuntimeDataServiceBase(org.kie.server.services.casemgmt.CaseManagementRuntimeDataServiceBase) CaseManagementServiceBase(org.kie.server.services.casemgmt.CaseManagementServiceBase) CaseAdminServiceBase(org.kie.server.services.casemgmt.CaseAdminServiceBase)

Example 3 with CaseManagementServiceBase

use of org.kie.server.services.casemgmt.CaseManagementServiceBase in project businessautomation-cop by redhat-cop.

the class CustomCaseMgmtKieServerAppComponentService method getAppComponents.

public Collection<Object> getAppComponents(String extension, SupportedTransports type, Object... services) {
    // skip calls from other than owning extension
    if (!OWNER_EXTENSION.equals(extension)) {
        return Collections.emptyList();
    }
    logger.info("Creating custom kie server extension CustomCaseMgmtKieServerAppComponentService");
    KieServerRegistry registry = null;
    CaseManagementServiceBase caseManagementServiceBase = null;
    CaseManagementRuntimeDataServiceBase caseManagementRuntimeDataService = null;
    for (Object object : services) {
        if (CaseManagementServiceBase.class.isAssignableFrom(object.getClass())) {
            caseManagementServiceBase = (CaseManagementServiceBase) object;
            continue;
        } else if (KieServerRegistry.class.isAssignableFrom(object.getClass())) {
            registry = (KieServerRegistry) object;
            continue;
        } else if (CaseManagementRuntimeDataServiceBase.class.isAssignableFrom(object.getClass())) {
            caseManagementRuntimeDataService = (CaseManagementRuntimeDataServiceBase) object;
        }
    }
    List<Object> components = new ArrayList<Object>(1);
    if (SupportedTransports.REST.equals(type)) {
        components.add(new GetCasesWithDataResource(caseManagementServiceBase, caseManagementRuntimeDataService, registry));
    }
    return components;
}
Also used : KieServerRegistry(org.kie.server.services.api.KieServerRegistry) CaseManagementRuntimeDataServiceBase(org.kie.server.services.casemgmt.CaseManagementRuntimeDataServiceBase) CaseManagementServiceBase(org.kie.server.services.casemgmt.CaseManagementServiceBase) ArrayList(java.util.ArrayList)

Aggregations

CaseManagementRuntimeDataServiceBase (org.kie.server.services.casemgmt.CaseManagementRuntimeDataServiceBase)3 CaseManagementServiceBase (org.kie.server.services.casemgmt.CaseManagementServiceBase)3 ArrayList (java.util.ArrayList)2 KieServerRegistry (org.kie.server.services.api.KieServerRegistry)2 CaseAdminServiceBase (org.kie.server.services.casemgmt.CaseAdminServiceBase)2