private Resource[] parseContextResources(List<BeanImportModel> beanImports) { if (beanImports != null && !beanImports.isEmpty()) { Resource flowResource = flowModelHolder.getFlowModelResource(); List<Resource> resources = new ArrayList<>(beanImports.size()); for (BeanImportModel beanImport : getFlowModel().getBeanImports()) { try { resources.add(flowResource.createRelative(beanImport.getResource())); } catch (IOException e) { throw new FlowBuilderException("Could not access flow-relative artifact resource '" + beanImport.getResource() + "'", e); } } return resources.toArray(new Resource[resources.size()]); } else { return new Resource[0]; } }
private void initLocalFlowContext() { Resource[] contextResources = parseContextResources(getFlowModel().getBeanImports()); GenericApplicationContext flowContext = createFlowApplicationContext(contextResources); setLocalContext(new LocalFlowBuilderContext(getContext(), flowContext)); }
public void merge(Model model) { FlowModel flow = (FlowModel) model; setParent(null); setStartStateId(merge(getStartStateId(), flow.getStartStateId())); setAttributes(merge(getAttributes(), flow.getAttributes())); setSecured((SecuredModel) merge(getSecured(), flow.getSecured())); setPersistenceContext((PersistenceContextModel) merge(getPersistenceContext(), flow.getPersistenceContext())); setVars(merge(getVars(), flow.getVars(), false)); setInputs(merge(getInputs(), flow.getInputs())); setOutputs(merge(getOutputs(), flow.getOutputs())); setOnStartActions(merge(getOnStartActions(), flow.getOnStartActions(), false)); setStates(merge(getStates(), flow.getStates())); setGlobalTransitions(merge(getGlobalTransitions(), flow.getGlobalTransitions())); setOnEndActions(merge(getOnEndActions(), flow.getOnEndActions(), false)); setExceptionHandlers(merge(getExceptionHandlers(), flow.getExceptionHandlers())); setBeanImports(merge(getBeanImports(), flow.getBeanImports())); }
private Resource[] parseContextResources(List beanImports) { if (beanImports != null && !beanImports.isEmpty()) { Resource flowResource = flowModelHolder.getFlowModelResource(); List resources = new ArrayList(beanImports.size()); for (Iterator it = getFlowModel().getBeanImports().iterator(); it.hasNext();) { BeanImportModel beanImport = (BeanImportModel) it.next(); try { resources.add(flowResource.createRelative(beanImport.getResource())); } catch (IOException e) { throw new FlowBuilderException("Could not access flow-relative artifact resource '" + beanImport.getResource() + "'", e); } } return (Resource[]) resources.toArray(new Resource[resources.size()]); } else { return new Resource[0]; } }
private Resource[] parseContextResources(List<BeanImportModel> beanImports) { if (beanImports != null && !beanImports.isEmpty()) { Resource flowResource = flowModelHolder.getFlowModelResource(); List<Resource> resources = new ArrayList<>(beanImports.size()); for (BeanImportModel beanImport : getFlowModel().getBeanImports()) { try { resources.add(flowResource.createRelative(beanImport.getResource())); } catch (IOException e) { throw new FlowBuilderException("Could not access flow-relative artifact resource '" + beanImport.getResource() + "'", e); } } return resources.toArray(new Resource[resources.size()]); } else { return new Resource[0]; } }
private void initLocalFlowContext() { Resource[] contextResources = parseContextResources(getFlowModel().getBeanImports()); GenericApplicationContext flowContext = createFlowApplicationContext(contextResources); setLocalContext(new LocalFlowBuilderContext(getContext(), flowContext)); }
private void initLocalFlowContext() { Resource[] contextResources = parseContextResources(getFlowModel().getBeanImports()); GenericApplicationContext flowContext = createFlowApplicationContext(contextResources); setLocalContext(new LocalFlowBuilderContext(getContext(), flowContext)); }
public void testMergeBeanImports() { FlowModel child = new FlowModel(); child.setBeanImports(asList(new BeanImportModel("path1"), new BeanImportModel("path2"))); FlowModel parent = new FlowModel(); parent.setBeanImports(asList(new BeanImportModel("path1"), new BeanImportModel("path2"))); child.merge(parent); assertEquals(4, child.getBeanImports().size()); }
public void merge(Model model) { FlowModel flow = (FlowModel) model; setParent(null); setStartStateId(merge(getStartStateId(), flow.getStartStateId())); setAttributes(merge(getAttributes(), flow.getAttributes())); setSecured((SecuredModel) merge(getSecured(), flow.getSecured())); setPersistenceContext((PersistenceContextModel) merge(getPersistenceContext(), flow.getPersistenceContext())); setVars(merge(getVars(), flow.getVars(), false)); setInputs(merge(getInputs(), flow.getInputs())); setOutputs(merge(getOutputs(), flow.getOutputs())); setOnStartActions(merge(getOnStartActions(), flow.getOnStartActions(), false)); setStates(merge(getStates(), flow.getStates())); setGlobalTransitions(merge(getGlobalTransitions(), flow.getGlobalTransitions())); setOnEndActions(merge(getOnEndActions(), flow.getOnEndActions(), false)); setExceptionHandlers(merge(getExceptionHandlers(), flow.getExceptionHandlers())); setBeanImports(merge(getBeanImports(), flow.getBeanImports())); }
public void merge(Model model) { FlowModel flow = (FlowModel) model; setParent(null); setStartStateId(merge(getStartStateId(), flow.getStartStateId())); setAttributes(merge(getAttributes(), flow.getAttributes())); setSecured((SecuredModel) merge(getSecured(), flow.getSecured())); setPersistenceContext((PersistenceContextModel) merge(getPersistenceContext(), flow.getPersistenceContext())); setVars(merge(getVars(), flow.getVars(), false)); setInputs(merge(getInputs(), flow.getInputs())); setOutputs(merge(getOutputs(), flow.getOutputs())); setOnStartActions(merge(getOnStartActions(), flow.getOnStartActions(), false)); setStates(merge(getStates(), flow.getStates())); setGlobalTransitions(merge(getGlobalTransitions(), flow.getGlobalTransitions())); setOnEndActions(merge(getOnEndActions(), flow.getOnEndActions(), false)); setExceptionHandlers(merge(getExceptionHandlers(), flow.getExceptionHandlers())); setBeanImports(merge(getBeanImports(), flow.getBeanImports())); }