Package org.apache.airavata.workflow.model.component.ws

Examples of org.apache.airavata.workflow.model.component.ws.WSComponentPort


  private String runExperimentGeneral(Workflow workflowObj, List<WorkflowInput> inputs, ExperimentAdvanceOptions options, EventDataListener listener) throws AiravataAPIInvocationException {
    try {
      String workflowString = XMLUtil.xmlElementToString(workflowObj.toXML());
      List<WSComponentPort> ports = getWSComponentPortInputs(workflowObj);
      for (WorkflowInput input : inputs) {
        WSComponentPort port = getWSComponentPort(input.getName(),
            ports);
        if (port != null) {
          port.setValue(input.getValue());
        }
      }
      List<NameValue> inputValues = new ArrayList<NameValue>();
      for (WSComponentPort port : ports) {
        NameValue nameValue = new NameValue();
        nameValue.setName(port.getName());
        if (port.getValue() == null) {
          nameValue.setValue(port.getDefaultValue());
        } else {
          nameValue.setValue(port.getValue().toString());
        }
        inputValues.add(nameValue);
      }
      String experimentID=options.getCustomExperimentId();
      String workflowTemplateName = workflowObj.getName();
View Full Code Here


    List<WSComponentPort> inputs = getInputs();
    List<InputNode> inputNodes = GraphUtil.getInputNodes(getGraph());
    List<WorkflowInput> results=new ArrayList<WorkflowInput>();
    for (InputNode port : inputNodes) {
      Object value=null;
      WSComponentPort wsComponentPort = getWSComponentPort(port.getName(), inputs);
      if (wsComponentPort!=null){
        value=wsComponentPort.getValue();
      }
      results.add(new WorkflowInput(port.getName(), port.getParameterType().getLocalPart(), port.getDefaultValue(), value, !port.isVisibility()));
    }
    return results;
  }
View Full Code Here

     */
    private void copyDefaultConfiguration(WSPort toWSPort) {
        // TODO support recursive search for WSPort in case the input is
        // connected to special nodes.
        setName(toWSPort.getName());
        WSComponentPort componentPort = toWSPort.getComponentPort();
        setDescription(componentPort.getDescription());
        setDefaultValue(componentPort.getDefaultValue());
        setMetadata(componentPort.getAppinfo());
    }
View Full Code Here

            if (edges.size() == 1) {
                setParameterType(fromType);

                if (!isConfigured() && fromDataPort instanceof WSPort) {
                    setName(fromDataPort.getName());
                    WSComponentPort componentPort = ((WSPort) fromDataPort).getComponentPort();
                    setDescription(componentPort.getDescription());
                    setMetadata(componentPort.getAppinfo());
                }
            } else {
                throw new GraphException("Cannot connect more than one output ports to the output parameter.");
            }
        }
View Full Code Here

     */
    private void copyDefaultConfiguration(WSPort toWSPort) {
        // TODO support recursive search for WSPort in case the input is
        // connected to special nodes.
        setName(toWSPort.getName());
        WSComponentPort componentPort = toWSPort.getComponentPort();
        setDescription(componentPort.getDescription());
        setDefaultValue(componentPort.getDefaultValue());
        setMetadata(componentPort.getAppinfo());
    }
View Full Code Here

        // Input ports need to be connected.
        Collection<Port> inputPorts = GraphUtil.getPorts(this.graph, Port.Kind.DATA_IN);
        for (Port inputPort : inputPorts) {
            ComponentPort componentPort = inputPort.getComponentPort();
            if (componentPort instanceof WSComponentPort) {
                WSComponentPort wsComponentPort = (WSComponentPort) componentPort;
                if (wsComponentPort.isOptional()) {
                    // optional input.
                    continue;
                }
            }
            Collection<Port> fromPorts = inputPort.getFromPorts();
View Full Code Here

            from.setLiteral(literalElement);
        } else if (fromNode instanceof WSNode) {
            String fromID = fromNode.getID();
            WSComponent fromWsdlComponent = (WSComponent) fromNode.getComponent();

            WSComponentPort fromWsdlPort = (WSComponentPort) fromPort.getComponentPort();

            from.setVariable(fromID + OUTPUT_SUFFIX);
            from.setPart(fromWsdlComponent.getOutputPartName());

            if (fromWsdlPort.isSchemaUsed()) {
                String typesTargetNamespace = fromWsdlPort.getTargetNamespace();
                XmlNamespace namespace = XMLUtil.declareNamespaceIfNecessary(fromID.toLowerCase() + TYPENS_SUFFIX,
                        typesTargetNamespace, false, this.process.xml());

                from.setQuery("/" + namespace.getPrefix() + ":" + fromWsdlComponent.getOutputTypeName() + "/"
                        + fromWsdlPort.getName());
            } else {
                // No query needed?
            }
        } else if (fromNode instanceof ForEachNode) {
            from.setVariable(fromNode.getID() + FOREACH_VALUE_SUFFIX);
View Full Code Here

            to.setVariable(WORKFLOW_OUTPUT_NAME);
            to.setPart(WorkflowWSDL.OUTPUT_PART_NAME);
            to.setQuery("/" + this.typesNamespace.getPrefix() + ":"
                    + this.workflowWSDL.getWorkflowOutputMessageElementName() + "/" + toNode.getID());
        } else {
            WSComponentPort toComponentPort = (WSComponentPort) toPort.getComponentPort();

            String toID = toNode.getID();
            WSComponent toWSComponent = (WSComponent) toNode.getComponent();
            to.setVariable(toID + INPUT_SUFFIX);
            to.setPart(toWSComponent.getInputPartName());

            if (toComponentPort.isSchemaUsed()) {
                // Normal case.
                // e.g. <part name="name" type="typens:fooType">
                String typesTargetNamespace = toComponentPort.getTargetNamespace();
                XmlNamespace namespace = XMLUtil.declareNamespaceIfNecessary(toID.toLowerCase() + TYPENS_SUFFIX,
                        typesTargetNamespace, false, this.process.xml());

                String typeName = input ? toWSComponent.getInputTypeName() : toWSComponent.getOutputTypeName();
                to.setQuery("/" + namespace.getPrefix() + ":" + typeName + "/" + toComponentPort.getName());
            } else {
                // e.g. <part name="name" type="xsd:string">
                // No query is needed?
            }
        }
View Full Code Here

        //
        // type
        //
        QName type = port.getType();
        WSComponentPort componentPort = port.getWSComponentPort();
        WsdlDefinitions wsdl = null;
        if (componentPort != null) {
            wsdl = componentPort.getComponent().getWSDL();
            type = declareTypeIfNecessary(wsdl, type);
        }
        int arrayDimension = port.getArrayDimension();
        if (arrayDimension == 1) {
            String typeName = declareArrayType(schema, type, wsdl);
            type = new QName(this.typesNamespace.getName(), typeName);
        } else if (arrayDimension > 1) {
            // TODO
            throw new WorkflowRuntimeException("multi-dimentional arrays are not supported yet.");
        }

        if (WSConstants.XSD_ANY_TYPE.equals(type) && componentPort != null) {
            XmlElement elementElement = componentPort.getElement();
            if (elementElement == null) {
                // Types are not defined anywhare. Leave it as xsd:any.
                setTypeAttribute(element, type);
            } else {
                // Copy the embedded type defition.
View Full Code Here

     */
    private void copyDefaultConfiguration(WSPort toWSPort) {
        // TODO support recursive search for WSPort in case the input is
        // connected to special nodes.
        setName(toWSPort.getName());
        WSComponentPort componentPort = toWSPort.getComponentPort();
        setDescription(componentPort.getDescription());
        setDefaultValue(componentPort.getDefaultValue());
        setMetadata(componentPort.getAppinfo());
    }
View Full Code Here

TOP

Related Classes of org.apache.airavata.workflow.model.component.ws.WSComponentPort

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.