/** * Returns the QName of the BPEL process */ public QName getType() { //System.out.println("getType called"); return implementation.getProcess(); }
public synchronized File getBPELFile() throws IOException { if (bpelFile != null) { String location = implementation.getProcessDefinition().getLocation(); String fileName = implementation.getProcessDefinition().getURI(); File file = new File(workingDir, fileName); if (file.isFile()) { bpelFile = file; return file; } URL url = new URL(location); this.bpelFile = copy(url, workingDir, fileName); } return bpelFile; }
public BPELImplementation read(XMLStreamReader reader, ProcessorContext context) throws ContributionReadException, XMLStreamException { assert IMPLEMENTATION_BPEL_QNAME.equals(reader.getName()); // Read an <implementation.bpel> element BPELImplementation implementation = null; // Read the process attribute. QName process = getAttributeValueNS(reader, PROCESS, context.getMonitor()); if (process == null) { return implementation; } // Create and initialize the BPEL implementation model implementation = bpelFactory.createBPELImplementation(); implementation.setProcess(process); implementation.setUnresolved(true); // Skip to end element while (reader.hasNext()) { if (reader.next() == END_ELEMENT && IMPLEMENTATION_BPEL_QNAME.equals(reader.getName())) { break; } } return implementation; }
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
String location = this.implementation.getProcessDefinition().getLocation(); URI deployURI = new URI(null, location, null); deployment = new ODEDeployment( deploymentDir ); try { odeServer.registerTuscanyRuntimeComponent(implementation.getProcess(), component);
impl.setComponentType(componentType); BPELProcessDefinition theProcess = impl.getProcessDefinition(); List<BPELPartnerLinkElement> partnerLinks = theProcess.getPartnerLinks();
QName process = implementation.getProcess(); String processNamespace = process.getNamespaceURI(); stream.println( PROCESS_NAMESPACE_DECL + "\"" + processNamespace + "\"" ); ComponentType componentType = implementation.getComponentType(); List<Service> theServices = componentType.getServices();
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
impl.setComponentType(componentType); BPELProcessDefinition theProcess = impl.getProcessDefinition(); List<BPELPartnerLinkElement> partnerLinks = theProcess.getPartnerLinks();
public void write( BPELImplementation bpelImplementation, XMLStreamWriter writer, ProcessorContext context ) throws ContributionWriteException, XMLStreamException { //FIXME Deal with policy processing... // Write <implementation.bpel process="..."/> // policyProcessor.writePolicyPrefixes(bpelImplementation, writer); writer.writeStartElement(SCA11_NS, IMPLEMENTATION_BPEL); // policyProcessor.writePolicyAttributes(bpelImplementation, writer); if (bpelImplementation.getProcess() != null) { writer.writeAttribute(PROCESS, bpelImplementation.getProcess().toString() ); } writer.writeEndElement(); } // end write
/** * Gets the File containing the BPEL process definition * @return - the File object containing the BPEL process */ private File getBPELFile() { try { String location = this.implementation.getProcessDefinition().getLocation(); URI locationURI; if (location.indexOf('%') != -1) { locationURI = URI.create(location); } else { locationURI = new URI(null, location, null); } File theProcess = new File(locationURI); return theProcess; } catch( Exception e ) { if(__log.isDebugEnabled()) { __log.debug("Exception converting BPEL file URL to an URI: " + e ); } } // end try return null; } // end getBPELFile
public BPELImplementation read(XMLStreamReader reader, ProcessorContext context) throws ContributionReadException, XMLStreamException { assert IMPLEMENTATION_BPEL_QNAME.equals(reader.getName()); // Read an <implementation.bpel> element BPELImplementation implementation = null; // Read the process attribute. QName process = getAttributeValueNS(reader, PROCESS, context.getMonitor()); if (process == null) { return implementation; } // Create and initialize the BPEL implementation model implementation = bpelFactory.createBPELImplementation(); implementation.setProcess(process); implementation.setUnresolved(true); // Skip to end element while (reader.hasNext()) { if (reader.next() == END_ELEMENT && IMPLEMENTATION_BPEL_QNAME.equals(reader.getName())) { break; } } return implementation; }
public void write( BPELImplementation bpelImplementation, XMLStreamWriter writer, ProcessorContext context ) throws ContributionWriteException, XMLStreamException { //FIXME Deal with policy processing... // Write <implementation.bpel process="..."/> // policyProcessor.writePolicyPrefixes(bpelImplementation, writer); writer.writeStartElement(SCA11_NS, IMPLEMENTATION_BPEL); // policyProcessor.writePolicyAttributes(bpelImplementation, writer); if (bpelImplementation.getProcess() != null) { writer.writeAttribute(PROCESS, bpelImplementation.getProcess().toString() ); } writer.writeEndElement(); } // end write
/** * Gets the File containing the BPEL process definition * @return - the File object containing the BPEL process */ private File getBPELFile() { if( theBPELFile != null ) return theBPELFile; try { String location = this.implementation.getProcessDefinition().getLocation(); URI locationURI; if (location.indexOf('%') != -1) { locationURI = URI.create(location); } else { locationURI = new URI(null, location, null); } File theProcess = new File(locationURI); theBPELFile = theProcess; return theProcess; } catch( Exception e ) { if(__log.isDebugEnabled()) { __log.debug("Exception converting BPEL file URL to an URI: " + e ); } } // end try return null; } // end getBPELFile
@Override public boolean equals(Object obj) { if (obj == this) { return true; } else if (obj instanceof BPELImplementation) { if (getProcess() != null) { return getProcess().equals(((BPELImplementation)obj).getProcess()); } else { return ((BPELImplementation)obj).getProcess() == null; } } else { return false; } }
/** * Returns a String containing the (local) name of the file containing the BPEL process */ public String getBpelDocument() { //System.out.println("getBPELDocument called"); try { String location = this.implementation.getProcessDefinition().getLocation(); URI locationURI = new URI(null, location, null); File processFile = new File(locationURI); return getRelativePath( getDirectory(), processFile); } catch (Exception e) { if(__log.isWarnEnabled()) { __log.warn("Unable to resolve relative path of BPEL process" + implementation.getProcessDefinition().getLocation(), e ); } return null; } // end try } // end getBpelDocument
@Override public boolean equals(Object obj) { if (obj == this) { return true; } else if (obj instanceof BPELImplementation) { if (getProcess() != null) { return getProcess().equals(((BPELImplementation)obj).getProcess()); } else { return ((BPELImplementation)obj).getProcess() == null; } } else { return false; } }
/** * Returns an InputStream containing the Compiled BPEL Process (CBP) */ public InputStream getCBPInputStream() { //System.out.println("getCBPInputStream called"); File cbpFile = getCBPFile(); if( cbpFile == null ) return null; if( cbpFile.exists() ) { // Create an InputStream from the cbp file... try { return new FileInputStream( cbpFile ); } catch ( Exception e ) { if(__log.isDebugEnabled()) { __log.debug("Unable to open the cbp file for BPEL process: " + implementation.getProcessDefinition().getName(), e); } } // end try } else { // Cannot find the cbp file if(__log.isWarnEnabled()){ __log.warn("Cannot find the cbp file for process: " + implementation.getProcessDefinition().getName()); } } // end if // TODO - need better exception handling if we can't open the cbp file for any reason return null; } // end getCBPInputStream
/** * Deploy the BPEL process implementation to the ODE Engine * @param d - ODEDeployment structure * @param implementation - the BPEL Implementation * @param component - the SCA component which uses the implementation */ public void deploy(ODEDeployment d, BPELImplementation implementation, RuntimeComponent component ) { try { TuscanyProcessConfImpl processConf = new TuscanyProcessConfImpl( implementation, component ); _bpelServer.register(processConf); d.setProcessConf(processConf); __log.debug("Completed calling new Process deployment code..."); } catch (Exception ex) { String errMsg = ">>> DEPLOY: Unexpected exception during deploy of BPEL. /n Component = " + component.getName() + " implementation = " + implementation.getProcess() + ex.getMessage(); __log.debug(errMsg, ex); throw new ODEDeploymentException(errMsg,ex); } }
/** * Gets the File object for the CBP file for this BPEL Process * @return - the File object for the CBP file */ private File getCBPFile() { // Find the CBP file - it has the same name as the BPEL process and lives in the same // directory as the process file String cbpFileName = null; try { String fileName = getRelativePath( getDirectory(), getBPELFile() ); cbpFileName = fileName.substring(0, fileName.lastIndexOf(".")) + ".cbp"; } catch (Exception e ) { // IOException trying to fetch the BPEL file name if(__log.isDebugEnabled()) { __log.debug("Unable to calculate the file name for BPEL process: " + implementation.getProcessDefinition().getName(), e); return null; } // end if } // end try File cbpFile = new File( getDirectory(), cbpFileName ); return cbpFile; } // end getCBPFile