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);
}
}
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);
}
}
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);
}
}
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();
// }
}
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);
}
}
}
Aggregations