Search in sources :

Example 1 with ModelEvaluatorServiceBase

use of org.kie.server.services.dmn.ModelEvaluatorServiceBase in project droolsjbpm-integration by kiegroup.

the class DMNRestApplicationComponentsService 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();
    }
    ModelEvaluatorServiceBase modelEvaluatorService = 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 (ModelEvaluatorServiceBase.class.isAssignableFrom(object.getClass())) {
            modelEvaluatorService = (ModelEvaluatorServiceBase) object;
            continue;
        } else if (KieServerRegistry.class.isAssignableFrom(object.getClass())) {
            context = (KieServerRegistry) object;
            continue;
        }
    }
    List<Object> components = new ArrayList<Object>(1);
    components.add(new ModelEvaluatorResource(modelEvaluatorService));
    return components;
}
Also used : KieServerRegistry(org.kie.server.services.api.KieServerRegistry) ArrayList(java.util.ArrayList) ModelEvaluatorServiceBase(org.kie.server.services.dmn.ModelEvaluatorServiceBase)

Aggregations

ArrayList (java.util.ArrayList)1 KieServerRegistry (org.kie.server.services.api.KieServerRegistry)1 ModelEvaluatorServiceBase (org.kie.server.services.dmn.ModelEvaluatorServiceBase)1