Search in sources :

Example 1 with FormServiceBase

use of org.kie.server.services.jbpm.ui.FormServiceBase in project droolsjbpm-integration by kiegroup.

the class JbpmUIRestApplicationComponentsService 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();
    }
    FormServiceBase formServiceBase = null;
    ImageServiceBase imageServiceBase = null;
    FormRendererBase formRendererBase = 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 (FormServiceBase.class.isAssignableFrom(object.getClass())) {
            formServiceBase = (FormServiceBase) object;
            continue;
        } else if (ImageServiceBase.class.isAssignableFrom(object.getClass())) {
            imageServiceBase = (ImageServiceBase) object;
            continue;
        } else if (FormRendererBase.class.isAssignableFrom(object.getClass())) {
            formRendererBase = (FormRendererBase) object;
            continue;
        } else if (KieServerRegistry.class.isAssignableFrom(object.getClass())) {
            context = (KieServerRegistry) object;
            continue;
        }
    }
    List<Object> components = new ArrayList<Object>(2);
    components.add(new FormResource(formServiceBase, formRendererBase, context));
    components.add(new ImageResource(imageServiceBase, context));
    components.add(new StaticFilesResource(formRendererBase));
    return components;
}
Also used : FormRendererBase(org.kie.server.services.jbpm.ui.FormRendererBase) FormServiceBase(org.kie.server.services.jbpm.ui.FormServiceBase) KieServerRegistry(org.kie.server.services.api.KieServerRegistry) ImageServiceBase(org.kie.server.services.jbpm.ui.ImageServiceBase) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 KieServerRegistry (org.kie.server.services.api.KieServerRegistry)1 FormRendererBase (org.kie.server.services.jbpm.ui.FormRendererBase)1 FormServiceBase (org.kie.server.services.jbpm.ui.FormServiceBase)1 ImageServiceBase (org.kie.server.services.jbpm.ui.ImageServiceBase)1