Author: mriou
Date: Wed Aug 15 15:40:27 2007
New Revision: 566366
URL: http://svn.apache.org/viewvc?view=rev&rev=566366
Log:
ODE-177 Fixed again replies for messages having no parts. Few more debugs in
right places, less in wrong places.
Modified:
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelProcess.java
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/MessageExchangeImpl.java
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/BpelJacobRunnable.java
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PropertyAliasEvaluationContext.java
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/REPLY.java
Modified:
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelProcess.java
URL:
http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelProcess.java?view=diff&rev=566366&r1=566365&r2=566366
==============================================================================
---
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelProcess.java
(original)
+++
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelProcess.java
Wed Aug 15 15:40:27 2007
@@ -59,6 +59,7 @@
import org.apache.ode.bpel.runtime.channels.FaultData;
import org.apache.ode.jacob.soup.ReplacementMap;
import org.apache.ode.utils.ObjectPrinter;
+import org.apache.ode.utils.DOMUtils;
import org.apache.ode.utils.msg.MessageBundle;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -216,12 +217,13 @@
PropertyAliasEvaluationContext ectx = new
PropertyAliasEvaluationContext(msgData, alias);
Node lValue = ectx.getRootNode();
- if (alias.location != null)
+ if (alias.location != null) {
try {
lValue = _expLangRuntimeRegistry.evaluateNode(alias.location,
ectx);
} catch (EvaluationException ec) {
throw new
FaultException(getOProcess().constants.qnSelectionFailure,
alias.getDescription());
}
+ }
if (lValue == null) {
String errmsg =
__msgs.msgPropertyAliasReturnedNullSet(alias.getDescription(), target);
@@ -234,8 +236,7 @@
if (lValue.getNodeType() == Node.ELEMENT_NODE) {
// This is a bit hokey, we concatenate all the children's values;
we
// really should be checking to make sure that we are only dealing
- // with
- // text and attribute nodes.
+ // with text and attribute nodes.
StringBuffer val = new StringBuffer();
NodeList nl = lValue.getChildNodes();
for (int i = 0; i < nl.getLength(); ++i) {
Modified:
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
URL:
http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java?view=diff&rev=566366&r1=566365&r2=566366
==============================================================================
---
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
(original)
+++
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
Wed Aug 15 15:40:27 2007
@@ -69,6 +69,7 @@
import org.apache.ode.utils.ObjectPrinter;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
+import org.w3c.dom.Document;
import javax.wsdl.Operation;
import javax.xml.namespace.QName;
@@ -388,6 +389,17 @@
}
public Node fetchVariableData(VariableInstance variable, boolean
forWriting) throws FaultException {
+ // Special case of messageType variables with no part
+ if (variable.declaration.type instanceof OMessageVarType) {
+ OMessageVarType msgType = (OMessageVarType)
variable.declaration.type;
+ if (msgType.parts.size() == 0) {
+ Document doc = DOMUtils.newDocument();
+ Element root = doc.createElement("message");
+ doc.appendChild(root);
+ return root;
+ }
+ }
+
ScopeDAO scopeDAO = _dao.getScope(variable.scopeInstance);
XmlDataDAO dataDAO = scopeDAO.getVariable(variable.declaration.name);
Modified:
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/MessageExchangeImpl.java
URL:
http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/MessageExchangeImpl.java?view=diff&rev=566366&r1=566365&r2=566366
==============================================================================
---
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/MessageExchangeImpl.java
(original)
+++
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/MessageExchangeImpl.java
Wed Aug 15 15:40:27 2007
@@ -142,7 +142,7 @@
void setPortOp(PortType portType, Operation operation) {
if (__log.isTraceEnabled())
- __log.trace("Mex[" + getMessageExchangeId() +
"].setPortOp("+portType+","+operation+")");
+ __log.trace("Mex[" + getMessageExchangeId() + "].setPortOp(...)");
_portType = portType;
_operation = operation;
}
Modified:
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/BpelJacobRunnable.java
URL:
http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/BpelJacobRunnable.java?view=diff&rev=566366&r1=566365&r2=566366
==============================================================================
---
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/BpelJacobRunnable.java
(original)
+++
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/BpelJacobRunnable.java
Wed Aug 15 15:40:27 2007
@@ -93,6 +93,8 @@
OProcess.OProperty property = cset.declaration.properties.get(i);
propValues[i] = getBpelRuntimeContext().readProperty(variable,
property);
propNames[i] = property.name.toString();
+ if (__log.isDebugEnabled())
+ __log.debug("Setting correlation property " + propNames[i] + "="
+ propValues[i]);
}
CorrelationKey ckeyVal = new CorrelationKey(cset.declaration.getId(),
propValues);
Modified:
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PropertyAliasEvaluationContext.java
URL:
http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PropertyAliasEvaluationContext.java?view=diff&rev=566366&r1=566365&r2=566366
==============================================================================
---
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PropertyAliasEvaluationContext.java
(original)
+++
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PropertyAliasEvaluationContext.java
Wed Aug 15 15:40:27 2007
@@ -37,56 +37,55 @@
* Expression language evaluation context used for evaluating property aliases.
*/
public class PropertyAliasEvaluationContext implements EvaluationContext {
- private Element _root;
+ private Element _root;
- public PropertyAliasEvaluationContext(Element msgData,
OProcess.OPropertyAlias alias) {
- // We need to tweak the context node based on what kind of variable
(element vs non-element)
- if (alias.part == null) {
- // actually, this should not happen
-
- _root = msgData;
- } else {
- Element part = DOMUtils.findChildByName(msgData,new QName(null,
alias.part.name),false);
- if (part != null && alias.part.type instanceof OElementVarType) {
- _root = DOMUtils.findChildByName(part,
((OElementVarType)alias.part.type).elementType);
- } else
- _root = part;
- }
-
- }
-
- public Node getRootNode() {
- return _root;
- }
-
- public boolean isLinkActive(OLink olink) throws FaultException {
- throw new InvalidProcessException("Link status not available in this
context.");
- }
-
- public String readMessageProperty(OScope.Variable variable,
OProcess.OProperty property) throws FaultException {
- throw new InvalidProcessException("Message properties not available in
this context.");
- }
-
-
- public Node readVariable(OScope.Variable variable, OMessageVarType.Part
part) throws FaultException {
- throw new InvalidProcessException("Message variables not available in this
context.");
- }
-
- public Node evaluateQuery(Node root, OExpression expr) throws FaultException
{
- throw new InvalidProcessException("Query language not available in
this context.");
- }
-
- public Long getProcessId() {
- throw new InvalidProcessException("Process execution information not
available in this context.");
- }
-
- public Node getPartData(Element message, Part part) throws FaultException {
- // TODO Auto-generated method stub
- return null;
- }
+ public PropertyAliasEvaluationContext(Element msgData,
OProcess.OPropertyAlias alias) {
+ // We need to tweak the context node based on what kind of variable
(element vs non-element)
+ if (alias.part == null) {
+ // actually, this should not happen
+ _root = msgData;
+ } else {
+ Element part = DOMUtils.findChildByName(msgData,new QName(null,
alias.part.name),false);
+ if (part != null && alias.part.type instanceof OElementVarType) {
+ _root = DOMUtils.findChildByName(part,
((OElementVarType)alias.part.type).elementType);
+ } else
+ _root = part;
+ }
+
+ }
+
+ public Node getRootNode() {
+ return _root;
+ }
+
+ public boolean isLinkActive(OLink olink) throws FaultException {
+ throw new InvalidProcessException("Link status not available in this
context.");
+ }
+
+ public String readMessageProperty(OScope.Variable variable,
OProcess.OProperty property) throws FaultException {
+ throw new InvalidProcessException("Message properties not available in
this context.");
+ }
+
+
+ public Node readVariable(OScope.Variable variable, OMessageVarType.Part
part) throws FaultException {
+ throw new InvalidProcessException("Message variables not available in
this context.");
+ }
+
+ public Node evaluateQuery(Node root, OExpression expr) throws
FaultException {
+ throw new InvalidProcessException("Query language not available in
this context.");
+ }
+
+ public Long getProcessId() {
+ throw new InvalidProcessException("Process execution information not
available in this context.");
+ }
+
+ public Node getPartData(Element message, Part part) throws FaultException {
+ // TODO Auto-generated method stub
+ return null;
+ }
public boolean narrowTypes() {
return true;
}
-
+
}
Modified:
ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/REPLY.java
URL:
http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/REPLY.java?view=diff&rev=566366&r1=566365&r2=566366
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/REPLY.java
(original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/REPLY.java
Wed Aug 15 15:40:27 2007
@@ -63,11 +63,8 @@
// send reply
getBpelRuntimeContext()
.reply(_scopeFrame.resolve(oreply.partnerLink),
oreply.operation.getName(),
- oreply.messageExchangeId,
- (Element)msg,
- (oreply.fault != null)
- ? oreply.fault
- : null);
+ oreply.messageExchangeId, (Element)msg,
+ (oreply.fault != null) ? oreply.fault : null);
} catch (FaultException e) {
__log.error(e);
fault = createFault(e.getQName(), oreply);