Examples of BPELScript


Examples of org.apache.airavata.workflow.model.gpel.script.BPELScript

    }

    private void generateODEScripts(URI dscUrl, String odeEprEndingWithPort) throws GraphException, ComponentException {
        this.getGraph().setID(this.getName());

        BPELScript script = null;

        script = new BPELScript(this);
        ODEWSDLTransformer wsdlTransformer = new ODEWSDLTransformer();
        script.create(BPELScriptType.BPEL2);
        this.odeProcess = script.getGpelProcess();
        this.odeProcess.setTargetNamespace(WorkflowConstants.LEAD_NS);

        WsdlDefinitions abstractWorkflowWsdl = script.getWorkflowWSDL().getWsdlDefinitions();
        this.odeWorkflowWSDL = abstractWorkflowWsdl;
        try {
            this.odeInvokableWSDL = WSDLUtil.stringToWSDL(abstractWorkflowWsdl.xmlString());
            wsdlTransformer.makeWorkflowWSDLConcrete(this.odeInvokableWSDL, this.getName(), dscUrl);
            wsdlTransformer.setOdeLocation(odeEprEndingWithPort, this.getName(), this.odeInvokableWSDL);

            this.odeWsdlMap = new HashMap<String, WsdlDefinitions>();
            Collection<XmlElement> itr = script.getWSDLs();
            for (XmlElement xmlElement : itr) {
                WsdlDefinitions wsdl = WSDLUtil.stringToWSDL(XmlConstants.BUILDER.serializeToString(xmlElement));
                String id = xmlElement.attributeValue(NS_XWF, ID_ATTRIBUTE);
                if (id == null || id.length() == 0) {
                    // xwf up to 2.2.6_2 doesn't have ID.
View Full Code Here

Examples of org.apache.airavata.workflow.model.gpel.script.BPELScript

    getGraph().setEditable(isEditable());
  }

  public void createScript() throws GraphException {
        // Generate a BPEL process.
        BPELScript script = new BPELScript(this);
        script.create(BPELScriptType.GPEL);
        this.setGpelProcess(script.getGpelProcess());
        this.setWorkflowWSDL(script.getWorkflowWSDL().getWsdlDefinitions());
    }
View Full Code Here

Examples of org.apache.airavata.workflow.model.gpel.script.BPELScript

    /**
     * Exports a BPEL process to the local file
     */
    public void exportBPEL() {
        Workflow workflow = this.engine.getGUI().getWorkflow();
        BPELScript bpel = new BPELScript(workflow);

        // Check if there is any errors in the workflow first.
        ArrayList<String> warnings = new ArrayList<String>();
        if (!bpel.validate(warnings)) {
            StringBuilder buf = new StringBuilder();
            for (String warning : warnings) {
                buf.append("- ");
                buf.append(warning);
                buf.append("\n");
            }
            this.engine.getGUI().getErrorWindow().warning(buf.toString());
            return;
        }

        int returnVal = this.bpelFileChooser.showSaveDialog(this.engine.getGUI().getFrame());
        if (returnVal == JFileChooser.APPROVE_OPTION) {
            File file = this.bpelFileChooser.getSelectedFile();
            logger.debug(file.getPath());

            String path = file.getPath();

            // Remove ".bpel" at the end if any
            if (path.endsWith(XBayaConstants.BPEL_SUFFIX)) {
                path = path.substring(0, path.length() - XBayaConstants.BPEL_SUFFIX.length());
            }

            // Add ".bpel" at the end of the file name
            File bpelFile = new File(path + XBayaConstants.BPEL_SUFFIX);
            // Add ".wsdl" at the end of the file name
            File wsdlFile = new File(path + XBayaConstants.WSDL_SUFFIX);

            try {
                // Create the script.
                bpel.create(BPELScriptType.BPEL2);

                GpelProcess gpelProcess = bpel.getGpelProcess();
                XMLUtil.saveXML(gpelProcess.xml(), bpelFile);

                WorkflowWSDL workflowWSDL = bpel.getWorkflowWSDL();
                XMLUtil.saveXML(workflowWSDL.getWsdlDefinitions().xml(), wsdlFile);

            } catch (IOException e) {
                this.engine.getGUI().getErrorWindow().error(ErrorMessages.WRITE_FILE_ERROR, e);
            } catch (GraphException e) {
View Full Code Here

Examples of org.apache.airavata.workflow.model.gpel.script.BPELScript

        // This one is for debuggin in case something below fails.
        XMLUtil.saveXML(workflow.toXML(), new File(this.temporalDirectory, filename + "-0.xwf"));

        // Create BPEL
        BPELScript bpel = new BPELScript(workflow);
        bpel.create(BPELScriptType.GPEL);
        GpelProcess gpelProcess = bpel.getGpelProcess();
        WorkflowWSDL workflowWSDL = bpel.getWorkflowWSDL();
        WsdlDefinitions definitions = workflowWSDL.getWsdlDefinitions();

        File bpelFile = new File(this.temporalDirectory, filename + XBayaConstants.BPEL_SUFFIX);
        File wsdlFile = new File(this.temporalDirectory, filename + XBayaConstants.WSDL_SUFFIX);
        XMLUtil.saveXML(gpelProcess.xml(), bpelFile);
        XMLUtil.saveXML(definitions.xml(), wsdlFile);

        // Save the workflow
        File workflowFile = new File(this.temporalDirectory, filename + XBayaConstants.WORKFLOW_FILE_SUFFIX);
        XMLUtil.saveXML(workflow.toXML(), workflowFile);

        // Read the workflow
        XmlElement workflowElement = XMLUtil.loadXML(workflowFile);
        workflow = new Workflow(workflowElement);

        // Create BPEL again
        bpel = new BPELScript(workflow);
        bpel.create(BPELScriptType.GPEL);
        gpelProcess = bpel.getGpelProcess();
        workflowWSDL = bpel.getWorkflowWSDL();
        definitions = workflowWSDL.getWsdlDefinitions();

        File bpelFile2 = new File(this.temporalDirectory, filename + "-2" + XBayaConstants.BPEL_SUFFIX);
        File wsdlFile2 = new File(this.temporalDirectory, filename + "-2" + XBayaConstants.WSDL_SUFFIX);
        XMLUtil.saveXML(gpelProcess.xml(), bpelFile2);
View Full Code Here

Examples of org.apache.airavata.xbaya.gpel.script.BPELScript

     */
    public List<WSComponentPort> getInputs(Workflow workflow) {
        List<WSComponentPort> inputs;
        try {
            if (workflow.getWorkflowWSDL() == null) {
                BPELScript script = new BPELScript(workflow);
                script.create(BPELScriptType.BPEL2);
                workflow.setWorkflowWSDL(script.getWorkflowWSDL().getWsdlDefinitions());
                workflow.setGpelProcess(script.getGpelProcess());

            }
            inputs = workflow.getInputs();
            return inputs;
        } catch (GraphException e) {
View Full Code Here

Examples of org.apache.airavata.xbaya.gpel.script.BPELScript

        // This one is for debuggin in case something below fails.
        XMLUtil.saveXML(workflow.toXML(), new File(this.temporalDirectory, filename + "-0.xwf"));

        // Create BPEL
        BPELScript bpel = new BPELScript(workflow);
        bpel.create(BPELScriptType.GPEL);
        GpelProcess gpelProcess = bpel.getGpelProcess();
        WorkflowWSDL workflowWSDL = bpel.getWorkflowWSDL();
        WsdlDefinitions definitions = workflowWSDL.getWsdlDefinitions();

        File bpelFile = new File(this.temporalDirectory, filename + XBayaConstants.BPEL_SUFFIX);
        File wsdlFile = new File(this.temporalDirectory, filename + XBayaConstants.WSDL_SUFFIX);
        XMLUtil.saveXML(gpelProcess.xml(), bpelFile);
        XMLUtil.saveXML(definitions.xml(), wsdlFile);

        // Save the workflow
        File workflowFile = new File(this.temporalDirectory, filename + XBayaConstants.WORKFLOW_FILE_SUFFIX);
        XMLUtil.saveXML(workflow.toXML(), workflowFile);

        // Read the workflow
        XmlElement workflowElement = XMLUtil.loadXML(workflowFile);
        workflow = new Workflow(workflowElement);

        // Create BPEL again
        bpel = new BPELScript(workflow);
        bpel.create(BPELScriptType.GPEL);
        gpelProcess = bpel.getGpelProcess();
        workflowWSDL = bpel.getWorkflowWSDL();
        definitions = workflowWSDL.getWsdlDefinitions();

        File bpelFile2 = new File(this.temporalDirectory, filename + "-2" + XBayaConstants.BPEL_SUFFIX);
        File wsdlFile2 = new File(this.temporalDirectory, filename + "-2" + XBayaConstants.WSDL_SUFFIX);
        XMLUtil.saveXML(gpelProcess.xml(), bpelFile2);
View Full Code Here

Examples of org.apache.airavata.xbaya.gpel.script.BPELScript

    /**
     * Exports a BPEL process to the local file
     */
    public void exportBPEL() {
        Workflow workflow = this.engine.getWorkflow();
        BPELScript bpel = new BPELScript(workflow);

        // Check if there is any errors in the workflow first.
        ArrayList<String> warnings = new ArrayList<String>();
        if (!bpel.validate(warnings)) {
            StringBuilder buf = new StringBuilder();
            for (String warning : warnings) {
                buf.append("- ");
                buf.append(warning);
                buf.append("\n");
            }
            this.engine.getErrorWindow().warning(buf.toString());
            return;
        }

        int returnVal = this.bpelFileChooser.showSaveDialog(this.engine.getGUI().getFrame());
        if (returnVal == JFileChooser.APPROVE_OPTION) {
            File file = this.bpelFileChooser.getSelectedFile();
            logger.info(file.getPath());

            String path = file.getPath();

            // Remove ".bpel" at the end if any
            if (path.endsWith(XBayaConstants.BPEL_SUFFIX)) {
                path = path.substring(0, path.length() - XBayaConstants.BPEL_SUFFIX.length());
            }

            // Add ".bpel" at the end of the file name
            File bpelFile = new File(path + XBayaConstants.BPEL_SUFFIX);
            // Add ".wsdl" at the end of the file name
            File wsdlFile = new File(path + XBayaConstants.WSDL_SUFFIX);

            try {
                // Create the script.
                bpel.create(BPELScriptType.BPEL2);

                GpelProcess gpelProcess = bpel.getGpelProcess();
                XMLUtil.saveXML(gpelProcess.xml(), bpelFile);

                WorkflowWSDL workflowWSDL = bpel.getWorkflowWSDL();
                XMLUtil.saveXML(workflowWSDL.getWsdlDefinitions().xml(), wsdlFile);

            } catch (IOException e) {
                this.engine.getErrorWindow().error(ErrorMessages.WRITE_FILE_ERROR, e);
            } catch (GraphException e) {
View Full Code Here

Examples of org.apache.airavata.xbaya.gpel.script.BPELScript

     * @throws org.apache.airavata.xbaya.graph.GraphException
     *
     */
    public static void createScript(Workflow workflow) throws GraphException {
        // Generate a BPEL process.
        BPELScript script = new BPELScript(workflow);
        script.create(BPELScriptType.GPEL);
        workflow.setGpelProcess(script.getGpelProcess());
        workflow.setWorkflowWSDL(script.getWorkflowWSDL().getWsdlDefinitions());
    }
View Full Code Here

Examples of org.apache.airavata.xbaya.gpel.script.BPELScript

    /**
     * Exports a BPEL process to the local file
     */
    public void exportBPEL() {
        Workflow workflow = this.engine.getWorkflow();
        BPELScript bpel = new BPELScript(workflow);

        // Check if there is any errors in the workflow first.
        ArrayList<String> warnings = new ArrayList<String>();
        if (!bpel.validate(warnings)) {
            StringBuilder buf = new StringBuilder();
            for (String warning : warnings) {
                buf.append("- ");
                buf.append(warning);
                buf.append("\n");
            }
            this.engine.getErrorWindow().warning(buf.toString());
            return;
        }

        int returnVal = this.bpelFileChooser.showSaveDialog(this.engine.getGUI().getFrame());
        if (returnVal == JFileChooser.APPROVE_OPTION) {
            File file = this.bpelFileChooser.getSelectedFile();
            logger.info(file.getPath());

            String path = file.getPath();

            // Remove ".bpel" at the end if any
            if (path.endsWith(XBayaConstants.BPEL_SUFFIX)) {
                path = path.substring(0, path.length() - XBayaConstants.BPEL_SUFFIX.length());
            }

            // Add ".bpel" at the end of the file name
            File bpelFile = new File(path + XBayaConstants.BPEL_SUFFIX);
            // Add ".wsdl" at the end of the file name
            File wsdlFile = new File(path + XBayaConstants.WSDL_SUFFIX);

            try {
                // Create the script.
                bpel.create(BPELScriptType.BPEL2);

                GpelProcess gpelProcess = bpel.getGpelProcess();
                XMLUtil.saveXML(gpelProcess.xml(), bpelFile);

                WorkflowWSDL workflowWSDL = bpel.getWorkflowWSDL();
                XMLUtil.saveXML(workflowWSDL.getWsdlDefinitions().xml(), wsdlFile);

            } catch (IOException e) {
                this.engine.getErrorWindow().error(ErrorMessages.WRITE_FILE_ERROR, e);
            } catch (GraphException e) {
View Full Code Here

Examples of org.apache.airavata.xbaya.gpel.script.BPELScript

        if (notifConfig.getBrokerURL() == null) {
            this.engine.getErrorWindow().error(ErrorMessages.BROKER_URL_NOT_SET_ERROR);
            return;
        }

        BPELScript bpel = new BPELScript(this.workflow);

        // Check if there is any errors in the workflow first.
        ArrayList<String> warnings = new ArrayList<String>();
        if (!bpel.validate(warnings)) {
            StringBuilder buf = new StringBuilder();
            for (String warning : warnings) {
                buf.append("- ");
                buf.append(warning);
                buf.append("\n");
            }
            this.engine.getErrorWindow().warning(buf.toString());
            return;
        }

        try {
            // Generate a BPEL process.
            bpel.create(BPELScriptType.BPEL2);
            this.workflow.setGpelProcess(bpel.getGpelProcess());
            this.workflow.setWorkflowWSDL(bpel.getWorkflowWSDL().getWsdlDefinitions());
        } catch (GraphException e) {
            this.engine.getErrorWindow().error(ErrorMessages.GRAPH_NOT_READY_ERROR, e);
            return;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.