Search in sources :

Example 1 with CamelProcessItemImpl

use of org.talend.camel.core.model.camelProperties.impl.CamelProcessItemImpl in project tesb-studio-se by Talend.

the class RouteProcessConvertServiceImpl method getProcessFromItem.

@Override
public IProcess getProcessFromItem(Item item, boolean loadScreenshots) {
    if (item.eClass() == CamelPropertiesPackage.Literals.CAMEL_PROCESS_ITEM) {
        RouteProcess process = new RouteProcess(item.getProperty());
        if (item instanceof CamelProcessItemImpl) {
            CamelProcessItemImpl camelProcessItemImpl = (CamelProcessItemImpl) item;
            // FIXME: revisit the duplication of information between BUILD_TYPE and
            // camelProcessItemImpl.isExportMicroService(). It is synchronized here
            // as it gets out of sync with changes to BUILD_TYPE.
            String bt = (String) item.getProperty().getAdditionalProperties().get("BUILD_TYPE");
            boolean isMS;
            if (bt == null) {
                isMS = camelProcessItemImpl.isExportMicroService();
            } else {
                isMS = bt.indexOf("MICROSERVICE") >= 0;
                if (camelProcessItemImpl.isExportMicroService() != isMS) {
                    camelProcessItemImpl.setExportMicroService(isMS);
                }
            }
            if (isMS) {
                process = new MicroServiceProcess(item.getProperty());
            }
        }
        process.loadXmlFile(loadScreenshots);
        return process;
    }
    return null;
}
Also used : CamelProcessItemImpl(org.talend.camel.core.model.camelProperties.impl.CamelProcessItemImpl) RouteProcess(org.talend.camel.designer.ui.editor.RouteProcess) MicroServiceProcess(org.talend.camel.designer.ui.editor.MicroServiceProcess)

Aggregations

CamelProcessItemImpl (org.talend.camel.core.model.camelProperties.impl.CamelProcessItemImpl)1 MicroServiceProcess (org.talend.camel.designer.ui.editor.MicroServiceProcess)1 RouteProcess (org.talend.camel.designer.ui.editor.RouteProcess)1