tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lrese...@apache.org
Subject svn commit: r656408 - /incubator/tuscany/java/sca/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/provider/BPELInvoker.java
Date Wed, 14 May 2008 20:23:49 GMT
Author: lresende
Date: Wed May 14 13:23:49 2008
New Revision: 656408

URL: http://svn.apache.org/viewvc?rev=656408&view=rev
Log:
TUSCANY-2321 - Workaround to properly handle different DOM object types produced by data binding
framework

Modified:
    incubator/tuscany/java/sca/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/provider/BPELInvoker.java

Modified: incubator/tuscany/java/sca/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/provider/BPELInvoker.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/provider/BPELInvoker.java?rev=656408&r1=656407&r2=656408&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/provider/BPELInvoker.java
(original)
+++ incubator/tuscany/java/sca/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/provider/BPELInvoker.java
Wed May 14 13:23:49 2008
@@ -130,6 +130,13 @@
             mex = odeServer.getBpelServer().getEngine().createMessageExchange(new GUID().toString(),
                                                                               bpelServiceName,
                                                                               bpelOperationName);
+            /*
+            if(__log.isDebugEnabled()) {
+                Element invocationRequest = mex.getRequest().getMessage();
+                __log.debug(">>>Request:\n" + DOMUtils.domToString(invocationRequest));
+                
+            }*/
+            
             onhold = mex.invoke(createInvocationMessage(mex, args));
             
             txMgr.commit();
@@ -159,15 +166,15 @@
             // be sure we have the "freshest" one.
             mex = (MyRoleMessageExchange)odeServer.getBpelServer().getEngine().getMessageExchange(mex.getMessageExchangeId());
 
-            Status status = mex.getStatus();
-            Element invocationResponse = mex.getResponse().getMessage();
-        
             if(__log.isDebugEnabled()) {
-                __log.debug("Invocation status:" + status.name());
-                __log.debug("Response:\n" + DOMUtils.domToString(invocationResponse));
+                Status status = mex.getStatus();
+                Element invocationResponse = mex.getResponse().getMessage();
+
+                __log.debug(">>>Invocation status:" + status.name());
+                __log.debug(">>>Response:\n" + DOMUtils.domToString(invocationResponse));
             }
             //process the method invocation result
-            response = processResponse(invocationResponse);
+            response = processResponse(mex.getResponse().getMessage());
             
             txMgr.commit();
             // end of transaction two
@@ -201,15 +208,22 @@
         
         Element contentMessage = dom.createElement("message");
         Element contentPart = dom.createElement(bpelOperationInputPart.getName());
-        Element contentInvocation = (Element) args[0];
+        Element payload = null;
+        
+        //TUSCANY-2321 - Properly handling Document or Element types
+        if(args[0] instanceof Document) {
+            payload = (Element) ((Document) args[0]).getFirstChild();
+        } else {
+            payload = (Element) args[0];
+        }
         
-        contentPart.appendChild(dom.importNode(contentInvocation, true));
+        contentPart.appendChild(dom.importNode(payload, true));
         contentMessage.appendChild(contentPart);
         dom.appendChild(contentMessage);
         
         if(__log.isDebugEnabled()) {
             __log.debug("Creating invocation message:");
-            __log.debug(">> args.....: " + DOMUtils.domToString((Element) args[0]));
+            __log.debug(">> args.....: " + DOMUtils.domToString(payload));
             __log.debug(">> message..:" + DOMUtils.domToString(dom.getDocumentElement()));
         }
 



Mime
View raw message