public void addModel(Object resolved, ProcessorContext context) { BPELProcessDefinition process = (BPELProcessDefinition)resolved; map.put(process.getName(), process); }
public String getReferencePartnerlinkName(String referenceName) { if( referenceName == null ) return null; // Find the partnerLink which has its SCAName set to the supplied name List<BPELPartnerLinkElement> partnerLinks = processDefinition.getPartnerLinks(); for( BPELPartnerLinkElement partnerLink : partnerLinks ) { if( referenceName.equals(partnerLink.getSCAName()) ) { return partnerLink.getName(); } // end if } // end for return null; } // end method getReferencePartnerlinkName
public void resolve(BPELProcessDefinition model, ModelResolver resolver, ProcessorContext context) throws ContributionResolveException { // Delegate resolving to model resolver if (model != null || model.isUnresolved()) { resolver.resolveModel(BPELProcessDefinition.class, model, context); } } // end resolve
private BPELProcessDefinition resolveBPELProcessDefinition(BPELImplementation impl, ModelResolver resolver, ProcessorContext context) throws ContributionResolveException { QName processName = impl.getProcess(); BPELProcessDefinition processDefinition = this.bpelFactory.createBPELProcessDefinition(); processDefinition.setName(processName); processDefinition.setUnresolved(true); return resolver.resolveModel(BPELProcessDefinition.class, processDefinition, context); } // end resolveBPELProcessDefinition
processDefinition.setUnresolved(true); processDefinition.setLocation(doc.toString()); if (BPELProcessorConstants.PROCESS_ELEMENT.equals(qname) || BPELProcessorConstants.PROCESS_ELEMENT_20.equals(qname)) { QName processName = new QName(getString(reader, BPELProcessorConstants.TARGET_NAMESPACE), getString(reader, BPELProcessorConstants.NAME_ELEMENT)); processDefinition.setName(processName); } else if (BPELProcessorConstants.PARTNERLINK_ELEMENT.equals(qname) || BPELProcessorConstants.PARTNERLINK_ELEMENT_20.equals(qname)) { processDefinition.getPartnerLinks().add(processPartnerLinkElement(reader, monitor)); } else if (BPELProcessorConstants.ONEVENT_ELEMENT.equals(qname) || BPELProcessorConstants.RECEIVE_ELEMENT.equals(qname) || BPELProcessorConstants.ONMESSAGE_ELEMENT.equals(qname) || BPELProcessorConstants.ONEVENT_ELEMENT_20.equals(qname) || BPELProcessorConstants.RECEIVE_ELEMENT_20.equals(qname) || BPELProcessorConstants.ONMESSAGE_ELEMENT_20.equals(qname)) { processPartnerLinkAsService(reader.getAttributeValue(null, "partnerLink"), processDefinition.getPartnerLinks(), monitor); } else if (BPELProcessorConstants.INVOKE_ELEMENT.equals(qname) || BPELProcessorConstants.INVOKE_ELEMENT_20.equals(qname)) { processPartnerLinkAsReference(reader.getAttributeValue(null, "partnerLink"), processDefinition.getPartnerLinks(), monitor); } else if (BPELProcessorConstants.IMPORT_ELEMENT.equals(qname) || BPELProcessorConstants.IMPORT_ELEMENT_20.equals(qname)) { processDefinition.getImports().add(processImportElement(reader)); } else if (BPELProcessorConstants.VARIABLE_ELEMENT.equals(qname) || BPELProcessorConstants.VARIABLE_ELEMENT_20.equals(qname)) { processDefinition.getProperties().add( aProperty );
List<BPELImportElement> theImports = unresolved.getImports(); Set<Definition> wsdlDefinitions = getImportedWSDLDefinitions( theImports, contribution.getModelResolver(), context ); unresolved.getPortTypes().addAll(thePortTypes); unresolved.getInterfaces().addAll(theInterfaces); List<BPELPartnerLinkElement> thePartnerLinks = unresolved.getPartnerLinks(); for (BPELPartnerLinkElement thePartnerLink : thePartnerLinks) { QName partnerLinkType = thePartnerLink.getPartnerLinkType(); unresolved.setUnresolved(false);
public <T> T resolveModel(Class<T> modelClass, T unresolved, ProcessorContext context) { BPELProcessDefinition resolved = null; QName qname = ((BPELProcessDefinition)unresolved).getName(); if (!resolved.isUnresolved()) { return modelClass.cast(resolved); if (!resolved.isUnresolved()) { return modelClass.cast(resolved); if(resolved != null && resolved.isUnresolved()) { try { resolve(resolved, context);
List<BPELPartnerLinkElement> partnerLinks = theProcess.getPartnerLinks(); String scaName = pLink.getSCAName(); if (pLink.querySCAType().equals("reference")) { componentType.getReferences().add(generateReference(scaName, pLink.getMyRolePortType(), pLink.getPartnerRolePortType(), theProcess.getInterfaces(), monitor)); } else { componentType.getServices().add(generateService(scaName, pLink.getMyRolePortType(), pLink.getPartnerRolePortType(), theProcess.getInterfaces(), monitor)); for( Property property : theProcess.getProperties() ) { componentType.getProperties().add(property);
/** * Read the BPEL Process definition file from the location identified by an artifact URL * @param contributionURL - URL of the Contribution containing the Process definition * @param artifactURI - URI of the artifact containing the BPEL Process definition * @param artifactURL - URL of the artifact containing the BPEL Process definition * @return BPELProcessDefinition - SCA model of the BPEL Process */ public BPELProcessDefinition read(URL contributionURL, URI artifactURI, URL artifactURL, ProcessorContext context) throws ContributionReadException { BPELProcessDefinition processDefinition = null; try { processDefinition = readProcessDefinition(artifactURL, context.getMonitor()); processDefinition.setURI(artifactURI.toString()); processDefinition.setUnresolved(true); } catch (Exception e) { ContributionReadException ce = new ContributionReadException(e); error(context.getMonitor(), "ContributionReadException", artifactURL, ce); } return processDefinition; }
/** * Return the WSDL Definition for a given PortType * @param portTypeName - the QName of the PortType */ public Definition getDefinitionForPortType( QName portTypeName ) { //System.out.println("getDefinitionForPortType called for portType: " + portTypeName ); // Find the named PortType in the list of WSDL interfaces associated with this BPEL Process Collection<WSDLInterface> theInterfaces = implementation.getProcessDefinition().getInterfaces(); for( WSDLInterface wsdlInterface : theInterfaces ) { if ( wsdlInterface.getPortType().getQName().equals( portTypeName ) ) { // Extract and return the Definition associated with the WSDLDefinition... return wsdlInterface.getWsdlDefinition().getDefinition(); } // end if } // end for return null; } // end getDefinitionforPortType
private void resolveBPELImports(BPELProcessDefinition processDefinition, ModelResolver resolver, ProcessorContext context) throws ContributionResolveException { for (BPELImportElement bpelImport : processDefinition.getImports()) { String namespace = bpelImport.getNamespace(); String location = bpelImport.getLocation(); WSDLDefinition wsdl = bpelImport.getWSDLDefinition(); if (wsdl == null) { try { wsdl = wsdlFactory.createWSDLDefinition(); wsdl.setUnresolved(true); wsdl.setNamespace(bpelImport.getNamespace()); wsdl.setLocation(new URI(null, bpelImport.getLocation(), null)); wsdl = resolver.resolveModel(WSDLDefinition.class, wsdl, context); if(! wsdl.isUnresolved()) { bpelImport.setWSDLDefinition(wsdl); } else { //error("BPELProcessNotFound", implementation, processDefinition.getName()); } } catch (URISyntaxException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } }
processDefinition.setUnresolved(true); processDefinition.setLocation(doc.toString()); if (BPELProcessorConstants.PROCESS_ELEMENT.equals(qname) || BPELProcessorConstants.PROCESS_ELEMENT_20.equals(qname)) { QName processName = new QName(getString(reader, BPELProcessorConstants.TARGET_NAMESPACE), getString(reader, BPELProcessorConstants.NAME_ELEMENT)); processDefinition.setName(processName); } else if (BPELProcessorConstants.PARTNERLINK_ELEMENT.equals(qname) || BPELProcessorConstants.PARTNERLINK_ELEMENT_20.equals(qname)) { processDefinition.getPartnerLinks().add(processPartnerLinkElement(reader, monitor)); } else if (BPELProcessorConstants.ONEVENT_ELEMENT.equals(qname) || BPELProcessorConstants.RECEIVE_ELEMENT.equals(qname) || BPELProcessorConstants.ONMESSAGE_ELEMENT.equals(qname) || BPELProcessorConstants.ONEVENT_ELEMENT_20.equals(qname) || BPELProcessorConstants.RECEIVE_ELEMENT_20.equals(qname) || BPELProcessorConstants.ONMESSAGE_ELEMENT_20.equals(qname)) { processPartnerLinkAsService(reader.getAttributeValue(null, "partnerLink"), processDefinition.getPartnerLinks(), monitor); } else if (BPELProcessorConstants.INVOKE_ELEMENT.equals(qname) || BPELProcessorConstants.INVOKE_ELEMENT_20.equals(qname)) { processPartnerLinkAsReference(reader.getAttributeValue(null, "partnerLink"), processDefinition.getPartnerLinks(), monitor); } else if (BPELProcessorConstants.IMPORT_ELEMENT.equals(qname) || BPELProcessorConstants.IMPORT_ELEMENT_20.equals(qname)) { processDefinition.getImports().add(processImportElement(reader)); } else if (BPELProcessorConstants.VARIABLE_ELEMENT.equals(qname) || BPELProcessorConstants.VARIABLE_ELEMENT_20.equals(qname)) { processDefinition.getProperties().add( aProperty );
List<BPELImportElement> theImports = unresolved.getImports(); Set<Definition> wsdlDefinitions = getImportedWSDLDefinitions( theImports, contribution.getModelResolver(), context ); unresolved.getPortTypes().addAll(thePortTypes); unresolved.getInterfaces().addAll(theInterfaces); List<BPELPartnerLinkElement> thePartnerLinks = unresolved.getPartnerLinks(); for (BPELPartnerLinkElement thePartnerLink : thePartnerLinks) { QName partnerLinkType = thePartnerLink.getPartnerLinkType(); unresolved.setUnresolved(false);
public <T> T resolveModel(Class<T> modelClass, T unresolved, ProcessorContext context) { BPELProcessDefinition resolved = null; QName qname = ((BPELProcessDefinition)unresolved).getName(); if (!resolved.isUnresolved()) { return modelClass.cast(resolved); if (!resolved.isUnresolved()) { return modelClass.cast(resolved); if(resolved != null && resolved.isUnresolved()) { try { resolve(resolved, context);
List<BPELPartnerLinkElement> partnerLinks = theProcess.getPartnerLinks(); String scaName = pLink.getSCAName(); if (pLink.querySCAType().equals("reference")) { componentType.getReferences().add(generateReference(scaName, pLink.getMyRolePortType(), pLink.getPartnerRolePortType(), theProcess.getInterfaces(), monitor)); } else { componentType.getServices().add(generateService(scaName, pLink.getMyRolePortType(), pLink.getPartnerRolePortType(), theProcess.getInterfaces(), monitor)); for( Property property : theProcess.getProperties() ) { componentType.getProperties().add(property);
private BPELProcessDefinition resolveBPELProcessDefinition(BPELImplementation impl, ModelResolver resolver, ProcessorContext context) throws ContributionResolveException { QName processName = impl.getProcess(); BPELProcessDefinition processDefinition = this.bpelFactory.createBPELProcessDefinition(); processDefinition.setName(processName); processDefinition.setUnresolved(true); return resolver.resolveModel(BPELProcessDefinition.class, processDefinition, context); } // end resolveBPELProcessDefinition
/** * Read the BPEL Process definition file from the location identified by an artifact URL * @param contributionURL - URL of the Contribution containing the Process definition * @param artifactURI - URI of the artifact containing the BPEL Process definition * @param artifactURL - URL of the artifact containing the BPEL Process definition * @return BPELProcessDefinition - SCA model of the BPEL Process */ public BPELProcessDefinition read(URL contributionURL, URI artifactURI, URL artifactURL, ProcessorContext context) throws ContributionReadException { BPELProcessDefinition processDefinition = null; try { processDefinition = readProcessDefinition(artifactURL, context.getMonitor()); processDefinition.setURI(artifactURI.toString()); processDefinition.setUnresolved(true); } catch (Exception e) { ContributionReadException ce = new ContributionReadException(e); error(context.getMonitor(), "ContributionReadException", artifactURL, ce); } return processDefinition; }
private void resolveBPELImports(BPELProcessDefinition processDefinition, ModelResolver resolver, ProcessorContext context) throws ContributionResolveException { for (BPELImportElement bpelImport : processDefinition.getImports()) { String namespace = bpelImport.getNamespace(); String location = bpelImport.getLocation(); WSDLDefinition wsdl = bpelImport.getWSDLDefinition(); if (wsdl == null) { try { wsdl = wsdlFactory.createWSDLDefinition(); wsdl.setUnresolved(true); wsdl.setNamespace(bpelImport.getNamespace()); wsdl.setLocation(new URI(null, bpelImport.getLocation(), null)); wsdl = resolver.resolveModel(WSDLDefinition.class, wsdl, context); if(! wsdl.isUnresolved()) { bpelImport.setWSDLDefinition(wsdl); } else { //error("BPELProcessNotFound", implementation, processDefinition.getName()); } } catch (URISyntaxException e) { // TODO Auto-generated catch block e.printStackTrace(); } } } }
public void resolve(BPELImplementation implementation, ModelResolver resolver, ProcessorContext context) throws ContributionResolveException { if( implementation != null && implementation.isUnresolved()) { implementation.setModelResolver(resolver); BPELProcessDefinition processDefinition = resolveBPELProcessDefinition(implementation, resolver, context); //resolveBPELImports(processDefinition, resolver); if(processDefinition.isUnresolved()) { error(context.getMonitor(), "BPELProcessNotFound", implementation, processDefinition.getName()); } else { implementation.setProcessDefinition(processDefinition); // Get the component type from the process definition generateComponentType( implementation, context.getMonitor() ); //set current implementation resolved implementation.setUnresolved(false); } } } // end resolve
public Object removeModel(Object resolved, ProcessorContext context) { return map.remove(((BPELProcessDefinition)resolved).getName()); }