Package org.eclipse.bpel.model.extensions

Examples of org.eclipse.bpel.model.extensions.BPELExtensionSerializer


      }
      if (serviceRef.getValue() != null) {
        Object value = serviceRef.getValue();
        if (value instanceof ExtensibilityElement) {
          ExtensibilityElement extensibilityElement = (ExtensibilityElement)value;
          BPELExtensionSerializer serializer = null;
          QName qname = extensibilityElement.getElementType();
          try {
              serializer=(BPELExtensionSerializer)extensionRegistry.querySerializer(ExtensibleElement.class,qname);
          } catch (WSDLException e) {
          }
         
          if (serializer != null) {
            // Deserialize the DOM element and add the new Extensibility element to the parent
            // ExtensibleElement
            DocumentFragment fragment=document.createDocumentFragment();
            try {
                serializer.marshall(ExtensibleElement.class,qname,extensibilityElement,fragment,process,extensionRegistry);
              Element child = (Element)fragment.getFirstChild();
              serviceRefElement.appendChild(child);
            } catch (WSDLException e) {
              throw new WrappedException(e);
            }
          }
        } else {
          ServiceReferenceSerializer serializer = extensionRegistry.getServiceReferenceSerializer(referenceScheme);
          if (serializer != null) {
            DocumentFragment fragment=document.createDocumentFragment();
              serializer.marshall(value, fragment, process, from, this);
            Element child = (Element)fragment.getFirstChild();
            serviceRefElement.appendChild(child);
          } else {
            CDATASection cdata = BPELUtils.createCDATASection(document, serviceRef.getValue().toString());
            serviceRefElement.appendChild(cdata);
View Full Code Here


    }
    if (expression.getBody() != null) {
      Object body = expression.getBody();
      if (body instanceof ExtensibilityElement) {
        ExtensibilityElement extensibilityElement = (ExtensibilityElement)body;
        BPELExtensionSerializer serializer = null;
        QName qname = extensibilityElement.getElementType();
        try {
            serializer=(BPELExtensionSerializer)extensionRegistry.querySerializer(ExtensibleElement.class,qname);
        } catch (WSDLException e) {
          return null;
        }
       
        // Deserialize the DOM element and add the new Extensibility element to the parent
        // ExtensibleElement
        DocumentFragment fragment=document.createDocumentFragment();
        try {
            serializer.marshall(ExtensibleElement.class,qname,extensibilityElement,fragment,process,extensionRegistry);
          Element child = (Element)fragment.getFirstChild();
          expressionElement.appendChild(child);
        } catch (WSDLException e) {
          throw new WrappedException(e);
        }
View Full Code Here

    // Loop through the extensibility elements
    for (Iterator i=extensibilityElements.iterator(); i.hasNext(); ) {
      ExtensibilityElement extensibilityElement=(ExtensibilityElement)i.next();
     
      // Lookup a serializer for the extensibility element
      BPELExtensionSerializer serializer=null;
      QName qname=extensibilityElement.getElementType();
      try {
        serializer=(BPELExtensionSerializer)extensionRegistry.querySerializer(ExtensibleElement.class,qname);
      } catch (WSDLException e) {
        // TODO: Exception handling
      }
      if (serializer!=null) {
       
        // Create a temp document fragment for the serializer
        DocumentFragment fragment=document.createDocumentFragment();
       
        // Serialize the extensibility element into the parent DOM element
        try {
          serializer.marshall(ExtensibleElement.class,qname,extensibilityElement,fragment,process,extensionRegistry);
        } catch (WSDLException e) {
          throw new WrappedException(e);
        }
       
        Node tempElement=(Element)fragment.getFirstChild();
View Full Code Here

  /**
   * Convert a BPEL ExtensibilityElement to XML
   */
  protected Element extensibilityElement2XML(ExtensibilityElement extensibilityElement) {
     
    BPELExtensionSerializer serializer=null;
    QName qname=extensibilityElement.getElementType();
    try {
      serializer=(BPELExtensionSerializer)extensionRegistry.querySerializer(ExtensibleElement.class,qname);
    } catch (WSDLException e) {
      return null;
    }
   
    // Deserialize the DOM element and add the new Extensibility element to the parent
    // ExtensibleElement
    DocumentFragment fragment=document.createDocumentFragment();
    try {
      serializer.marshall(ExtensibleElement.class,qname,extensibilityElement,fragment,process,extensionRegistry);
      return (Element)fragment.getFirstChild();
    } catch (WSDLException e) {
      throw new WrappedException(e);
    }
  } 
View Full Code Here

TOP

Related Classes of org.eclipse.bpel.model.extensions.BPELExtensionSerializer

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.