Package org.apache.tuscany.sca.implementation.bpel

Examples of org.apache.tuscany.sca.implementation.bpel.BPELProcessDefinition


        return implementation;
    }

    public void resolve(BPELImplementation impl, ModelResolver resolver) throws ContributionResolveException {
        if( impl != null && impl.isUnresolved()) {
            BPELProcessDefinition processDefinition = resolveBPELProcessDefinition(impl, resolver);
            if(processDefinition.isUnresolved()) {
                throw new ContributionResolveException("Can't find BPEL Process : " + processDefinition.getName());
            }
           
            impl.setProcessDefinition(processDefinition);
           
            //resolve component type
View Full Code Here


        //FIXME Implement
    }

    private BPELProcessDefinition resolveBPELProcessDefinition(BPELImplementation impl, ModelResolver resolver) throws ContributionResolveException {
        QName processName = impl.getProcess();
        BPELProcessDefinition processDefinition = this.bpelFactory.createBPELProcessDefinition();
        processDefinition.setName(processName);
        processDefinition.setUnresolved(true);
       
        return resolver.resolveModel(BPELProcessDefinition.class, processDefinition);
    }
View Full Code Here

    public Class<BPELProcessDefinition> getModelType() {
        return BPELProcessDefinition.class;
    }

    public BPELProcessDefinition read(URL contributionURL, URI artifactURI, URL artifactURL) throws ContributionReadException {
        BPELProcessDefinition processDefinition = null;
        try {
            //for now we are just using process name
            //and relying on componentType file for service definition
            //so it's ok to set resolved for now
            processDefinition = indexRead(artifactURL);
            processDefinition.setURI(artifactURI);
            processDefinition.setUnresolved(false);
        } catch (Exception e) {
            throw new ContributionReadException(e);
        }
       
        return processDefinition;
View Full Code Here

     * @return
     * @throws IOException
     * @throws XMLStreamException
     */
    protected BPELProcessDefinition indexRead(URL doc) throws Exception {
        BPELProcessDefinition processDefinition = factory.createBPELProcessDefinition();
        processDefinition.setUnresolved(true);
        processDefinition.setLocation(doc);

        InputStream is = doc.openStream();
        XMLStreamReader reader = null;
        try {
            reader = inputFactory.createXMLStreamReader(is);
            int eventType = reader.getEventType();
            while (true) {
                if (eventType == XMLStreamConstants.START_ELEMENT) {
                    QName elementName = reader.getName();
                    if (BPEL_PROCESS_DEFINITION.equals(elementName) || BPEL_EXECUTABLE_DEFINITION.equals(elementName) ) {
                        QName processName = new QName(getString(reader, org.apache.tuscany.sca.assembly.xml.Constants.TARGET_NAMESPACE), getString(reader, NAME_ELEMENT));
                        processDefinition.setName(processName);
                        break;
                    }
                }
                if (reader.hasNext()) {
                    eventType = reader.next();
View Full Code Here

        return implementation;
    }

    public void resolve(BPELImplementation impl, ModelResolver resolver) throws ContributionResolveException {
        if( impl != null && impl.isUnresolved()) {
            BPELProcessDefinition processDefinition = resolveBPELProcessDefinition(impl, resolver);
            if(processDefinition.isUnresolved()) {
                throw new ContributionResolveException("Can't find BPEL Process : " + processDefinition.getName());
            }
           
            impl.setProcessDefinition(processDefinition);
           
            //resolve component type
View Full Code Here

        //FIXME Implement
    }

    private BPELProcessDefinition resolveBPELProcessDefinition(BPELImplementation impl, ModelResolver resolver) throws ContributionResolveException {
        QName processName = impl.getProcess();
        BPELProcessDefinition processDefinition = this.bpelFactory.createBPELProcessDefinition();
        processDefinition.setName(processName);
        processDefinition.setUnresolved(true);
       
        return resolver.resolveModel(BPELProcessDefinition.class, processDefinition);
    }
View Full Code Here

    public Class<BPELProcessDefinition> getModelType() {
        return BPELProcessDefinition.class;
    }

    public BPELProcessDefinition read(URL contributionURL, URI artifactURI, URL artifactURL) throws ContributionReadException {
        BPELProcessDefinition processDefinition = null;
        try {
            //for now we are just using process name
            //and relying on componentType file for service definition
            //so it's ok to set resolved for now
            processDefinition = indexRead(artifactURL);
            processDefinition.setURI(artifactURI);
            processDefinition.setUnresolved(false);
        } catch (Exception e) {
            throw new ContributionReadException(e);
        }
       
        return processDefinition;
View Full Code Here

     * @return
     * @throws IOException
     * @throws XMLStreamException
     */
    protected BPELProcessDefinition indexRead(URL doc) throws Exception {
        BPELProcessDefinition processDefinition = factory.createBPELProcessDefinition();
        processDefinition.setUnresolved(true);
        processDefinition.setLocation(doc);

        InputStream is = doc.openStream();
        XMLStreamReader reader = null;
        try {
            reader = inputFactory.createXMLStreamReader(is);
            int eventType = reader.getEventType();
            while (true) {
                if (eventType == XMLStreamConstants.START_ELEMENT) {
                    QName elementName = reader.getName();
                    if (BPEL_PROCESS_DEFINITION.equals(elementName) || BPEL_EXECUTABLE_DEFINITION.equals(elementName) ) {
                        QName processName = new QName(getString(reader, org.apache.tuscany.sca.assembly.xml.Constants.TARGET_NAMESPACE), getString(reader, NAME_ELEMENT));
                        processDefinition.setName(processName);
                        break;
                    }
                }
                if (reader.hasNext()) {
                    eventType = reader.next();
View Full Code Here

       
      if( implementation != null && implementation.isUnresolved())
      {
          implementation.setModelResolver(resolver);
         
            BPELProcessDefinition processDefinition = resolveBPELProcessDefinition(implementation, resolver);
            if(processDefinition.isUnresolved()) {
              error("BPELProcessNotFound", implementation, processDefinition.getName());
            } else {           
                implementation.setProcessDefinition(processDefinition);
           
                // Get the component type from the process definition
                generateComponentType( implementation );
View Full Code Here

    } // end write

    private BPELProcessDefinition resolveBPELProcessDefinition(BPELImplementation impl, ModelResolver resolver) throws ContributionResolveException {
        QName processName = impl.getProcess();
        BPELProcessDefinition processDefinition = this.bpelFactory.createBPELProcessDefinition();
        processDefinition.setName(processName);
        processDefinition.setUnresolved(true);
       
        return resolver.resolveModel(BPELProcessDefinition.class, processDefinition);
    } // end resolveBPELProcessDefinition
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.implementation.bpel.BPELProcessDefinition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.