/** * DOC zli Comment method "loadProjectsettingsParameters". * * @param parameters */ public static void loadProjectsettingsParameters(ParametersType parameters) { IEditorReference[] reference = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getEditorReferences(); IDesignerCoreService designerCoreService = CorePlugin.getDefault().getDesignerCoreService(); designerCoreService.switchToCurJobSettingsView(); List<IProcess2> openedProcess = designerCoreService.getOpenedProcess(reference); for (IProcess2 process : openedProcess) { if (process instanceof Element) { Element processElem = (Element) process; ElementParameter2ParameterType.loadElementParameters(processElem, parameters, null); } process.setNeedRegenerateCode(true); } IProxyRepositoryFactory repositoryFactory = CorePlugin.getDefault().getProxyRepositoryFactory(); IProcess process = null; try { List<IRepositoryViewObject> all = repositoryFactory.getAll(ERepositoryObjectType.PROCESS); for (IRepositoryViewObject object : all) { if (!openedProcess.contains(object)) { Item item = object.getProperty().getItem(); if (item instanceof ProcessItem) { process = designerCoreService.getProcessFromProcessItem((ProcessItem) item); if (process != null && process instanceof IProcess2) { IProcess2 process2 = (IProcess2) process; if (process2 instanceof Element) { Element processElem = (Element) process2; ElementParameter2ParameterType.loadElementParameters(processElem, parameters, null); ProcessType processType = process2.saveXmlFile(); if (processType != null) { ((ProcessItem) item).setProcess(processType); } repositoryFactory.save(item); } } } } } } catch (Exception e) { e.printStackTrace(); } }
/** bqian Comment method "processNeedGenCode". */ private static void processNeedGenCode(IProcess process) { if (process instanceof IProcess2) { ((IProcess2) process).setNeedRegenerateCode(true); } }