/** * @param metadata */ public void setMetadata(XmlElement metadata) { String metadataText; if (metadata == null) { metadataText = WSConstants.EMPTY_APPINFO; } else { metadataText = XMLUtil.xmlElementToString(metadata); } this.metadataTextArea.setText(metadataText); }
/** * Converts a specified XmlElement (XPP5) to the XmlElement (XPP3). * * @param element * @return The XmlElement (XPP3) converted. */ public static org.xmlpull.v1.builder.XmlElement xmlElement5ToXmlElement3(org.xmlpull.infoset.XmlElement element) { String string = xmlElementToString(element); return stringToXmlElement3(string); }
/** * Converts a specified XmlElement (XPP3) to the XmlElement (XPP5). * * @param element * @return The XmlElement (XPP5) converted. */ public static org.xmlpull.infoset.XmlElement xmlElement3ToXmlElement5(org.xmlpull.v1.builder.XmlElement element) { String string = xmlElementToString(element); return stringToXmlElement(string); }
/** * Converts a specified XmlElement (XPP5) to the XmlElement (XPP3). * * @param element * @return The XmlElement (XPP3) converted. */ public static org.xmlpull.v1.builder.XmlElement xmlElement5ToXmlElement3(org.xmlpull.infoset.XmlElement element) { String string = xmlElementToString(element); return stringToXmlElement3(string); }
@Override public String getWorkflowAsString(Workflow workflow) throws AiravataAPIInvocationException { return XMLUtil.xmlElementToString(workflow.toXML()); }
/** * Returns the XML Text of the workflow. * * @return The XML Text of the workflow */ @Deprecated public String toXMLText() { return XMLUtil.xmlElementToString(toXML()); }
/** * Converts a specified XmlElement (XPP3) to the XmlElement (XPP5). * * @param element * @return The XmlElement (XPP5) converted. */ public static org.xmlpull.infoset.XmlElement xmlElement3ToXmlElement5(org.xmlpull.v1.builder.XmlElement element) { String string = xmlElementToString(element); return stringToXmlElement(string); }
public static WSComponentApplication parse(org.xmlpull.infoset.XmlElement element) { String xmlString = XMLUtil.xmlElementToString(element); try { JAXBContext context = JAXBContext.newInstance(WSComponentApplication.class); Unmarshaller unmarshaller = context.createUnmarshaller(); return (WSComponentApplication) unmarshaller.unmarshal(new ByteArrayInputStream(xmlString.getBytes())); } catch (JAXBException e) { e.printStackTrace(); return null; } }
@Override public void addOwnerWorkflow (Workflow workflow, String owner) throws WorkflowAlreadyExistsException, AiravataAPIInvocationException{ addWorkflow(workflow, XMLUtil.xmlElementToString(workflow.toXML()), owner); }
@Override public void updateOwnerWorkflow (Workflow workflow, String owner) throws AiravataAPIInvocationException { updateWorkflow(workflow, XMLUtil.xmlElementToString(workflow.toXML()), owner); }
@Override public boolean saveWorkflow(Workflow workflow, String owner) throws AiravataAPIInvocationException { return saveWorkflow(workflow, XMLUtil.xmlElementToString(workflow.toXML()), owner); }
/** * @param event */ protected synchronized void handleNotification(XmlElement event) { EventData eventData = new EventData(event); if (eventData.getType()==EventType.WORKFLOW_TERMINATED){ lastTerminatedWorkflowExecutionId=eventData.getExperimentID(); } Set<String> keys = this.eventDataMap.keySet(); // Remove everthing leaving only the last one if(printRawMessages){ System.out.println(XMLUtil.xmlElementToString(event)); } for (String key : keys) { this.eventDataMap.get(key).addEvent(eventData); } }
@Override public void addOwnerWorkflow (URI workflowPath, String owner) throws AiravataAPIInvocationException, WorkflowAlreadyExistsException { Workflow workflow = getWorkflowFromURI(workflowPath); addWorkflow(workflow, XMLUtil.xmlElementToString(workflow.toXML()), owner); }
@Override public void updateOwnerWorkflow (URI workflowPath, String owner) throws AiravataAPIInvocationException { Workflow workflow = getWorkflowFromURI(workflowPath); updateWorkflow(workflow, XMLUtil.xmlElementToString(workflow.toXML()), owner); }
@Override public void workflowFailed(String message, Throwable e) { if(e != null) logger.error(e.getMessage(), e); if (message == null || "".equals(message)) { message = "Error"; } if (e != null) { message += ": " + e.toString(); } if (e != null) { String stackTrace = StringUtil.getStackTraceInString(e); XmlElement stackTraceElement = XMLUtil.BUILDER.newFragment("stackTrace"); stackTraceElement.addChild(stackTrace); this.notifier.sendingFault(context, this.invocationContext, message, XMLUtil.xmlElementToString(stackTraceElement)); } else { this.notifier.sendingFault(context, this.invocationContext, message); } }
public Object getOutput(String name) throws WorkflowException { try { waitToFinish(); Object output = super.getOutput(name); if (output instanceof XmlElement) { logger.debug("output: " + XMLUtil.xmlElementToString((XmlElement) output)); } return output; } catch (WorkflowException e) { logger.error(e.getMessage(), e); // An appropriate message has been set in the exception. if (!this.failerSent) { this.notifier.invocationFailed(e.getMessage(), e); } throw e; } catch (RuntimeException e) { logger.error(e.getMessage(), e); String message = "Error while waiting for a output: " + name; this.notifier.invocationFailed(message, e); throw new WorkflowException(message, e); } catch (Error e) { logger.error(e.getMessage(), e); String message = "Unexpected error: " + this.serviceInformation; this.notifier.invocationFailed(message, e); throw new WorkflowException(message, e); } }
public static void main(String[] args) { ExecutionManagerImpl a = new ExecutionManagerImpl(null); try { ExperimentAdvanceOptions b = a.createExperimentAdvanceOptions(); b.getCustomWorkflowOutputDataSettings().addNewOutputDataSettings("la", "di", "da", false); WorkflowContextHeaderBuilder c = AiravataAPIUtils.createWorkflowContextHeaderBuilder(b, "sheeeeeeeeeeee","meeee"); System.out.println(XMLUtil.xmlElementToString(c.getXml())); } catch (AiravataAPIInvocationException e) { e.printStackTrace(); } }
/** * @see xsul.xhandler.BaseHandler#processIncomingXml(org.xmlpull.v1.builder.XmlElement, * xsul.message_router.MessageContext) */ @Override public boolean processIncomingXml(XmlElement soapEnvelope, MessageContext context) throws DynamicInfosetInvokerException { logger.info("soapEnvelope: " + XMLUtil.xmlElementToString(soapEnvelope)); XmlElement soapHeader = soapEnvelope.element(null, XmlConstants.S_HEADER); XmlObject headerObject = null; if (soapHeader != null) { headerObject = XBeansUtil.xmlElementToXmlObject(soapHeader); } XmlElement soapBody = soapEnvelope.element(null, XmlConstants.S_BODY); XmlObject bodyObject = XBeansUtil.xmlElementToXmlObject(soapBody); XmlElement faultElement = soapBody.element(null, "Fault"); if (faultElement == null) { this.notifier.receivedResult(this.context, this.invocationContext, headerObject, bodyObject, RECEIVE_RESULT_MESSAGE); } else { this.notifier.receivedFault(this.context, this.invocationContext, headerObject, bodyObject, RECEIVE_FAULT_MESSAGE); } return super.processIncomingXml(soapEnvelope, context); } }
/** * Shows the dialog. */ public void show() { String name = this.node.getConfiguredName(); if (name == null) { name = this.node.getName(); } this.nameTextField.setText(name); this.descriptionTextArea.setText(this.node.getDescription()); XmlElement metadata = this.node.getMetadata(); String metadataText; if (metadata == null) { metadataText = WSConstants.EMPTY_APPINFO; } else { metadataText = XMLUtil.xmlElementToString(metadata); } this.metadataTextArea.setText(metadataText); this.dialog.show(); }
private void launchWorkflow(String experimentId, String workflowGraph, NameValue[] inputs, WorkflowContextHeaderBuilder builder) throws AiravataAPIInvocationException { try { builder.getWorkflowMonitoringContext().setExperimentId(experimentId); WorkflowInterpretorStub stub = new WorkflowInterpretorStub(getClient().getAiravataManager().getWorkflowInterpreterServiceURL().toString()); OMElement wchOMElement = AXIOMUtil.stringToOM(XMLUtil.xmlElementToString(builder .getXml())); wchOMElement.addAttribute("submissionUser", builder.getSubmissionUser(), wchOMElement.getNamespace()); stub._getServiceClient().addHeader( wchOMElement); stub.launchWorkflow(workflowGraph, experimentId, inputs); } catch (AxisFault e) { e.printStackTrace(); } catch (XMLStreamException e) { e.printStackTrace(); } catch (RemoteException e) { e.printStackTrace(); } }