Modified: 
ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/ASSIGN.java
URL: 
http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/ASSIGN.java?rev=883568&r1=883567&r2=883568&view=diff
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/ASSIGN.java 
(original)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/ASSIGN.java 
Tue Nov 24 01:48:48 2009
@@ -27,11 +27,13 @@
 import org.apache.ode.bpel.common.CorrelationKey;
 import org.apache.ode.bpel.common.FaultException;
 import org.apache.ode.bpel.evar.ExternalVariableModuleException;
+import org.apache.ode.bpel.evt.PartnerLinkContextModificationEvent;
 import org.apache.ode.bpel.evt.CorrelationSetWriteEvent;
 import org.apache.ode.bpel.evt.PartnerLinkModificationEvent;
 import org.apache.ode.bpel.evt.ScopeEvent;
 import org.apache.ode.bpel.evt.VariableModificationEvent;
 import org.apache.ode.bpel.extension.ExtensionOperation;
+import org.apache.ode.bpel.rapi.ContextData;
 import org.apache.ode.bpel.rtrep.common.extension.ExtensibilityQNames;
 import org.apache.ode.bpel.rtrep.common.extension.ExtensionContext;
 import org.apache.ode.bpel.rtrep.v2.channels.FaultData;
@@ -194,8 +196,12 @@
                 PartnerLinkInstance plval = 
_scopeFrame.resolve(pLinkRef.partnerLink);
                 replaceEndpointRefence(plval, rvalue);
                 se = new 
PartnerLinkModificationEvent(((OAssign.PartnerLinkRef) 
ocopy.to).partnerLink.getName());
+            } else if (ocopy.to instanceof OAssign.ContextRef) {
+                OAssign.ContextRef ctxRef = (OAssign.ContextRef) ocopy.to;
+                
getBpelRuntime().writeContextData(_scopeFrame.resolve(ctxRef.partnerLink), 
rvalue, ctxRef.contexts);
+                se = new 
PartnerLinkContextModificationEvent(ctxRef.partnerLink.getName(), rvalue);
             } else if (ocopy.to.getVariable().type instanceof 
OPropertyVarType) {
-                // For poperty assignment, the property, the variable that 
points to it and the correlation set
+                // For property assignment, the property, the variable that 
points to it and the correlation set
                 // all have the same name
                 CorrelationSetInstance csetInstance = 
_scopeFrame.resolveCorrelation(ocopy.to.getVariable().name);
                 CorrelationKey ckey = new 
CorrelationKey(csetInstance.declaration.getId(), new String[] { 
rvalue.getTextContent() });

Modified: 
ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/AssignHelper.java
URL: 
http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/AssignHelper.java?rev=883568&r1=883567&r2=883568&view=diff
==============================================================================
--- 
ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/AssignHelper.java 
(original)
+++ 
ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/AssignHelper.java 
Tue Nov 24 01:48:48 2009
@@ -19,11 +19,14 @@
 package org.apache.ode.bpel.rtrep.v2;
 
 import java.util.List;
+
 import javax.xml.namespace.QName;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.ode.bpel.common.FaultException;
 import org.apache.ode.bpel.evar.ExternalVariableModuleException;
+import org.apache.ode.bpel.rapi.ContextData;
 import org.apache.ode.bpel.rtrep.v2.OScope.Variable;
 import org.apache.ode.utils.DOMUtils;
 import org.apache.ode.utils.msg.MessageBundle;
@@ -201,7 +204,7 @@
     public Node evalLValue(OAssign.LValue to) throws FaultException, 
ExternalVariableModuleException {
         final OdeInternalInstance napi = getBpelRuntime();
         Node lval = null;
-        if (!(to instanceof OAssign.PartnerLinkRef)) {
+        if (!(to instanceof OAssign.PartnerLinkRef) && !(to instanceof 
OAssign.ContextRef)) {
             VariableInstance lvar;
             try {
                 lvar = _scopeFrame.resolve(to.getVariable());
@@ -284,6 +287,10 @@
                 __log.debug("RValue is a partner link, corresponding endpoint "
                         + tempVal.getClass().getName() + " has value " + 
DOMUtils.domToString(tempVal));
             retVal = tempVal;
+        } else if (from instanceof OAssign.ContextRef) {
+            OAssign.ContextRef ctxRef = (OAssign.ContextRef) from;
+            ContextData cdata = 
getBpelRuntime().fetchContextData(_scopeFrame.resolve(ctxRef.partnerLink));
+            retVal = evalQuery(cdata.toXML(ctxRef.contexts), null, 
ctxRef.location, getEvaluationContext());
         } else if (from instanceof OAssign.Expression) {
             OExpression expr = ((OAssign.Expression) from).expression;
             List<Node> l = getBpelRuntime().getExpLangRuntime().evaluate(expr, 
getEvaluationContext());

Modified: 
ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/EH_EVENT.java
URL: 
http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/EH_EVENT.java?rev=883568&r1=883567&r2=883568&view=diff
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/EH_EVENT.java 
(original)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/EH_EVENT.java 
Tue Nov 24 01:48:48 2009
@@ -35,6 +35,7 @@
 import org.apache.ode.bpel.rtrep.v2.channels.PickResponseChannelListener;
 import org.apache.ode.bpel.rtrep.v2.channels.TerminationChannel;
 import org.apache.ode.bpel.rtrep.v2.channels.TerminationChannelListener;
+import org.apache.ode.bpel.rapi.IOContext;
 import org.apache.ode.bpel.rapi.InvalidProcessException;
 import org.apache.ode.bpel.evt.VariableModificationEvent;
 import org.apache.ode.bpel.evar.ExternalVariableModuleException;
@@ -228,6 +229,9 @@
                         private static final long serialVersionUID = 
-4929999153478677288L;
 
                         public void onRequestRcvd(int selectorIdx, String 
mexId) {
+                            // invoke context interceptors
+                            
getBpelRuntime().invokeContextInterceptorsInbound(mexId, 
_scopeFrame.resolve(_oevent.partnerLink), IOContext.Direction.INBOUND);
+
                             // The receipt of the message causes a new scope 
to be created:
                             ScopeFrame ehScopeFrame = new ScopeFrame(_oevent,
                                     
getBpelRuntime().createScopeInstance(_scopeFrame.scopeInstanceId, _oevent),

Modified: 
ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/INVOKE.java
URL: 
http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/INVOKE.java?rev=883568&r1=883567&r2=883568&view=diff
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/INVOKE.java 
(original)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/INVOKE.java 
Tue Nov 24 01:48:48 2009
@@ -19,20 +19,20 @@
 package org.apache.ode.bpel.rtrep.v2;
 
 import java.util.Collection;
-import java.util.Date;
 
 import javax.xml.namespace.QName;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.ode.bpel.common.FaultException;
+import org.apache.ode.bpel.evar.ExternalVariableModuleException;
 import org.apache.ode.bpel.evt.VariableModificationEvent;
+import org.apache.ode.bpel.iapi.Resource;
+import org.apache.ode.bpel.rapi.IOContext;
 import org.apache.ode.bpel.rtrep.v2.channels.FaultData;
 import org.apache.ode.bpel.rtrep.v2.channels.InvokeResponseChannel;
 import org.apache.ode.bpel.rtrep.v2.channels.InvokeResponseChannelListener;
 import org.apache.ode.bpel.rtrep.v2.channels.TerminationChannelListener;
-import org.apache.ode.bpel.evar.ExternalVariableModuleException;
-import org.apache.ode.bpel.iapi.Resource;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 
@@ -98,7 +98,7 @@
             if (!isTwoWay) {
                 FaultData faultData = null;
                 getBpelRuntime().invoke(null, 
_scopeFrame.resolve(_oinvoke.partnerLink),
-                        _oinvoke.operation, outboundMsg, null);
+                        _oinvoke.operation, outboundMsg, null, 
computePropagationRules(_oinvoke, _oinvoke.getPropagates()));
                 _self.parent.completed(faultData, 
CompensationHandler.emptySet());
 
             } else /* two-way */{
@@ -107,7 +107,7 @@
 
                 final String mexId = 
getBpelRuntime().invoke(invokeResponseChannel.export(),
                         _scopeFrame.resolve(_oinvoke.partnerLink), 
_oinvoke.operation,
-                        outboundMsg, invokeResponseChannel);
+                        outboundMsg, invokeResponseChannel, 
computePropagationRules(_oinvoke, _oinvoke.getPropagates()));
 
                 setupListeners(mexId, invokeResponseChannel, outputVar);
             }
@@ -118,11 +118,15 @@
         }
     }
 
+    @SuppressWarnings("unchecked")
     private void setupListeners(final String mexId, final 
InvokeResponseChannel invokeResponseChannel, final VariableInstance outputVar) {
         object(false, new InvokeResponseChannelListener(invokeResponseChannel) 
{
             private static final long serialVersionUID = 4496880438819196765L;
 
             public void onResponse() {
+                // invoke context interceptors
+                getBpelRuntime().invokeContextInterceptorsInbound(mexId, 
_scopeFrame.resolve(_oinvoke.partnerLink), IOContext.Direction.OUTBOUND_REPLY);
+
                 // we don't have to write variable data -> this already
                 // happened in the nativeAPI impl
                 FaultData fault = null;
@@ -248,5 +252,5 @@
             return (Element) outboundMsg;
         } else return null;
     }
-
+    
 }

Modified: 
ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OAssign.java
URL: 
http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OAssign.java?rev=883568&r1=883567&r2=883568&view=diff
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OAssign.java 
(original)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OAssign.java 
Tue Nov 24 01:48:48 2009
@@ -21,6 +21,7 @@
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Set;
 
 import javax.xml.namespace.QName;
 
@@ -290,4 +291,27 @@
               return "{PLinkRef " + partnerLink + "!" + isMyEndpointReference 
+ "}";
           }
     }
+
+    public static class ContextRef extends OBase implements RValue, LValue {
+        private static final long serialVersionUID = 1L;
+        public OPartnerLink partnerLink;
+        public Set<String> contexts;
+        public OExpression location;
+
+        public ContextRef(OProcess owner) { super(owner); }
+
+        // Must fit in a LValue even if it's not variable based
+        public OScope.Variable getVariable() {
+            return null;
+        }
+
+        public boolean isCopyAll() {
+            return contexts.contains("*");
+        }
+        
+        public String toString() {
+            return "{PLinkRef " + partnerLink + "!" + contexts + 
+                (location == null ? "" : "->" + location.toString())+ "}";
+        }
+  }
 }

Added: 
ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OContextPropagation.java
URL: 
http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OContextPropagation.java?rev=883568&view=auto
==============================================================================
--- 
ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OContextPropagation.java
 (added)
+++ 
ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OContextPropagation.java
 Tue Nov 24 01:48:48 2009
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.rtrep.v2;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * Holds information about the context propagation settings of this 
+ * interaction activity.
+ * 
+ * @author Tammo van Lessen
+ */
+public class OContextPropagation implements Serializable {
+    private static final long serialVersionUID = -681709797256453402L;
+
+    /**
+     * Name of the context(s) to propagate.
+     */
+    public List<String> contexts;
+    
+    /**
+     * the variable to get the context data from.
+     */
+    public OScope.Variable fromVariable;
+
+    /**
+     * the partnerLink to get the context data from.
+     */
+    public OPartnerLink fromPartnerLink;
+
+}

Modified: 
ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OInvoke.java
URL: 
http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OInvoke.java?rev=883568&r1=883567&r2=883568&view=diff
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OInvoke.java 
(original)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OInvoke.java 
Tue Nov 24 01:48:48 2009
@@ -20,6 +20,7 @@
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Set;
 
 import javax.wsdl.Operation;
 
@@ -34,6 +35,7 @@
     public OScope.Variable outputVar;
     public Operation operation;
     public OResource resource;
+    public Set<OContextPropagation> propagates;
 
     /** Correlation sets initialized on the input message. */
     public final List<OScope.CorrelationSet> initCorrelationsInput = new 
ArrayList<OScope.CorrelationSet>();
@@ -67,4 +69,7 @@
         return resource != null;
     }
 
+    public Set<OContextPropagation> getPropagates() {
+        return propagates;
+    }
 }

Modified: 
ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OPartnerLink.java
URL: 
http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OPartnerLink.java?rev=883568&r1=883567&r2=883568&view=diff
==============================================================================
--- 
ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OPartnerLink.java 
(original)
+++ 
ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OPartnerLink.java 
Tue Nov 24 01:48:48 2009
@@ -20,6 +20,7 @@
 
 import org.apache.ode.bpel.rapi.PartnerLinkModel;
 import org.apache.ode.bpel.rapi.CorrelationSetModel;
+import org.apache.ode.bpel.rapi.ScopeModel;
 
 import javax.wsdl.Operation;
 import javax.wsdl.PortType;
@@ -70,7 +71,11 @@
     public String getName() {
         return name;
     }
-
+    
+    public ScopeModel getDeclaringScope() {
+       return declaringScope;
+    }
+    
     public String getMyRoleName() {
         return myRoleName;
     }

Modified: 
ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OReply.java
URL: 
http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OReply.java?rev=883568&r1=883567&r2=883568&view=diff
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OReply.java 
(original)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OReply.java 
Tue Nov 24 01:48:48 2009
@@ -20,6 +20,7 @@
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Set;
 
 import javax.wsdl.Operation;
 import javax.xml.namespace.QName;
@@ -27,7 +28,7 @@
 /**
  * Compiled representation of the BPEL <code>&lt;reply&gt;</code> activity.
  */
-public class OReply extends OActivity {
+public class OReply extends OActivity implements OComm {
   
     static final long serialVersionUID = -1L  ;
 
@@ -42,6 +43,7 @@
     public OPartnerLink partnerLink;
     public Operation operation;
     public OScope.Variable variable;
+    public Set<OContextPropagation> propagates;
 
     /** Correlation sets initialized. */
     public final List<OScope.CorrelationSet> initCorrelations = new 
ArrayList<OScope.CorrelationSet>();
@@ -55,4 +57,25 @@
     public OReply(OProcess owner, OActivity parent) {
         super(owner, parent);
     }
+    
+    public Set<OContextPropagation> getPropagates() {
+        return propagates;
+    }
+
+    public Operation getOperation() {
+        return operation;
+    }
+
+    public OPartnerLink getPartnerLink() {
+        return partnerLink;
+    }
+
+    public OResource getResource() {
+        return resource;
+    }
+
+    public boolean isRestful() {
+        return resource != null;
+    }
+
 }

Modified: 
ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OdeInternalInstance.java
URL: 
http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OdeInternalInstance.java?rev=883568&r1=883567&r2=883568&view=diff
==============================================================================
--- 
ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OdeInternalInstance.java
 (original)
+++ 
ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OdeInternalInstance.java
 Tue Nov 24 01:48:48 2009
@@ -1,24 +1,31 @@
 package org.apache.ode.bpel.rtrep.v2;
 
-import org.apache.ode.bpel.common.FaultException;
+import java.net.URI;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.wsdl.Operation;
+import javax.xml.namespace.QName;
+
 import org.apache.ode.bpel.common.CorrelationKey;
+import org.apache.ode.bpel.common.FaultException;
 import org.apache.ode.bpel.evar.ExternalVariableModuleException;
-import org.apache.ode.bpel.rtrep.v2.channels.TimerResponseChannel;
+import org.apache.ode.bpel.evt.ProcessInstanceStartedEvent;
+import org.apache.ode.bpel.evt.ScopeEvent;
+import org.apache.ode.bpel.extension.ExtensionOperation;
+import org.apache.ode.bpel.iapi.ProcessConf.PropagationRule;
+import org.apache.ode.bpel.rapi.ContextData;
+import org.apache.ode.bpel.rapi.PartnerLink;
+import org.apache.ode.bpel.rapi.IOContext.Direction;
 import org.apache.ode.bpel.rtrep.v2.channels.ActivityRecoveryChannel;
-import org.apache.ode.bpel.rtrep.v2.channels.PickResponseChannel;
 import org.apache.ode.bpel.rtrep.v2.channels.FaultData;
-import org.apache.ode.bpel.extension.ExtensionOperation;
-import org.apache.ode.bpel.evt.ScopeEvent;
-import org.apache.ode.bpel.evt.ProcessInstanceStartedEvent;
-import org.w3c.dom.Node;
+import org.apache.ode.bpel.rtrep.v2.channels.PickResponseChannel;
+import org.apache.ode.bpel.rtrep.v2.channels.TimerResponseChannel;
 import org.w3c.dom.Element;
-
-import javax.wsdl.Operation;
-import javax.xml.namespace.QName;
-import java.util.Collection;
-import java.util.Date;
-import java.util.Map;
-import java.net.URI;
+import org.w3c.dom.Node;
 
 
 public interface OdeInternalInstance {
@@ -44,7 +51,7 @@
 
     String getInstantiatingUrl();
 
-    String invoke(String invokeId, PartnerLinkInstance instance, Operation 
operation, Element outboundMsg, Object object)
+    String invoke(String invokeId, PartnerLinkInstance instance, Operation 
operation, Element outboundMsg, Object object, 
Set<org.apache.ode.bpel.rapi.PropagationRule> propagationRules)
             throws FaultException;
 
     String invoke(String requestId, org.apache.ode.bpel.iapi.Resource 
resource, Element outgoingMessage)
@@ -160,9 +167,14 @@
 
     void associateEvent(ResourceInstance resourceInstance, String mexRef, 
String scopeIid);
 
-    void reply(PartnerLinkInstance plink, String opName, String bpelmex, 
Element element, QName fault)
+    void reply(PartnerLinkInstance plink, String opName, String bpelmex, 
Element element, QName fault, Set<org.apache.ode.bpel.rapi.PropagationRule> 
propagationRules)
             throws FaultException;
 
     void reply(ResourceInstance resource, String bpelmex, Element element, 
QName fault) throws FaultException;
 
+    void invokeContextInterceptorsInbound(String mexId, PartnerLink pl, 
Direction dir);
+    ContextData fetchContextData(PartnerLink pLink);
+    void writeContextData(PartnerLink pLink, Node ctxData, Set<String> 
contextsFilter);
+
+       List<PropagationRule> getPropagationRules();
 }

Modified: 
ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/PICK.java
URL: 
http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/PICK.java?rev=883568&r1=883567&r2=883568&view=diff
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/PICK.java 
(original)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/PICK.java Tue 
Nov 24 01:48:48 2009
@@ -34,6 +34,7 @@
 import org.apache.ode.bpel.rtrep.v2.channels.PickResponseChannel;
 import org.apache.ode.bpel.rtrep.v2.channels.PickResponseChannelListener;
 import org.apache.ode.bpel.rtrep.v2.channels.TerminationChannelListener;
+import org.apache.ode.bpel.rapi.IOContext;
 import org.apache.ode.bpel.rapi.InvalidProcessException;
 import org.apache.ode.utils.DOMUtils;
 import org.apache.ode.utils.xsd.Duration;
@@ -279,6 +280,9 @@
                 public void onRequestRcvd(int selectorIdx, String mexId) {
                     OPickReceive.OnMessage onMessage = 
_opick.onMessages.get(selectorIdx);
 
+                    // invoke context interceptors
+                    getBpelRuntime().invokeContextInterceptorsInbound(mexId, 
_scopeFrame.resolve(onMessage.partnerLink), IOContext.Direction.INBOUND);
+                    
                     // dead path the non-selected onMessage blocks.
                     for (OPickReceive.OnMessage onmsg : _opick.onMessages) {
                         if (!onmsg.equals(onMessage)) {

Modified: 
ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/PartnerLinkInstance.java
URL: 
http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/PartnerLinkInstance.java?rev=883568&r1=883567&r2=883568&view=diff
==============================================================================
--- 
ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/PartnerLinkInstance.java
 (original)
+++ 
ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/PartnerLinkInstance.java
 Tue Nov 24 01:48:48 2009
@@ -32,17 +32,17 @@
 public class PartnerLinkInstance implements Serializable, PartnerLink {
     private static final long serialVersionUID = 1L;
 
-    public OPartnerLink partnerLink;
+    public PartnerLinkModel partnerLink;
 
     public Long scopeInstanceId;
 
-    public PartnerLinkInstance(Long scopeInstanceId, OPartnerLink partnerLink) 
{
+    public PartnerLinkInstance(Long scopeInstanceId, PartnerLinkModel 
partnerLink) {
         this.partnerLink = partnerLink;
         this.scopeInstanceId = scopeInstanceId;
     }
 
     public String getName() {
-        return partnerLink.name;
+        return partnerLink.getName();
     }
 
     public PartnerLinkModel getModel() {

Modified: 
ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/REPLY.java
URL: 
http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/REPLY.java?rev=883568&r1=883567&r2=883568&view=diff
==============================================================================
--- ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/REPLY.java 
(original)
+++ ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/REPLY.java 
Tue Nov 24 01:48:48 2009
@@ -18,13 +18,10 @@
  */
 package org.apache.ode.bpel.rtrep.v2;
 
-import org.apache.ode.bpel.common.FaultException;
-import org.apache.ode.bpel.rtrep.v2.channels.FaultData;
-
-import java.util.Iterator;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.ode.bpel.common.FaultException;
+import org.apache.ode.bpel.rtrep.v2.channels.FaultData;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 
@@ -67,13 +64,13 @@
                         mid+eventFrameId, (Element)msg, oreply.fault);
             else
                 
getBpelRuntime().reply(_scopeFrame.resolve(oreply.partnerLink), 
oreply.operation.getName(),
-                        mid, (Element)msg, oreply.fault);
+                        mid, (Element)msg, oreply.fault, 
computePropagationRules(oreply, oreply.getPropagates()));
         } catch (FaultException e) {
             __log.error(e);
             fault = createFault(e.getQName(), oreply);
             try {
                    
getBpelRuntime().reply(_scopeFrame.resolve(oreply.partnerLink), 
oreply.operation.getName(),
-                           oreply.messageExchangeId, (Element)msg, 
e.getQName());
+                           oreply.messageExchangeId, (Element)msg, 
e.getQName(), computePropagationRules(oreply, oreply.getPropagates()));
             } catch (FaultException fe) {
                 fault = createFault(e.getQName(), oreply);
             }

Modified: 
ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/RuntimeInstanceImpl.java
URL: 
http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/RuntimeInstanceImpl.java?rev=883568&r1=883567&r2=883568&view=diff
==============================================================================
--- 
ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/RuntimeInstanceImpl.java
 (original)
+++ 
ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/RuntimeInstanceImpl.java
 Tue Nov 24 01:48:48 2009
@@ -4,7 +4,9 @@
 import java.io.OutputStream;
 import java.util.Collection;
 import java.util.Date;
+import java.util.List;
 import java.util.Map;
+import java.util.Set;
 import java.net.URI;
 
 import javax.wsdl.Operation;
@@ -17,11 +19,13 @@
 import org.apache.ode.bpel.evt.ProcessInstanceStartedEvent;
 import org.apache.ode.bpel.evt.ScopeEvent;
 import org.apache.ode.bpel.rapi.*;
+import org.apache.ode.bpel.rapi.IOContext.Direction;
 import org.apache.ode.bpel.rtrep.v2.channels.*;
 import org.apache.ode.bpel.extension.ExtensionOperation;
 import org.apache.ode.bpel.evar.ExternalVariableModuleException;
 import org.apache.ode.bpel.evar.IncompleteKeyException;
 import org.apache.ode.bpel.iapi.BpelEngineException;
+import org.apache.ode.bpel.iapi.ProcessConf.PropagationRule;
 import org.apache.ode.bpel.extension.ExtensionBundleRuntime;
 import org.apache.ode.jacob.JacobRunnable;
 import org.apache.ode.jacob.vpu.ExecutionQueueImpl;
@@ -483,7 +487,7 @@
         if(!getORM().associateEvent(plinkInstance, opName, key, mexRef, 
mexDAO)) {
             //For conflicting request, we need to reply immediately to 
incoming event.
             try {
-                _brc.reply(mexDAO, plinkInstance, opName, null, 
_runtime._oprocess.constants.qnConflictingRequest);
+                _brc.reply(mexDAO, plinkInstance, opName, null, 
_runtime._oprocess.constants.qnConflictingRequest, null);
             } catch (NoSuchOperationException e) {
                 throw new IllegalStateException(e);
             }
@@ -495,13 +499,13 @@
         getORM().associateEvent(resourceInstance, 
resourceInstance.getModel().getMethod(), mexRef, scopeIid);
     }
 
-    public void reply(PartnerLinkInstance plink, String opName, String 
bpelmex, Element element, QName fault) throws FaultException {
+    public void reply(PartnerLinkInstance plink, String opName, String 
bpelmex, Element element, QName fault, 
Set<org.apache.ode.bpel.rapi.PropagationRule> propagationRules) throws 
FaultException {
         String mexid = getORM().release(plink, opName, bpelmex);
         if (mexid == null)
             throw new 
FaultException(_runtime._oprocess.constants.qnMissingRequest);
 
         try {
-            _brc.reply(mexid, plink, opName, element, fault);
+            _brc.reply(mexid, plink, opName, element, fault, propagationRules);
         } catch (NoSuchOperationException e) {
             // reply to operation that is either not defined or one-way. 
Perhaps this should be detected at compile time?
             throw new 
FaultException(_runtime._oprocess.constants.qnMissingRequest,
@@ -644,10 +648,10 @@
      * @param outboundMsg
      * @param object
      */
-    public String invoke(String invokeId, PartnerLinkInstance instance, 
Operation operation, Element outboundMsg, Object object)
+    public String invoke(String invokeId, PartnerLinkInstance instance, 
Operation operation, Element outboundMsg, Object object, 
Set<org.apache.ode.bpel.rapi.PropagationRule> propagationRules)
             throws FaultException {
         try {
-            return _brc.invoke(invokeId, instance, operation, outboundMsg);
+            return _brc.invoke(invokeId, instance, operation, outboundMsg, 
propagationRules);
         } catch (UninitializedPartnerEPR e) {
             throw new 
FaultException(_runtime._oprocess.constants.qnUninitializedPartnerRole);
         }
@@ -840,4 +844,21 @@
        public Node getProcessProperty(QName propertyName) {
                return _brc.getProcessProperty(propertyName);
        }
+
+       public void invokeContextInterceptorsInbound(String mexId, PartnerLink 
pl,
+                       Direction dir) {
+               _brc.invokeContextInterceptorsInbound(mexId, pl, dir);
+       }
+
+       public List<PropagationRule> getPropagationRules() {
+               return _brc.getPropagationRules();
+       }
+
+    public ContextData fetchContextData(PartnerLink pLink) {
+        return _brc.fetchContextData(pLink);
+    }
+
+    public void writeContextData(PartnerLink pLink, Node ctxData, Set<String> 
contextsFilter) {
+        _brc.writeContextData(pLink, ctxData, contextsFilter);
+    }
 }

Modified: 
ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/ScopeFrame.java
URL: 
http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/ScopeFrame.java?rev=883568&r1=883567&r2=883568&view=diff
==============================================================================
--- 
ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/ScopeFrame.java 
(original)
+++ 
ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/ScopeFrame.java 
Tue Nov 24 01:48:48 2009
@@ -21,6 +21,8 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.ode.bpel.evt.ScopeEvent;
+import org.apache.ode.bpel.rapi.PartnerLinkModel;
+import org.apache.ode.bpel.rapi.ScopeModel;
 import org.apache.ode.bpel.rtrep.v2.channels.FaultData;
 
 import java.io.Serializable;
@@ -82,7 +84,7 @@
     }
 
 
-    public ScopeFrame find(OScope scope) {
+    public ScopeFrame find(ScopeModel scope) {
         if (oscope.getId() == scope.getId()) return this;
         return (parent != null) ? parent.find(scope) : null;
     }
@@ -121,8 +123,8 @@
         return new 
ResourceInstance(find(resource.getDeclaringScope()).scopeInstanceId, resource);
     }
 
-    public PartnerLinkInstance resolve(OPartnerLink partnerLink) {
-        return new 
PartnerLinkInstance(find(partnerLink.declaringScope).scopeInstanceId, 
partnerLink);
+    public PartnerLinkInstance resolve(PartnerLinkModel partnerLink) {
+        return new 
PartnerLinkInstance(find(partnerLink.getDeclaringScope()).scopeInstanceId, 
partnerLink);
     }
 
     public String toString() {

Modified: 
ode/trunk/runtimes/src/test/java/org/apache/ode/bpel/rtrep/v2/CoreBpelTest.java
URL: 
http://svn.apache.org/viewvc/ode/trunk/runtimes/src/test/java/org/apache/ode/bpel/rtrep/v2/CoreBpelTest.java?rev=883568&r1=883567&r2=883568&view=diff
==============================================================================
--- 
ode/trunk/runtimes/src/test/java/org/apache/ode/bpel/rtrep/v2/CoreBpelTest.java 
(original)
+++ 
ode/trunk/runtimes/src/test/java/org/apache/ode/bpel/rtrep/v2/CoreBpelTest.java 
Tue Nov 24 01:48:48 2009
@@ -21,10 +21,12 @@
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.net.URI;
+import java.util.Collection;
 import java.util.Date;
 import java.util.HashMap;
-import java.util.Collection;
+import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 import javax.wsdl.Operation;
 import javax.xml.namespace.QName;
@@ -33,19 +35,27 @@
 
 import org.apache.ode.bpel.common.CorrelationKey;
 import org.apache.ode.bpel.common.FaultException;
-import org.apache.ode.bpel.evt.ScopeEvent;
-import org.apache.ode.bpel.evt.ProcessInstanceStartedEvent;
-import org.apache.ode.jacob.vpu.ExecutionQueueImpl;
-import org.apache.ode.jacob.vpu.JacobVPU;
 import org.apache.ode.bpel.evar.ExternalVariableModuleException;
-import org.apache.ode.bpel.rapi.*;
-import org.apache.ode.bpel.rtrep.v2.channels.*;
+import org.apache.ode.bpel.evt.ProcessInstanceStartedEvent;
+import org.apache.ode.bpel.evt.ScopeEvent;
 import org.apache.ode.bpel.extension.ExtensionOperation;
-import org.apache.ode.bpel.iapi.*;
 import org.apache.ode.bpel.iapi.Resource;
+import org.apache.ode.bpel.iapi.ProcessConf.PropagationRule;
+import org.apache.ode.bpel.rapi.ContextData;
+import org.apache.ode.bpel.rapi.FaultInfo;
+import org.apache.ode.bpel.rapi.OdeRTInstanceContext;
+import org.apache.ode.bpel.rapi.PartnerLink;
+import org.apache.ode.bpel.rapi.VariableContext;
+import org.apache.ode.bpel.rapi.IOContext.Direction;
+import org.apache.ode.bpel.rtrep.v2.channels.ActivityRecoveryChannel;
+import org.apache.ode.bpel.rtrep.v2.channels.FaultData;
+import org.apache.ode.bpel.rtrep.v2.channels.PickResponseChannel;
+import org.apache.ode.bpel.rtrep.v2.channels.TimerResponseChannel;
+import org.apache.ode.jacob.vpu.ExecutionQueueImpl;
+import org.apache.ode.jacob.vpu.JacobVPU;
+import org.junit.Assert;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
-import org.junit.Assert;
 
 /**
  * Test core BPEL processing capabilities.
@@ -154,7 +164,7 @@
     public void cancelOutstandingRequests(String channelId) {
     }
 
-    public String invoke(String invokeId, PartnerLinkInstance instance, 
Operation operation, Element outboundMsg, Object object) throws FaultException {
+    public String invoke(String invokeId, PartnerLinkInstance instance, 
Operation operation, Element outboundMsg, Object object, 
Set<org.apache.ode.bpel.rapi.PropagationRule> propagationRules) throws 
FaultException {
         return null;  //To change body of implemented methods use File | 
Settings | File Templates.
     }
 
@@ -210,7 +220,7 @@
         return null;  //To change body of implemented methods use File | 
Settings | File Templates.
     }
 
-    public void reply(PartnerLinkInstance plink, String opName, String 
bpelmex, Element element, QName fault) throws FaultException {
+    public void reply(PartnerLinkInstance plink, String opName, String 
bpelmex, Element element, QName fault, 
Set<org.apache.ode.bpel.rapi.PropagationRule> propagationRules) throws 
FaultException {
         //To change body of implemented methods use File | Settings | File 
Templates.
     }
 
@@ -548,4 +558,31 @@
        public void completeExtensionActivity(String channelId, FaultData 
faultData) {
                // TODO Auto-generated method stub
        }
+
+       public void invokeContextInterceptorsInbound(String mexId, PartnerLink 
pl,
+                       Direction dir) {
+               // TODO Auto-generated method stub
+       }
+
+       public void invokeContextInterceptorsOutbound(String mexId, PartnerLink 
pl,
+                       Set<org.apache.ode.bpel.rapi.PropagationRule> 
propagationRules) {
+               // TODO Auto-generated method stub
+       }
+
+       public List<PropagationRule> getPropagationRules() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+    public ContextData fetchContextData(PartnerLink pLink) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public void writeContextData(PartnerLink pLink, Node ctxData,
+            Set<String> ctxFilter) {
+        // TODO Auto-generated method stub
+        
+    }
+
 }


Reply via email to