Package org.xmlpull.infoset

Examples of org.xmlpull.infoset.XmlNamespace


     */
    public static EventType getType(XmlElement event) {
        if (event == null) {
            throw new IllegalArgumentException("null");
        }
        XmlNamespace ns = event.getNamespace();
        String name = event.getName();
        if (XBAYA_EVENTS_NS.equals(ns)) {
            if (GOT_RESULT_EVENT_TAG.equals(name)) {
                return EventType.WORKFLOW_TERMINATED;
            } else {
View Full Code Here


    }

    private void addInitialReceive(GpelSequence sequence) {
        // Create a partner link
        String partnerLinkName = WORKFLOW_PARTNER_LINK;
        XmlNamespace partnerLinkTypeNS = this.workflowWSDL.getTargetNamespace();
        String partnerLinkTypeName = this.workflowPrefix + PARTNER_LINK_TYPE_SUFFIX;
        String myRollName = this.workflowPrefix + MY_ROLE_SUFFIX;

        this.process.addPartnerLink(partnerLinkName, partnerLinkTypeNS, partnerLinkTypeName, myRollName, null);
        this.workflowWSDL.addPartnerLinkTypeAndRoll(partnerLinkTypeName, myRollName,
View Full Code Here

        WSComponent wsdlComponent = node.getComponent();
        String operation = wsdlComponent.getOperationName();

        QName portTypeQName = wsdlComponent.getPortTypeQName();
        XmlNamespace namespace = XMLUtil.declareNamespaceIfNecessary(id.toLowerCase(), portTypeQName.getNamespaceURI(),
                false, this.process.xml());

        // Variable
        String inputVariableName = id + INPUT_SUFFIX;
        this.process.addMessageVariable(inputVariableName, namespace, portTypeQName.getLocalPart());
        String outputVariableName = id + OUTPUT_SUFFIX;
        this.process.addMessageVariable(outputVariableName, namespace, portTypeQName.getLocalPart());

        // Assign
        List<GpelAssignCopy> copies = new ArrayList<GpelAssignCopy>();
        for (Port port : node.getInputPorts()) {
            Port fromPort = port.getFromPort();
            if (fromPort == null) {
                // optional input
                continue;
            }
            GpelAssignCopyFrom from = createAssignCopyFrom(port);
            GpelAssignCopyTo to = createAssignCopyTo(port, true);

            GpelAssignCopy copy = new GpelAssignCopy(this.bpelNS, from, to);
            copies.add(copy);
        }

        GpelAssign assign = new GpelAssign(this.bpelNS, copies);
        sequence.addActivity(assign);

        PartnerLinkRole partnerRoll = this.workflowWSDL.getPartnerRoll(portTypeQName);
        if (partnerRoll == null) {
            String partnerLinkTypeName = id + PARTNER_LINK_TYPE_SUFFIX;
            String partnerRollName = id + PARTNER_ROLE_SUFFIX;
            partnerRoll = this.workflowWSDL.addPartnerLinkTypeAndRoll(partnerLinkTypeName, partnerRollName,
                    portTypeQName);
        }
        PartnerLinkType partnerLinkType = partnerRoll.getPartnerLinkType();

        // partnerLink
        String partnerLinkName = createPartnerLinkName(id);
        XmlNamespace partnerLinkTypeNS = this.targetNamespace;
        this.process.addPartnerLink(partnerLinkName, partnerLinkTypeNS, partnerLinkType.getName(), null,
                partnerRoll.getName());

        // Invoke
        GpelInvoke invoke = new GpelInvoke(this.bpelNS, partnerLinkName, namespace, portTypeQName.getLocalPart(),
View Full Code Here

            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) {
View Full Code Here

            return -1;
        }
        String typeQNameString = type.getValue();
        String typeName = XMLUtil.getLocalPartOfQName(typeQNameString);
        String prefix = XMLUtil.getPrefixOfQName(typeQNameString);
        XmlNamespace namespace = element.lookupNamespaceByPrefix(prefix);
        if (namespace == null) {
            return -1;
        }
        QName typeQname = new QName(namespace.getName(), typeName, prefix);
        int simpleTypeIndex = getSimpleTypeIndex(typeQname);
        if (-1 == simpleTypeIndex) {
            return -1;
        }
View Full Code Here

        XmlElement bpelElement = workflowElement.element(BPEL_TAG);
        if (bpelElement != null) {
            try {
                String bpelString = bpelElement.requiredText();
                XmlNamespace gpelNS = XmlInfosetBuilder.newInstance().newNamespace(BPELScript.GPEL, BPELScript.GPELNS);
                GpelConstants.GPEL_NS = gpelNS;
                this.gpelProcess = new GpelProcess(XMLUtil.stringToXmlElement(bpelString));
            } catch (RuntimeException e) {
                String error = "Failed to parse the BPEL document.";
                throw new GraphException(error, e);
View Full Code Here

     * @return
     */
    private String findNamespacePrefix(GpelProcess gpelProcess, QName messageQname) {
        Iterator<XmlNamespace> iterator = gpelProcess.xml().namespaces().iterator();
        while (iterator.hasNext()) {
            XmlNamespace xmlNamespace = (XmlNamespace) iterator.next();
            if (xmlNamespace.getName().equals(messageQname.getNamespaceURI())) {
                return xmlNamespace.getPrefix();
            }
        }

        throw new WorkflowRuntimeException("Cannot locate the Namespace  for Qname:" + messageQname + " in the BPEL");
    }
View Full Code Here

            // TODO fix this.
            this.type = WSConstants.XSD_ANY_TYPE;
        } else {
            String typeName = XMLUtil.getLocalPartOfQName(typeQNameString);
            String prefix = XMLUtil.getPrefixOfQName(typeQNameString);
            XmlNamespace namespace = null;
            if (prefix == null) {
                if ("string".equals(typeName) || "int".equals(typeName)) {
                    namespace = XmlConstants.BUILDER.newNamespace("xsd", WSConstants.XSD_NS_URI);
                    prefix = "xsd";
                } else {
                    throw new ComponentException("Namespace prefix, " + prefix + ", is not defined");
                }
            } else {
                namespace = element.lookupNamespaceByPrefix(prefix);
            }
            this.type = new QName(namespace.getName(), typeName, prefix);
        }

        // annotation
        this.annotation = element.element(null, WSConstants.ANNOTATION_TAG);
        if (this.annotation != null) {
View Full Code Here

        return element;
    }

    private void setTypeAttribute(XmlElement element, QName type) {
        String namespaceURI = type.getNamespaceURI();
        XmlNamespace namespace = element.lookupNamespaceByName(namespaceURI);
        element.setAttributeValue(WSConstants.TYPE_ATTRIBUTE, namespace.getPrefix() + ":" + type.getLocalPart());

    }
View Full Code Here

                    throw new WorkflowRuntimeException("Assign activity not found for the Invoke "
                            + next.xmlStringPretty());
                }

                GpelAssign assign = (GpelAssign) last;
                XmlNamespace ns = assign.xml().getNamespace();

                XmlElement container = XmlConstants.BUILDER.parseFragmentFromString("<dummyelement></dummyelement>");

                String portTypeattr = next.xml().attributeValue(PORT_TYPE_STR);
                String operation = next.xml().attributeValue(OPERATION_STR);
View Full Code Here

TOP

Related Classes of org.xmlpull.infoset.XmlNamespace

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.