Search in sources :

Example 6 with ComponentException

use of org.apache.airavata.workflow.model.component.ComponentException in project airavata by apache.

the class WorkflowNodeGUI method openWorkflowTab.

public void openWorkflowTab(XBayaEngine engine) {
    try {
        Workflow workflow = this.node.getComponent().getWorkflow();
        engine.getGUI().selectOrCreateGraphCanvas(workflow);
    } catch (GraphException e) {
        engine.getGUI().getErrorWindow().error(ErrorMessages.GRAPH_FORMAT_ERROR, e);
    } catch (ComponentException e) {
        engine.getGUI().getErrorWindow().error(ErrorMessages.COMPONENT_FORMAT_ERROR, e);
    }
}
Also used : GraphException(org.apache.airavata.workflow.model.graph.GraphException) ComponentException(org.apache.airavata.workflow.model.component.ComponentException) Workflow(org.apache.airavata.workflow.model.wf.Workflow)

Example 7 with ComponentException

use of org.apache.airavata.workflow.model.component.ComponentException in project airavata by apache.

the class SubWorkflowNodeGUI method openWorkflowTab.

public void openWorkflowTab(XBayaGUI xbayaGUI) {
    try {
        Workflow workflow = this.node.getComponent().getWorkflow();
        xbayaGUI.selectOrCreateGraphCanvas(workflow);
    } catch (GraphException e) {
        xbayaGUI.getErrorWindow().error(ErrorMessages.GRAPH_FORMAT_ERROR, e);
    } catch (ComponentException e) {
        xbayaGUI.getErrorWindow().error(ErrorMessages.COMPONENT_FORMAT_ERROR, e);
    }
}
Also used : GraphException(org.apache.airavata.workflow.model.graph.GraphException) ComponentException(org.apache.airavata.workflow.model.component.ComponentException) Workflow(org.apache.airavata.workflow.model.wf.Workflow)

Example 8 with ComponentException

use of org.apache.airavata.workflow.model.component.ComponentException in project airavata by apache.

the class WSNode method parse.

protected void parse(JsonObject nodeObject) {
    super.parse(nodeObject);
    JsonObject applicationObject = nodeObject.getAsJsonObject("Application");
    WSComponentApplication application = WSComponentApplication.parse(applicationObject);
    try {
        setComponent(new WSComponent(application));
    } catch (ComponentException e) {
        log.error(e.getMessage(), e);
    }
}
Also used : WSComponent(org.apache.airavata.workflow.model.component.ws.WSComponent) ComponentException(org.apache.airavata.workflow.model.component.ComponentException) JsonObject(com.google.gson.JsonObject) WSComponentApplication(org.apache.airavata.workflow.model.component.ws.WSComponentApplication)

Example 9 with ComponentException

use of org.apache.airavata.workflow.model.component.ComponentException in project airavata by apache.

the class WSNode method parse.

/**
 * @see org.apache.airavata.workflow.model.graph.impl.NodeImpl#parse(org.xmlpull.infoset.XmlElement)
 */
@Override
protected void parse(XmlElement nodeElement) throws GraphException {
    super.parse(nodeElement);
    XmlElement element = nodeElement.element(null, "Application");
    WSComponentApplication application = WSComponentApplication.parse(element);
    try {
        setComponent(new WSComponent(application));
    } catch (ComponentException e) {
        log.error(e.getMessage(), e);
    }
// XmlElement wsdlElement = nodeElement.element(null, GraphSchema.NODE_WSDL_QNAME_TAG);
// if (wsdlElement != null) {
// this.wsdlID = wsdlElement.requiredText();
// // String wsdlQNameString = wsdlElement.requiredText();
// // this.wsdlQName = QName.valueOf(wsdlQNameString);
// }
// 
// XmlElement portTypeElement = nodeElement.element(null, GraphSchema.NODE_WSDL_PORT_TYPE_TAG);
// if (portTypeElement != null) {
// String portTypeString = portTypeElement.requiredText();
// this.portTypeQName = QName.valueOf(portTypeString);
// }
// 
// XmlElement operationElement = nodeElement.element(null, GraphSchema.NODE_WSDL_OPERATION_TAG);
// if (operationElement != null) {
// this.operationName = operationElement.requiredText();
// }
}
Also used : WSComponent(org.apache.airavata.workflow.model.component.ws.WSComponent) ComponentException(org.apache.airavata.workflow.model.component.ComponentException) XmlElement(org.xmlpull.infoset.XmlElement) WSComponentApplication(org.apache.airavata.workflow.model.component.ws.WSComponentApplication)

Example 10 with ComponentException

use of org.apache.airavata.workflow.model.component.ComponentException in project airavata by apache.

the class WorkflowFiler method openWorkflow.

/**
 * Opens a current workflow from the local file.
 */
public void openWorkflow() {
    Workflow workflow = null;
    int returnVal = this.graphFileChooser.showOpenDialog(this.engine.getGUI().getFrame());
    if (returnVal == JFileChooser.APPROVE_OPTION) {
        File file = this.graphFileChooser.getSelectedFile();
        logger.debug(file.getPath());
        try {
            String path = file.getPath();
            if (path.endsWith(XBayaConstants.GRAPH_FILE_SUFFIX)) {
                WSGraph graph = WSGraphFactory.createGraph(file);
                workflow = Workflow.graphToWorkflow(graph);
            } else {
                JsonObject workflowObject = JSONUtil.loadJSON(file);
                // XmlElement workflowElement = XMLUtil.loadXML(file);
                // workflow = new Workflow(workflowElement);
                workflow = new Workflow(workflowObject);
            }
            GraphCanvas newGraphCanvas = engine.getGUI().newGraphCanvas(true);
            newGraphCanvas.setWorkflow(workflow);
            // this.engine.setWorkflow(workflow);
            engine.getGUI().getGraphCanvas().setWorkflowFile(file);
        } catch (IOException e) {
            this.engine.getGUI().getErrorWindow().error(ErrorMessages.OPEN_FILE_ERROR, e);
        } catch (GraphException e) {
            this.engine.getGUI().getErrorWindow().error(ErrorMessages.GRAPH_FORMAT_ERROR, e);
        } catch (ComponentException e) {
            this.engine.getGUI().getErrorWindow().error(ErrorMessages.GRAPH_FORMAT_ERROR, e);
        } catch (RuntimeException e) {
            this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
        } catch (Error e) {
            this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
        }
    }
}
Also used : GraphException(org.apache.airavata.workflow.model.graph.GraphException) ComponentException(org.apache.airavata.workflow.model.component.ComponentException) Workflow(org.apache.airavata.workflow.model.wf.Workflow) JsonObject(com.google.gson.JsonObject) IOException(java.io.IOException) WSGraph(org.apache.airavata.workflow.model.graph.ws.WSGraph) File(java.io.File) GraphCanvas(org.apache.airavata.xbaya.ui.graph.GraphCanvas)

Aggregations

ComponentException (org.apache.airavata.workflow.model.component.ComponentException)10 GraphException (org.apache.airavata.workflow.model.graph.GraphException)5 Workflow (org.apache.airavata.workflow.model.wf.Workflow)5 IOException (java.io.IOException)4 File (java.io.File)3 WSComponent (org.apache.airavata.workflow.model.component.ws.WSComponent)3 WSGraph (org.apache.airavata.workflow.model.graph.ws.WSGraph)3 XmlElement (org.xmlpull.infoset.XmlElement)3 JsonObject (com.google.gson.JsonObject)2 Component (org.apache.airavata.workflow.model.component.Component)2 ComponentReference (org.apache.airavata.workflow.model.component.ComponentReference)2 ComponentRegistryException (org.apache.airavata.workflow.model.component.ComponentRegistryException)2 WSComponentApplication (org.apache.airavata.workflow.model.component.ws.WSComponentApplication)2 GraphCanvas (org.apache.airavata.xbaya.ui.graph.GraphCanvas)2 Point (java.awt.Point)1 Transferable (java.awt.datatransfer.Transferable)1 UnsupportedFlavorException (java.awt.datatransfer.UnsupportedFlavorException)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 ArrayList (java.util.ArrayList)1 LinkedList (java.util.LinkedList)1