You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by sa...@apache.org on 2015/12/30 07:18:59 UTC

ode git commit: ODE-829: Fixed in 1.3.7 for Hibernate DAO

Repository: ode
Updated Branches:
  refs/heads/ode-1.3.x 1c73c046b -> c0c7b497a


ODE-829: Fixed in 1.3.7 for Hibernate DAO


Project: http://git-wip-us.apache.org/repos/asf/ode/repo
Commit: http://git-wip-us.apache.org/repos/asf/ode/commit/c0c7b497
Tree: http://git-wip-us.apache.org/repos/asf/ode/tree/c0c7b497
Diff: http://git-wip-us.apache.org/repos/asf/ode/diff/c0c7b497

Branch: refs/heads/ode-1.3.x
Commit: c0c7b497a8ec1db2dd6d4ee36e00563a19285d16
Parents: 1c73c04
Author: sathwik <sa...@apache.org>
Authored: Wed Dec 30 11:48:39 2015 +0530
Committer: sathwik <sa...@apache.org>
Committed: Wed Dec 30 11:48:39 2015 +0530

----------------------------------------------------------------------
 .../ode/axis2/management/RedeployTest.java      | 53 ++++++++++++++
 .../ode/axis2/management/Retire2Test.java       |  2 +
 .../apache/ode/axis2/management/RetireTest.java |  2 +
 .../ode/axis2/management/RetireTestVar.java     | 65 +++++++++++++++++
 .../TestInstanceRetire/noVar/TestRetire.bpel    | 67 ++++++++++++++++++
 .../TestInstanceRetire/noVar/TestRetire.wsdl    | 73 ++++++++++++++++++++
 .../TestInstanceRetire/noVar/deploy.xml         | 30 ++++++++
 .../TestInstanceRetire/withVar/TestRetire.bpel  | 71 +++++++++++++++++++
 .../TestInstanceRetire/withVar/TestRetire.wsdl  | 73 ++++++++++++++++++++
 .../TestInstanceRetire/withVar/deploy.xml       | 29 ++++++++
 .../apache/ode/bpel/engine/BpelEngineImpl.java  | 43 ++++++++++--
 .../org/apache/ode/bpel/engine/BpelProcess.java | 68 ++++++++++--------
 .../ode/bpel/engine/PartnerLinkMyRoleImpl.java  |  7 +-
 .../ode/bpel/engine/replayer/Replayer.java      |  2 +-
 .../ReplayerBpelRuntimeContextImpl.java         |  2 +-
 .../bpel/engine/replayer/ReplayerContext.java   |  2 +-
 .../apache/ode/daohib/bpel/ProcessDaoImpl.java  |  4 +-
 17 files changed, 551 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ode/blob/c0c7b497/axis2-war/src/test/java/org/apache/ode/axis2/management/RedeployTest.java
----------------------------------------------------------------------
diff --git a/axis2-war/src/test/java/org/apache/ode/axis2/management/RedeployTest.java b/axis2-war/src/test/java/org/apache/ode/axis2/management/RedeployTest.java
new file mode 100644
index 0000000..23e0415
--- /dev/null
+++ b/axis2-war/src/test/java/org/apache/ode/axis2/management/RedeployTest.java
@@ -0,0 +1,53 @@
+/*
+ * 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.axis2.management;
+
+import org.apache.ode.axis2.Axis2TestBase;
+import static org.testng.AssertJUnit.assertTrue;
+import org.testng.annotations.Test;
+
+import javax.xml.namespace.QName;
+
+/**
+ * @author Anurag Aggarwal <an...@intalio.com>
+ */
+public class RedeployTest extends Axis2TestBase {
+
+    // @Test(dataProvider="configs")
+    // not supposed to work, user should not rm .deploy folder maybe ?
+    public void testRedeploy() throws Exception {
+        String bundleName = "TestInstanceRetire";
+        System.out.println("=> " + server.getODEServer().getProcessStore().getPackages());
+        if (server.isDeployed("withVar")) server.undeployProcess(bundleName + "/withVar");
+
+        QName deployedQName = server.deployProcess(bundleName + "/withVar").iterator().next();
+
+        server.sendRequestFile("http://localhost:8888/processes/testretire",
+                bundleName + "/1", "testRequest1.soap");
+
+        server.undeployProcess(bundleName + "/withVar");
+        server.deployProcess(bundleName + "/withVar").iterator().next();
+
+        String response = server.sendRequestFile("http://localhost:8888/processes/testretire",
+                bundleName + "/1", "testRequest2.soap");
+        
+        if (server.isDeployed("withVar")) server.undeployProcess(bundleName + "/withVar");
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ode/blob/c0c7b497/axis2-war/src/test/java/org/apache/ode/axis2/management/Retire2Test.java
----------------------------------------------------------------------
diff --git a/axis2-war/src/test/java/org/apache/ode/axis2/management/Retire2Test.java b/axis2-war/src/test/java/org/apache/ode/axis2/management/Retire2Test.java
index 8562397..81c0f1a 100644
--- a/axis2-war/src/test/java/org/apache/ode/axis2/management/Retire2Test.java
+++ b/axis2-war/src/test/java/org/apache/ode/axis2/management/Retire2Test.java
@@ -53,5 +53,7 @@ public class Retire2Test extends Axis2TestBase {
         System.out.println(response);
         System.out.println("###############################################");
         assertTrue(response.indexOf("TEST2") > 0);
+        if (server.isDeployed("1")) server.undeployProcess(bundleName + "/1");
+        if (server.isDeployed("2")) server.undeployProcess(bundleName + "/2");
     }
 }

http://git-wip-us.apache.org/repos/asf/ode/blob/c0c7b497/axis2-war/src/test/java/org/apache/ode/axis2/management/RetireTest.java
----------------------------------------------------------------------
diff --git a/axis2-war/src/test/java/org/apache/ode/axis2/management/RetireTest.java b/axis2-war/src/test/java/org/apache/ode/axis2/management/RetireTest.java
index 39c7068..32646de 100644
--- a/axis2-war/src/test/java/org/apache/ode/axis2/management/RetireTest.java
+++ b/axis2-war/src/test/java/org/apache/ode/axis2/management/RetireTest.java
@@ -52,5 +52,7 @@ public class RetireTest extends Axis2TestBase {
         System.out.println(response);
         System.out.println("###############################################");
         assertTrue(response.indexOf("DONE") > 0);
+        if (server.isDeployed("1")) server.undeployProcess(bundleName + "/1");
+        if (server.isDeployed("2")) server.undeployProcess(bundleName + "/2");
     }
 }

http://git-wip-us.apache.org/repos/asf/ode/blob/c0c7b497/axis2-war/src/test/java/org/apache/ode/axis2/management/RetireTestVar.java
----------------------------------------------------------------------
diff --git a/axis2-war/src/test/java/org/apache/ode/axis2/management/RetireTestVar.java b/axis2-war/src/test/java/org/apache/ode/axis2/management/RetireTestVar.java
new file mode 100644
index 0000000..011aeda
--- /dev/null
+++ b/axis2-war/src/test/java/org/apache/ode/axis2/management/RetireTestVar.java
@@ -0,0 +1,65 @@
+/*
+ * 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.axis2.management;
+
+import org.apache.ode.axis2.Axis2TestBase;
+import static org.testng.AssertJUnit.assertTrue;
+import org.testng.annotations.Test;
+
+import javax.xml.namespace.QName;
+
+/**
+ * @author Anurag Aggarwal <an...@intalio.com>
+ */
+public class RetireTestVar extends Axis2TestBase {
+
+    @Test(dataProvider="configs")
+    public void testRetiredInstance() throws Exception {
+        String response = null;
+        String bundleName = "TestInstanceRetire";
+        System.out.println("=> " + server.getODEServer().getProcessStore().getPackages());
+        if (server.isDeployed("withVar")) server.undeployProcess(bundleName + "/withVar");
+        if (server.isDeployed("noVar")) server.undeployProcess(bundleName + "/noVar");
+
+        QName deployedQName = server.deployProcess(bundleName + "/withVar").iterator().next();
+
+        server.sendRequestFile("http://localhost:8888/processes/testretire",
+                bundleName + "/1", "testRequest1.soap");
+
+        server.getODEServer().getProcessManagement().setRetired(deployedQName, true);
+        server.deployProcess(bundleName + "/noVar");
+
+        response = server.sendRequestFile("http://localhost:8888/processes/testretire",
+                bundleName + "/1", "testRequest2.soap");
+
+        assertTrue("'" + response + "' does not contain 'DONE'.", response.indexOf("DONE") > 0);
+
+        server.sendRequestFile("http://localhost:8888/processes/testretire",
+                bundleName + "/1", "testRequest1.soap");
+
+        response = server.sendRequestFile("http://localhost:8888/processes/testretire",
+                bundleName + "/1", "testRequest2.soap");
+
+        assertTrue("'" + response + "' does not contain 'XYZ'.", response.indexOf("XYZ") > 0);
+
+        if (server.isDeployed("withVar")) server.undeployProcess(bundleName + "/withVar");
+        if (server.isDeployed("noVar")) server.undeployProcess(bundleName + "/noVar");
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ode/blob/c0c7b497/axis2-war/src/test/resources/TestInstanceRetire/noVar/TestRetire.bpel
----------------------------------------------------------------------
diff --git a/axis2-war/src/test/resources/TestInstanceRetire/noVar/TestRetire.bpel b/axis2-war/src/test/resources/TestInstanceRetire/noVar/TestRetire.bpel
new file mode 100644
index 0000000..d2e84eb
--- /dev/null
+++ b/axis2-war/src/test/resources/TestInstanceRetire/noVar/TestRetire.bpel
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+  ~ 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.
+  -->
+
+<process name="TestRetire"
+         targetNamespace="http://ode/bpel/test/retire"
+         xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
+         xmlns:tns="http://ode/bpel/responder"
+         xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+         xmlns:resp="http://ode/bpel/test/retire/responder.wsdl">
+
+    <import location="TestRetire.wsdl" namespace="http://ode/bpel/test/retire.wsdl"
+            importType="http://schemas.xmlsoap.org/wsdl/" />
+
+    <partnerLinks>
+        <partnerLink name="testRetirePartnerLink2" partnerLinkType="resp:TestRetirePartnerLinkType" myRole="responder"/>
+    </partnerLinks>
+
+    <variables>
+        <variable name="dummy" messageType="resp:TestRetireMessage"/>
+        <variable name="dummy3" messageType="resp:TestRetireMessage"/>
+    </variables>
+
+    <correlationSets>
+        <correlationSet name="dummyCorr" properties="resp:dummyProp" />
+    </correlationSets>
+
+    <sequence>
+        <receive name="start" partnerLink="testRetirePartnerLink2" variable="dummy" operation="first" createInstance="yes">
+            <correlations>
+                <correlation set="dummyCorr" initiate="yes"/>
+            </correlations>
+        </receive>
+        <reply name="reply-endpoint" partnerLink="testRetirePartnerLink2" operation="first" variable="dummy"/>
+
+
+        <receive name="second" partnerLink="testRetirePartnerLink2" variable="dummy" operation="second">
+            <correlations>
+                <correlation set="dummyCorr" initiate="no"/>
+            </correlations>
+        </receive>
+        <assign>
+            <copy>
+                <from><literal>DONE</literal></from>
+                <to>$dummy3.TestPart</to>
+            </copy>
+        </assign>
+        <reply name="reply-ack" partnerLink="testRetirePartnerLink2" operation="second" variable="dummy"/>
+
+    </sequence>
+</process>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ode/blob/c0c7b497/axis2-war/src/test/resources/TestInstanceRetire/noVar/TestRetire.wsdl
----------------------------------------------------------------------
diff --git a/axis2-war/src/test/resources/TestInstanceRetire/noVar/TestRetire.wsdl b/axis2-war/src/test/resources/TestInstanceRetire/noVar/TestRetire.wsdl
new file mode 100644
index 0000000..90b70a9
--- /dev/null
+++ b/axis2-war/src/test/resources/TestInstanceRetire/noVar/TestRetire.wsdl
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+  ~ 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.
+  -->
+
+<wsdl:definitions
+    targetNamespace="http://ode/bpel/test/retire/responder.wsdl"
+    xmlns="http://schemas.xmlsoap.org/wsdl/"
+    xmlns:tns="http://ode/bpel/test/retire/responder.wsdl"
+    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+    xmlns:dummy="http://axis2.ode.apache.org"
+    xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
+    xmlns:prop="http://docs.oasis-open.org/wsbpel/2.0/varprop">
+
+    <wsdl:message name="TestRetireMessage">
+        <wsdl:part name="TestPart" type="xsd:string"/>
+    </wsdl:message>
+
+    <wsdl:portType name="TestRetirePortType">
+        <wsdl:operation name="first">
+            <wsdl:input message="tns:TestRetireMessage" name="TestIn"/>
+            <wsdl:output message="tns:TestRetireMessage" name="TestOut"/>
+        </wsdl:operation>
+        <wsdl:operation name="second">
+            <wsdl:input message="tns:TestRetireMessage" name="TestIn"/>
+            <wsdl:output message="tns:TestRetireMessage" name="TestOut"/>
+        </wsdl:operation>
+    </wsdl:portType>
+
+     <wsdl:binding name="TestRetireSoapBinding" type="tns:TestRetirePortType">
+        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+        <wsdl:operation name="first">
+            <soap:operation soapAction="" style="rpc"/>
+            <wsdl:input><soap:body namespace="http://ode/bpel/test/retire/responder.wsdl" use="literal"/></wsdl:input>
+            <wsdl:output><soap:body namespace="http://ode/bpel/unit-test.wsdl" use="literal"/></wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="second">
+            <soap:operation soapAction="" style="rpc"/>
+            <wsdl:input><soap:body namespace="http://ode/bpel/test/retire/responder.wsdl" use="literal"/></wsdl:input>
+            <wsdl:output><soap:body namespace="http://ode/bpel/unit-test.wsdl" use="literal"/></wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="TestRetireService">
+        <wsdl:port name="TestRetirePort" binding="tns:TestRetireSoapBinding">
+            <soap:address location="http://localhost:8888/ode/processes/testretire"/>
+        </wsdl:port>
+    </wsdl:service>
+
+    <plnk:partnerLinkType name="TestRetirePartnerLinkType">
+        <plnk:role name="responder" portType="tns:TestRetirePortType"/>
+    </plnk:partnerLinkType>
+
+    <prop:property name="dummyProp" type="xsd:string"/>
+    <prop:propertyAlias propertyName="tns:dummyProp" messageType="tns:TestRetireMessage" part="TestPart"/>
+
+</wsdl:definitions>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ode/blob/c0c7b497/axis2-war/src/test/resources/TestInstanceRetire/noVar/deploy.xml
----------------------------------------------------------------------
diff --git a/axis2-war/src/test/resources/TestInstanceRetire/noVar/deploy.xml b/axis2-war/src/test/resources/TestInstanceRetire/noVar/deploy.xml
new file mode 100644
index 0000000..bac2ba8
--- /dev/null
+++ b/axis2-war/src/test/resources/TestInstanceRetire/noVar/deploy.xml
@@ -0,0 +1,30 @@
+<!--
+  ~ 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.
+  -->
+<deploy xmlns="http://www.apache.org/ode/schemas/dd/2007/03"
+    xmlns:pns="http://ode/bpel/test/retire"
+    xmlns:wns="http://ode/bpel/test/retire/responder.wsdl">
+
+    <process name="pns:TestRetire">
+        <active>true</active>
+        <provide partnerLink="testRetirePartnerLink2">
+            <service name="wns:TestRetireService" port="TestRetirePort"/>
+        </provide>
+    </process>
+</deploy>
+

http://git-wip-us.apache.org/repos/asf/ode/blob/c0c7b497/axis2-war/src/test/resources/TestInstanceRetire/withVar/TestRetire.bpel
----------------------------------------------------------------------
diff --git a/axis2-war/src/test/resources/TestInstanceRetire/withVar/TestRetire.bpel b/axis2-war/src/test/resources/TestInstanceRetire/withVar/TestRetire.bpel
new file mode 100644
index 0000000..3fb8eff
--- /dev/null
+++ b/axis2-war/src/test/resources/TestInstanceRetire/withVar/TestRetire.bpel
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+  ~ 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.
+  -->
+
+<process name="TestRetire"
+         targetNamespace="http://ode/bpel/test/retire"
+         xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
+         xmlns:tns="http://ode/bpel/responder"
+         xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+         xmlns:resp="http://ode/bpel/test/retire/responder.wsdl">
+
+    <import location="TestRetire.wsdl" namespace="http://ode/bpel/test/retire.wsdl"
+            importType="http://schemas.xmlsoap.org/wsdl/" />
+
+    <partnerLinks>
+        <partnerLink name="testRetirePartnerLink" partnerLinkType="resp:TestRetirePartnerLinkType" myRole="responder"/>
+    </partnerLinks>
+
+    <variables>
+        <variable name="dummy" messageType="resp:TestRetireMessage"/>
+        <variable name="dummy2" messageType="resp:TestRetireMessage"/>
+    </variables>
+
+    <correlationSets>
+        <correlationSet name="dummyCorr" properties="resp:dummyProp" />
+    </correlationSets>
+
+    <sequence>
+        <receive name="start" partnerLink="testRetirePartnerLink" variable="dummy" operation="first" createInstance="yes">
+            <correlations>
+                <correlation set="dummyCorr" initiate="yes"/>
+            </correlations>
+        </receive>
+        <reply name="reply-endpoint" partnerLink="testRetirePartnerLink" operation="first" variable="dummy"/>
+
+
+        <receive name="second" partnerLink="testRetirePartnerLink" variable="dummy" operation="second">
+            <correlations>
+                <correlation set="dummyCorr" initiate="no"/>
+            </correlations>
+        </receive>
+        <assign>
+            <copy>
+                <from><literal>DONE</literal></from>
+                <to>$dummy.TestPart</to>
+            </copy>
+            <copy>
+                <from><literal>DONE</literal></from>
+                <to>$dummy2.TestPart</to>
+            </copy>
+        </assign>
+        <reply name="reply-ack" partnerLink="testRetirePartnerLink" operation="second" variable="dummy"/>
+
+    </sequence>
+</process>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ode/blob/c0c7b497/axis2-war/src/test/resources/TestInstanceRetire/withVar/TestRetire.wsdl
----------------------------------------------------------------------
diff --git a/axis2-war/src/test/resources/TestInstanceRetire/withVar/TestRetire.wsdl b/axis2-war/src/test/resources/TestInstanceRetire/withVar/TestRetire.wsdl
new file mode 100644
index 0000000..90b70a9
--- /dev/null
+++ b/axis2-war/src/test/resources/TestInstanceRetire/withVar/TestRetire.wsdl
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!--
+  ~ 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.
+  -->
+
+<wsdl:definitions
+    targetNamespace="http://ode/bpel/test/retire/responder.wsdl"
+    xmlns="http://schemas.xmlsoap.org/wsdl/"
+    xmlns:tns="http://ode/bpel/test/retire/responder.wsdl"
+    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+    xmlns:dummy="http://axis2.ode.apache.org"
+    xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
+    xmlns:prop="http://docs.oasis-open.org/wsbpel/2.0/varprop">
+
+    <wsdl:message name="TestRetireMessage">
+        <wsdl:part name="TestPart" type="xsd:string"/>
+    </wsdl:message>
+
+    <wsdl:portType name="TestRetirePortType">
+        <wsdl:operation name="first">
+            <wsdl:input message="tns:TestRetireMessage" name="TestIn"/>
+            <wsdl:output message="tns:TestRetireMessage" name="TestOut"/>
+        </wsdl:operation>
+        <wsdl:operation name="second">
+            <wsdl:input message="tns:TestRetireMessage" name="TestIn"/>
+            <wsdl:output message="tns:TestRetireMessage" name="TestOut"/>
+        </wsdl:operation>
+    </wsdl:portType>
+
+     <wsdl:binding name="TestRetireSoapBinding" type="tns:TestRetirePortType">
+        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+        <wsdl:operation name="first">
+            <soap:operation soapAction="" style="rpc"/>
+            <wsdl:input><soap:body namespace="http://ode/bpel/test/retire/responder.wsdl" use="literal"/></wsdl:input>
+            <wsdl:output><soap:body namespace="http://ode/bpel/unit-test.wsdl" use="literal"/></wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="second">
+            <soap:operation soapAction="" style="rpc"/>
+            <wsdl:input><soap:body namespace="http://ode/bpel/test/retire/responder.wsdl" use="literal"/></wsdl:input>
+            <wsdl:output><soap:body namespace="http://ode/bpel/unit-test.wsdl" use="literal"/></wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="TestRetireService">
+        <wsdl:port name="TestRetirePort" binding="tns:TestRetireSoapBinding">
+            <soap:address location="http://localhost:8888/ode/processes/testretire"/>
+        </wsdl:port>
+    </wsdl:service>
+
+    <plnk:partnerLinkType name="TestRetirePartnerLinkType">
+        <plnk:role name="responder" portType="tns:TestRetirePortType"/>
+    </plnk:partnerLinkType>
+
+    <prop:property name="dummyProp" type="xsd:string"/>
+    <prop:propertyAlias propertyName="tns:dummyProp" messageType="tns:TestRetireMessage" part="TestPart"/>
+
+</wsdl:definitions>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ode/blob/c0c7b497/axis2-war/src/test/resources/TestInstanceRetire/withVar/deploy.xml
----------------------------------------------------------------------
diff --git a/axis2-war/src/test/resources/TestInstanceRetire/withVar/deploy.xml b/axis2-war/src/test/resources/TestInstanceRetire/withVar/deploy.xml
new file mode 100644
index 0000000..1c566d2
--- /dev/null
+++ b/axis2-war/src/test/resources/TestInstanceRetire/withVar/deploy.xml
@@ -0,0 +1,29 @@
+<!--
+  ~ 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.
+  -->
+<deploy xmlns="http://www.apache.org/ode/schemas/dd/2007/03"
+    xmlns:pns="http://ode/bpel/test/retire"
+    xmlns:wns="http://ode/bpel/test/retire/responder.wsdl">
+
+    <process name="pns:TestRetire">
+        <active>true</active>
+        <provide partnerLink="testRetirePartnerLink">
+            <service name="wns:TestRetireService" port="TestRetirePort"/>
+        </provide>
+    </process>
+</deploy>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ode/blob/c0c7b497/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelEngineImpl.java
----------------------------------------------------------------------
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelEngineImpl.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelEngineImpl.java
index 0cbb05e..7fdf924 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelEngineImpl.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelEngineImpl.java
@@ -418,9 +418,9 @@ public class BpelEngineImpl implements BpelEngine {
         final JobDetails we = jobInfo.jobDetail;
 
         if( __log.isTraceEnabled() ) __log.trace("[JOB] onScheduledJob " + jobInfo + "" + we.getInstanceId());
-        
+
         acquireInstanceLock(we.getInstanceId());
-        
+
         // DONT PUT CODE HERE-need this method real tight in a try/catch block, we need to handle
         // all types of failure here, the scheduler is not going to know how to handle our errors,
         // ALSO we have to release the lock obtained above (IMPORTANT), lest the whole system come
@@ -452,10 +452,10 @@ public class BpelEngineImpl implements BpelEngine {
 
             ClassLoader cl = Thread.currentThread().getContextClassLoader();
             try {
-                Thread.currentThread().setContextClassLoader(process._classLoader);            
+                Thread.currentThread().setContextClassLoader(process._classLoader);
                 if (we.getType().equals(JobType.INVOKE_CHECK)) {
                     if (__log.isDebugEnabled()) __log.debug("handleJobDetails: InvokeCheck event for mexid " + we.getMexId());
-               
+
                     sendPartnerRoleFailure(we, MessageExchange.FailureType.COMMUNICATION_ERROR);
                     return;
                 } else if (we.getType().equals(JobType.INVOKE_INTERNAL)) {
@@ -476,7 +476,24 @@ public class BpelEngineImpl implements BpelEngine {
                         }
                     }
                 }
-                process.handleJobDetails(jobInfo.jobDetail);
+
+                if (we.getType().equals(JobType.INVOKE_INTERNAL)) {
+                    List<BpelProcess> processes = getAllProcesses(we.getProcessId());
+                    boolean routed = false;
+                    jobInfo.jobDetail.detailsExt.put("enqueue", false);
+
+                    for(BpelProcess proc : processes) {
+                        routed = routed || proc.handleJobDetails(jobInfo.jobDetail);
+                    }
+
+                    if(!routed) {
+                        jobInfo.jobDetail.detailsExt.put("enqueue", true);
+                        process.handleJobDetails(jobInfo.jobDetail);
+                    }
+                }
+                else {
+                    process.handleJobDetails(jobInfo.jobDetail);
+                }
                 debuggingDelay();
             } finally {
                 Thread.currentThread().setContextClassLoader(cl);
@@ -783,5 +800,21 @@ public class BpelEngineImpl implements BpelEngine {
         }
         return q;
     }
+
+    private List<BpelProcess> getAllProcesses(QName processId) {
+        String qName =  processId.toString();
+        if(qName.lastIndexOf("-") > 0) {
+            qName = qName.substring(0, qName.lastIndexOf("-"));
+        }
+        List<BpelProcess> ret = new ArrayList<BpelProcess>();
+        Iterator<Map.Entry<QName, BpelProcess>> it = _activeProcesses.entrySet().iterator();
+        while (it.hasNext()) {
+            Map.Entry<QName, BpelProcess> pairs = it.next();
+            if(pairs.getKey().toString().startsWith(qName)) {
+                ret.add(pairs.getValue());
+            }
+        }
+        return ret;
+    }
 }
 

http://git-wip-us.apache.org/repos/asf/ode/blob/c0c7b497/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelProcess.java
----------------------------------------------------------------------
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelProcess.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelProcess.java
index bbf6aff..cfddef7 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelProcess.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelProcess.java
@@ -203,25 +203,25 @@ public class BpelProcess {
     public interface InvokeHandler {
         boolean invoke(PartnerLinkMyRoleImpl target, PartnerLinkMyRoleImpl.RoutingInfo routingInfo, boolean createInstance);
     }
-    
-    public void invokeProcess(MyRoleMessageExchangeImpl mex, InvokeHandler invokeHandler) {
+
+    public boolean invokeProcess(MyRoleMessageExchangeImpl mex, InvokeHandler invokeHandler, boolean enqueue) {
         boolean routed = false;
 
         try {
             _hydrationLatch.latch(1);
             List<PartnerLinkMyRoleImpl> targets = getMyRolesForService(mex.getServiceName());
             if (targets.isEmpty()) {
-                String errmsg = __msgs.msgMyRoleRoutingFailure(mex.getMessageExchangeId());
-                __log.error(errmsg);
-                mex.setFailure(MessageExchange.FailureType.UNKNOWN_ENDPOINT, errmsg, null);
-                return;
+                //String errmsg = __msgs.msgMyRoleRoutingFailure(mex.getMessageExchangeId());
+                //__log.error(errmsg);
+                //mex.setFailure(MessageExchange.FailureType.UNKNOWN_ENDPOINT, errmsg, null);
+                return false;
             }
 
             mex.getDAO().setProcess(getProcessDAO());
 
             if (!processInterceptors(mex, InterceptorInvoker.__onProcessInvoked)) {
                 __log.debug("Aborting processing of mex " + mex + " due to interceptors.");
-                return;
+                return false;
             }
 
             markused();
@@ -233,7 +233,7 @@ public class BpelProcess {
                 routings = target.findRoute(mex);
                 boolean createInstance = target.isCreateInstance(mex);
 
-                if (mex.getStatus() != MessageExchange.Status.FAILURE) {
+                if (mex.getStatus() != MessageExchange.Status.FAILURE && routings!=null) {
                     for (PartnerLinkMyRoleImpl.RoutingInfo routing : routings) {
                         routed = routed || invokeHandler.invoke(target, routing, createInstance);
                     }
@@ -244,7 +244,7 @@ public class BpelProcess {
             }
 
             // Nothing found, saving for later
-            if (!routed) {
+            if (!routed  && enqueue) {
                 // TODO this is kind of hackish when no match and more than one myrole is selected.
                 // we save the routing on the last myrole
                 // actually the message queue should be attached to the instance instead of the correlator
@@ -268,29 +268,35 @@ public class BpelProcess {
         if (mex.getPattern().equals(MessageExchange.MessageExchangePattern.REQUEST_ONLY) && routed && getCleanupCategories(false).contains(CLEANUP_CATEGORY.MESSAGES)) {
             mex.release();
         }
+
+        return routed;
     }
-    
+
+    private boolean isActive() {
+        return _pconf.getState() == org.apache.ode.bpel.iapi.ProcessState.ACTIVE;
+    }
+
     /**
      * Entry point for message exchanges aimed at the my role.
      *
      * @param mex
      */
-    void invokeProcess(final MyRoleMessageExchangeImpl mex) {
-        invokeProcess(mex, new InvokeHandler() {
-            public boolean invoke(PartnerLinkMyRoleImpl target, PartnerLinkMyRoleImpl.RoutingInfo routing, boolean createInstance) {
-                  if (routing.messageRoute == null && createInstance) {
-                      // No route but we can create a new instance
-                      target.invokeNewInstance(mex, routing);
-                      return true;
-                  } else if (routing.messageRoute != null) {
-                      // Found a route, hitting it
-                      _engine.acquireInstanceLock(routing.messageRoute.getTargetInstance().getInstanceId());
-                      target.invokeInstance(mex, routing);
-                      return true;
-                  }
-                  return false;
-            }
-        });
+    boolean invokeProcess(final MyRoleMessageExchangeImpl mex, boolean enqueue) {
+        return invokeProcess(mex, new InvokeHandler() {
+                    public boolean invoke(PartnerLinkMyRoleImpl target, PartnerLinkMyRoleImpl.RoutingInfo routing, boolean createInstance) {
+                          if (routing.messageRoute == null && createInstance  && isActive()) {
+                              // No route but we can create a new instance
+                              target.invokeNewInstance(mex, routing);
+                              return true;
+                          } else if (routing.messageRoute != null) {
+                              // Found a route, hitting it
+                              _engine.acquireInstanceLock(routing.messageRoute.getTargetInstance().getInstanceId());
+                              target.invokeInstance(mex, routing);
+                              return true;
+                          }
+                          return false;
+                    }
+                },enqueue);
     }
 
     /** Several myroles can use the same service in a given process */
@@ -407,7 +413,8 @@ public class BpelProcess {
     /**
      * @see org.apache.ode.bpel.engine.BpelProcess#handleJobDetails(java.util.Map<java.lang.String,java.lang.Object>)
      */
-    public void handleJobDetails(JobDetails jobData) {
+    public boolean handleJobDetails(JobDetails jobData) {
+        boolean ret = true;
         try {
             _hydrationLatch.latch(1);
             markused();
@@ -423,7 +430,7 @@ public class BpelProcess {
                     __log.debug("InvokeInternal event for mexid " + we.getMexId());
                 }
                 MyRoleMessageExchangeImpl mex = (MyRoleMessageExchangeImpl) _engine.getMessageExchange(we.getMexId());
-                invokeProcess(mex);
+                ret = invokeProcess(mex, (Boolean) jobData.detailsExt.get("enqueue"));
             } else {
                 // Instance level events
                 ProcessInstanceDAO procInstance = getProcessDAO().getInstance(we.getInstanceId());
@@ -431,7 +438,7 @@ public class BpelProcess {
                     if (__log.isDebugEnabled()) {
                         __log.debug("handleJobDetails: no ProcessInstance found with iid " + we.getInstanceId() + "; ignoring.");
                     }
-                    return;
+                    return true;
                 }
 
                 BpelRuntimeContextImpl processInstance = createRuntimeContext(procInstance, null, null);
@@ -462,7 +469,7 @@ public class BpelProcess {
                         if( procInstance.getState() == ProcessState.STATE_COMPLETED_OK 
                                 || procInstance.getState() == ProcessState.STATE_COMPLETED_WITH_FAULT ) {
                             __log.debug("A matcher event was aborted. The process is already completed.");
-                            return;
+                            return true;
                         }
                         processInstance.matcherEvent(we.getCorrelatorId(), we.getCorrelationKeySet());
                 }
@@ -470,6 +477,7 @@ public class BpelProcess {
         } finally {
             _hydrationLatch.release(1);
         }
+        return ret;
     }
 
     private void setRoles(OProcess oprocess) {

http://git-wip-us.apache.org/repos/asf/ode/blob/c0c7b497/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkMyRoleImpl.java
----------------------------------------------------------------------
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkMyRoleImpl.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkMyRoleImpl.java
index de63dc6..4537286 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkMyRoleImpl.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/PartnerLinkMyRoleImpl.java
@@ -85,6 +85,9 @@ public class PartnerLinkMyRoleImpl extends PartnerLinkRoleImpl {
 
     public boolean isCreateInstance(MyRoleMessageExchangeImpl mex) {
         Operation operation = getMyRoleOperation(mex.getOperationName());
+        if(operation == null) {
+            return false;
+        }
         return _plinkDef.isCreateInstanceOperation(operation);
     }
 
@@ -98,8 +101,8 @@ public class PartnerLinkMyRoleImpl extends PartnerLinkRoleImpl {
 
         Operation operation = getMyRoleOperation(mex.getOperationName());
         if (operation == null) {
-            __log.error(__msgs.msgUnknownOperation(mex.getOperationName(), _plinkDef.myRolePortType.getQName()));
-            mex.setFailure(MessageExchange.FailureType.UNKNOWN_OPERATION, mex.getOperationName(), null);
+            //__log.error(__msgs.msgUnknownOperation(mex.getOperationName(), _plinkDef.myRolePortType.getQName()));
+            //mex.setFailure(MessageExchange.FailureType.UNKNOWN_OPERATION, mex.getOperationName(), null);
             return null;
         }
         setMexRole(mex);

http://git-wip-us.apache.org/repos/asf/ode/blob/c0c7b497/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/replayer/Replayer.java
----------------------------------------------------------------------
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/replayer/Replayer.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/replayer/Replayer.java
index 1025ec9..6d07b13 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/replayer/Replayer.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/replayer/Replayer.java
@@ -274,7 +274,7 @@ public class Replayer {
                             }
                             return false;
                         }
-                    });
+                    },true);
         } else if (we.getType() == JobType.INVOKE_RESPONSE) {
             __log.debug("reply for live communication");
             ReplayerContext ctx = findReplayedInstance(we.getInstanceId());

http://git-wip-us.apache.org/repos/asf/ode/blob/c0c7b497/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/replayer/ReplayerBpelRuntimeContextImpl.java
----------------------------------------------------------------------
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/replayer/ReplayerBpelRuntimeContextImpl.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/replayer/ReplayerBpelRuntimeContextImpl.java
index 876d859..713abc0 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/replayer/ReplayerBpelRuntimeContextImpl.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/replayer/ReplayerBpelRuntimeContextImpl.java
@@ -308,7 +308,7 @@ public class ReplayerBpelRuntimeContextImpl extends BpelRuntimeContextImpl {
                 }
                 return false;
             }
-        });
+        },true);
 
     }
 

http://git-wip-us.apache.org/repos/asf/ode/blob/c0c7b497/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/replayer/ReplayerContext.java
----------------------------------------------------------------------
diff --git a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/replayer/ReplayerContext.java b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/replayer/ReplayerContext.java
index 631c499..a34beec 100644
--- a/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/replayer/ReplayerContext.java
+++ b/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/replayer/ReplayerContext.java
@@ -270,7 +270,7 @@ public class ReplayerContext {
                                     }
                                     return false;
                                 }
-                            });
+                            },true);
 
                     for (Exchange e : exchanges) {
                         if (e.getType() == ExchangeType.M) {

http://git-wip-us.apache.org/repos/asf/ode/blob/c0c7b497/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/ProcessDaoImpl.java
----------------------------------------------------------------------
diff --git a/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/ProcessDaoImpl.java b/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/ProcessDaoImpl.java
index 85d4835..278eb73 100644
--- a/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/ProcessDaoImpl.java
+++ b/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/ProcessDaoImpl.java
@@ -151,10 +151,10 @@ public class ProcessDaoImpl extends HibernateDao implements ProcessDAO, Deferred
     @SuppressWarnings("unchecked")
     public void deleteProcessAndRoutes() {
         // delete routes
-        deleteByIds(HCorrelatorSelector.class, getSession().getNamedQuery(HCorrelatorSelector.SELECT_MESSAGE_ROUTE_IDS_BY_PROCESS).setParameter("process", _process).list());
+        //deleteByIds(HCorrelatorSelector.class, getSession().getNamedQuery(HCorrelatorSelector.SELECT_MESSAGE_ROUTE_IDS_BY_PROCESS).setParameter("process", _process).list());
 
         // delete process dao
-        deleteByIds(HCorrelator.class, getSession().getNamedQuery(HCorrelator.SELECT_CORRELATOR_IDS_BY_PROCESS).setParameter("process", _process).list());
+        //deleteByIds(HCorrelator.class, getSession().getNamedQuery(HCorrelator.SELECT_CORRELATOR_IDS_BY_PROCESS).setParameter("process", _process).list());
         try {
             getSession().refresh(_process);
             getSession().delete(_process); // this deletes HCorrelator -> HCorrelatorSelector