Search in sources :

Example 26 with KieServerRegistry

use of org.kie.server.services.api.KieServerRegistry in project droolsjbpm-integration by kiegroup.

the class TaskAssigningRuntimeRestApplicationComponentsServiceTest method getAppComponents.

@Test
public void getAppComponents() {
    TaskAssigningRuntimeServiceBase serviceMock = mock(TaskAssigningRuntimeServiceBase.class);
    KieServerRegistry registryMock = mock(KieServerRegistry.class);
    TaskAssigningRuntimeRestApplicationComponentsService componentsService = new TaskAssigningRuntimeRestApplicationComponentsService();
    Collection<Object> result = componentsService.getAppComponents(TaskAssigningRuntimeKieServerExtension.EXTENSION_NAME, SupportedTransports.REST, serviceMock, registryMock);
    assertEquals(1, result.size());
    assertTrue(result.iterator().next() instanceof TaskAssigningRuntimeResource);
}
Also used : TaskAssigningRuntimeServiceBase(org.kie.server.services.taskassigning.runtime.TaskAssigningRuntimeServiceBase) KieServerRegistry(org.kie.server.services.api.KieServerRegistry) Test(org.junit.Test)

Example 27 with KieServerRegistry

use of org.kie.server.services.api.KieServerRegistry 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)

Example 28 with KieServerRegistry

use of org.kie.server.services.api.KieServerRegistry in project businessautomation-cop by redhat-cop.

the class CustomJbpmKieServerAppComponentService 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.debug("Creating custom kie server extension CustomJbpmKieServerAppComponentService");
    RuntimeDataService runtimeDataService = null;
    AdvanceRuntimeDataService advanceRuntimeDataService = null;
    KieServerRegistry context = null;
    for (Object object : services) {
        if (RuntimeDataService.class.isAssignableFrom(object.getClass())) {
            runtimeDataService = (RuntimeDataService) object;
            continue;
        } else if (AdvanceRuntimeDataService.class.isAssignableFrom(object.getClass())) {
            advanceRuntimeDataService = (AdvanceRuntimeDataService) object;
            continue;
        } else if (KieServerRegistry.class.isAssignableFrom(object.getClass())) {
            context = (KieServerRegistry) object;
            continue;
        }
    }
    List<Object> components = new ArrayList<Object>(1);
    if (SupportedTransports.REST.equals(type)) {
        RuntimeDataServiceBase runtimeDataServiceBase = new RuntimeDataServiceBase(runtimeDataService, advanceRuntimeDataService, context);
        components.add(new CustomResource(runtimeDataServiceBase, context));
    }
    return components;
}
Also used : AdvanceRuntimeDataService(org.jbpm.services.api.AdvanceRuntimeDataService) RuntimeDataService(org.jbpm.services.api.RuntimeDataService) AdvanceRuntimeDataService(org.jbpm.services.api.AdvanceRuntimeDataService) KieServerRegistry(org.kie.server.services.api.KieServerRegistry) RuntimeDataServiceBase(org.kie.server.services.jbpm.RuntimeDataServiceBase) ArrayList(java.util.ArrayList)

Aggregations

KieServerRegistry (org.kie.server.services.api.KieServerRegistry)28 Test (org.junit.Test)15 ArrayList (java.util.ArrayList)13 HashSet (java.util.HashSet)5 DefinitionService (org.jbpm.services.api.DefinitionService)4 RuntimeDataService (org.jbpm.services.api.RuntimeDataService)4 UserTaskService (org.jbpm.services.api.UserTaskService)4 ProcessInstanceQueryFilterSpecBuilder (org.kie.server.api.util.ProcessInstanceQueryFilterSpecBuilder)4 QueryFilterSpecBuilder (org.kie.server.api.util.QueryFilterSpecBuilder)4 TaskQueryFilterSpecBuilder (org.kie.server.api.util.TaskQueryFilterSpecBuilder)4 KieServerRegistryImpl (org.kie.server.services.impl.KieServerRegistryImpl)4 HashMap (java.util.HashMap)3 List (java.util.List)3 FormManagerService (org.jbpm.kie.services.impl.FormManagerService)3 ProcessService (org.jbpm.services.api.ProcessService)3 QueryService (org.jbpm.services.api.query.QueryService)3 Map (java.util.Map)2 Set (java.util.Set)2 Matcher (java.util.regex.Matcher)2 Pattern (java.util.regex.Pattern)2