Author: rr
Date: Thu Feb 11 13:07:38 2010
New Revision: 908952

URL: http://svn.apache.org/viewvc?rev=908952&view=rev
Log:
ODE-762: Add activityRecovery definitions in deploy.xml (impl + test)

Added:
    
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/test/resources/recovery/failure-to-fault2.bpel
   (with props)
    ode/branches/APACHE_ODE_1.X/bpel-schemas/src/main/xsd/activityRecovery.xsd  
 (with props)
Modified:
    
ode/branches/APACHE_ODE_1.X/bpel-api/src/main/java/org/apache/ode/bpel/iapi/ProcessConf.java
    
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
    
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ACTIVITYGUARD.java
    
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/BpelRuntimeContext.java
    
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/INVOKE.java
    
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/ActivityRecoveryTest.java
    
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/CoreBpelTest.java
    
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/test/resources/recovery/deploy.xml
    ode/branches/APACHE_ODE_1.X/bpel-schemas/src/main/xsd/dd.xsd
    
ode/branches/APACHE_ODE_1.X/bpel-store/src/main/java/org/apache/ode/store/ProcessConfImpl.java

Modified: 
ode/branches/APACHE_ODE_1.X/bpel-api/src/main/java/org/apache/ode/bpel/iapi/ProcessConf.java
URL: 
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-api/src/main/java/org/apache/ode/bpel/iapi/ProcessConf.java?rev=908952&r1=908951&r2=908952&view=diff
==============================================================================
--- 
ode/branches/APACHE_ODE_1.X/bpel-api/src/main/java/org/apache/ode/bpel/iapi/ProcessConf.java
 (original)
+++ 
ode/branches/APACHE_ODE_1.X/bpel-api/src/main/java/org/apache/ode/bpel/iapi/ProcessConf.java
 Thu Feb 11 13:07:38 2010
@@ -32,6 +32,7 @@
 import javax.xml.namespace.QName;
 
 import org.apache.ode.bpel.evt.BpelEvent;
+import org.apache.ode.bpel.o.OFailureHandling;
 import org.apache.ode.utils.CronExpression;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
@@ -156,6 +157,12 @@
      * @return map of partner link names and associated enpoints
      */
     Map<String, Endpoint> getInvokeEndpoints();
+
+    /**
+     * Returns failure handling info for invokes.
+     * @return
+     */
+    public Map<String, OFailureHandling> getInvokeFailureHandling();
     
     /**
      * Tells if the service is shareable

Modified: 
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
URL: 
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java?rev=908952&r1=908951&r2=908952&view=diff
==============================================================================
--- 
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
 (original)
+++ 
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
 Thu Feb 11 13:07:38 2010
@@ -71,6 +71,7 @@
 import org.apache.ode.bpel.iapi.ProcessConf.CLEANUP_CATEGORY;
 import org.apache.ode.bpel.intercept.InterceptorInvoker;
 import org.apache.ode.bpel.memdao.ProcessInstanceDaoImpl;
+import org.apache.ode.bpel.o.OFailureHandling;
 import org.apache.ode.bpel.o.OMessageVarType;
 import org.apache.ode.bpel.o.OPartnerLink;
 import org.apache.ode.bpel.o.OProcess;
@@ -1495,4 +1496,8 @@
         return _bpelProcess._classLoader;
     }
 
+    public OFailureHandling getFailureHandlingForPartnerLink(OPartnerLink 
pLink) {
+        return 
_bpelProcess.getConf().getInvokeFailureHandling().get(pLink.name);
+    }
+
 }

Modified: 
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ACTIVITYGUARD.java
URL: 
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ACTIVITYGUARD.java?rev=908952&r1=908951&r2=908952&view=diff
==============================================================================
--- 
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ACTIVITYGUARD.java
 (original)
+++ 
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ACTIVITYGUARD.java
 Thu Feb 11 13:07:38 2010
@@ -29,6 +29,7 @@
 import org.apache.ode.bpel.explang.EvaluationException;
 import org.apache.ode.bpel.o.OActivity;
 import org.apache.ode.bpel.o.OExpression;
+import org.apache.ode.bpel.o.OInvoke;
 import org.apache.ode.bpel.o.OLink;
 import org.apache.ode.bpel.o.OScope;
 import org.apache.ode.bpel.o.OFailureHandling;
@@ -237,6 +238,15 @@
                     // Implicit scope can tell the difference between 
cancelled and completed.
                     _self.parent.cancelled();
                 }
+                
+                private OFailureHandling getFailureHandling() {
+                    if (_oactivity instanceof OInvoke) {
+                        OInvoke _oinvoke = (OInvoke) _oactivity;
+                        OFailureHandling f = 
getBpelRuntimeContext().getFailureHandlingForPartnerLink(_oinvoke.partnerLink);
+                        if (f != null) return f;
+                    }
+                    return _oactivity.getFailureHandling();
+                }
 
                 public void failure(String reason, Element data) {
                     if (_failure == null)
@@ -245,7 +255,7 @@
                     _failure.reason = reason;
                     _failure.data = data;
 
-                    OFailureHandling failureHandling = 
_oactivity.getFailureHandling();
+                    OFailureHandling failureHandling = getFailureHandling();
                     if (failureHandling != null && 
failureHandling.faultOnFailure) {
                       // No attempt to retry or enter activity recovery state, 
simply fault.
                         if (__log.isDebugEnabled())

Modified: 
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/BpelRuntimeContext.java
URL: 
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/BpelRuntimeContext.java?rev=908952&r1=908951&r2=908952&view=diff
==============================================================================
--- 
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/BpelRuntimeContext.java
 (original)
+++ 
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/BpelRuntimeContext.java
 Thu Feb 11 13:07:38 2010
@@ -29,6 +29,7 @@
 import org.apache.ode.bpel.common.CorrelationKey;
 import org.apache.ode.bpel.common.FaultException;
 import org.apache.ode.bpel.evt.ProcessInstanceEvent;
+import org.apache.ode.bpel.o.OFailureHandling;
 import org.apache.ode.bpel.o.OPartnerLink;
 import org.apache.ode.bpel.o.OProcess;
 import org.apache.ode.bpel.o.OScope;
@@ -110,6 +111,13 @@
     boolean isPartnerRoleEndpointInitialized(PartnerLinkInstance pLink);
 
     /**
+     * Retrieve failure handling info for invoke
+     * @param pLink
+     * @return
+     */
+    OFailureHandling getFailureHandlingForPartnerLink(OPartnerLink pLink);
+
+    /**
      * Fetches our session id associated with the partner link instance.  This 
will always return a
      * non-null value.
      * @param pLink partner link

Modified: 
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/INVOKE.java
URL: 
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/INVOKE.java?rev=908952&r1=908951&r2=908952&view=diff
==============================================================================
--- 
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/INVOKE.java
 (original)
+++ 
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/INVOKE.java
 Thu Feb 11 13:07:38 2010
@@ -229,51 +229,4 @@
             return (Element) outboundMsg;
         } else return null;
     }
-
-    @SuppressWarnings("unused")
-    // TODO: does somebody need this method??
-    private void requireRecovery() {
-        if (__log.isDebugEnabled())
-            __log.debug("ActivityRecovery: Invoke activity " + _self.aId + " 
requires recovery");
-        sendEvent(new ActivityFailureEvent(_failureReason));
-        final ActivityRecoveryChannel recoveryChannel = 
newChannel(ActivityRecoveryChannel.class);
-        getBpelRuntimeContext().registerActivityForRecovery(recoveryChannel, 
_self.aId, _failureReason, _lastFailure, _failureData,
-                new String[] { "retry", "cancel", "fault" }, _invoked - 1);
-        object(false, new ActivityRecoveryChannelListener(recoveryChannel) {
-            private static final long serialVersionUID = 8397883882810521685L;
-            public void retry() {
-                if (__log.isDebugEnabled())
-                    __log.debug("ActivityRecovery: Retrying invoke activity " 
+ _self.aId + " (user initiated)");
-                sendEvent(new ActivityRecoveryEvent("retry"));
-                
getBpelRuntimeContext().unregisterActivityForRecovery(recoveryChannel);
-                instance(INVOKE.this);
-            }
-            public void cancel() {
-                if (__log.isDebugEnabled())
-                    __log.debug("ActivityRecovery: Cancelling invoke activity 
" + _self.aId + " (user initiated)");
-                sendEvent(new ActivityRecoveryEvent("cancel"));
-                
getBpelRuntimeContext().unregisterActivityForRecovery(recoveryChannel);
-                _self.parent.cancelled();
-            }
-            public void fault(FaultData faultData) {
-                if (__log.isDebugEnabled())
-                    __log.debug("ActivityRecovery: Faulting invoke activity " 
+ _self.aId + " (user initiated)");
-                sendEvent(new ActivityRecoveryEvent("fault"));
-                
getBpelRuntimeContext().unregisterActivityForRecovery(recoveryChannel);
-                if (faultData == null)
-                    faultData = 
createFault(OFailureHandling.FAILURE_FAULT_NAME, _self.o, _failureReason);
-                _self.parent.completed(faultData, 
CompensationHandler.emptySet());
-            }
-        }.or(new TerminationChannelListener(_self.self) {
-            private static final long serialVersionUID = 2148587381204858397L;
-
-            public void terminate() {
-                if (__log.isDebugEnabled())
-                    __log.debug("ActivityRecovery: Cancelling invoke activity 
" + _self.aId + " (terminated by scope)");
-                
getBpelRuntimeContext().unregisterActivityForRecovery(recoveryChannel);
-                _self.parent.completed(null, CompensationHandler.emptySet());
-            }
-        }));
-    }
-
 }

Modified: 
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/ActivityRecoveryTest.java
URL: 
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/ActivityRecoveryTest.java?rev=908952&r1=908951&r2=908952&view=diff
==============================================================================
--- 
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/ActivityRecoveryTest.java
 (original)
+++ 
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/ActivityRecoveryTest.java
 Thu Feb 11 13:07:38 2010
@@ -150,16 +150,27 @@
         assertRecovery(1, ACTIONS);
     }
 
-//    public void testImmediateFailureAndFault() throws Exception {
-//        // This process responds to failure with a fault.
-//        
_testService.expects(exactly(1)).method("invoke").will(returnValue(false));
-//        _testService.expects(never()).method("completed").after("invoke");
-//
-//        execute("FailureToFault");
-//        assertTrue(lastInstance().getStatus() == TInstanceStatus.FAILED);
-//        
assertTrue(OFailureHandling.FAILURE_FAULT_NAME.equals(lastInstance().getFaultInfo().getName()));
-//        assertNoFailures();
-//    }
+    public void testImmediateFailureAndFault() throws Exception {
+        // This process responds to failure with a fault.
+        
_testService.expects(exactly(1)).method("invoke").will(returnValue(false));
+        _testService.expects(never()).method("completed").after("invoke");
+
+        execute("FailureToFault");
+        assertNotNull(lastInstance(TInstanceStatus.FAILED));
+        
assertTrue(OFailureHandling.FAILURE_FAULT_NAME.equals(lastInstance(TInstanceStatus.FAILED).getFaultInfo().getName()));
+        assertNoFailures();
+    }
+
+    public void testImmediateFailureAndFault2() throws Exception {
+        // This process responds to failure with a fault.
+        
_testService.expects(exactly(1)).method("invoke").will(returnValue(false));
+        _testService.expects(never()).method("completed").after("invoke");
+
+        execute("FailureToFault2");
+        assertNotNull(lastInstance(TInstanceStatus.FAILED));
+        
assertTrue(OFailureHandling.FAILURE_FAULT_NAME.equals(lastInstance(TInstanceStatus.FAILED).getFaultInfo().getName()));
+        assertNoFailures();
+    }
 
     public void testFailureHandlingInheritence() throws Exception {
         // Since the invocation is repeated 3 times, the process completes 
after

Modified: 
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/CoreBpelTest.java
URL: 
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/CoreBpelTest.java?rev=908952&r1=908951&r2=908952&view=diff
==============================================================================
--- 
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/CoreBpelTest.java
 (original)
+++ 
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/CoreBpelTest.java
 Thu Feb 11 13:07:38 2010
@@ -35,6 +35,7 @@
 import org.apache.ode.bpel.evt.ProcessInstanceEvent;
 import org.apache.ode.bpel.o.OCatch;
 import org.apache.ode.bpel.o.OEmpty;
+import org.apache.ode.bpel.o.OFailureHandling;
 import org.apache.ode.bpel.o.OFaultHandler;
 import org.apache.ode.bpel.o.OFlow;
 import org.apache.ode.bpel.o.OMessageVarType;
@@ -466,4 +467,8 @@
         String opName, String mexId, String mexRef) {
         // TODO Auto-generated method stub
     }
+
+    public OFailureHandling getFailureHandlingForPartnerLink(OPartnerLink 
pLink) {
+        return null;
+    }
 }

Modified: 
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/test/resources/recovery/deploy.xml
URL: 
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-runtime/src/test/resources/recovery/deploy.xml?rev=908952&r1=908951&r2=908952&view=diff
==============================================================================
--- 
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/test/resources/recovery/deploy.xml 
(original)
+++ 
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/test/resources/recovery/deploy.xml 
Thu Feb 11 13:07:38 2010
@@ -47,6 +47,22 @@
     </invoke>
   </process>
 
+  <process name="pns:FailureToFault2">
+    <active>true</active>
+    <provide partnerLink="instantiatingPartnerLink">
+      <service name="wns:FailureToFault2" port="soap"/>
+    </provide>
+    <invoke partnerLink="failingPartnerLink">
+      <service name="wns:FailingService" port="soap"/>
+      <ext:failureHandling xmlns:ext="http://ode.apache.org/activityRecovery";>
+        <ext:faultOnFailure>true</ext:faultOnFailure>
+      </ext:failureHandling>
+    </invoke>
+    <invoke partnerLink="instantiatingPartnerLink">
+      <service name="wns:ResponseService" port="soap"/>
+    </invoke>
+  </process>
+
   <process name="pns:FailureNoRetry">
     <active>true</active>
     <provide partnerLink="instantiatingPartnerLink">

Added: 
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/test/resources/recovery/failure-to-fault2.bpel
URL: 
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-runtime/src/test/resources/recovery/failure-to-fault2.bpel?rev=908952&view=auto
==============================================================================
--- 
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/test/resources/recovery/failure-to-fault2.bpel
 (added)
+++ 
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/test/resources/recovery/failure-to-fault2.bpel
 Thu Feb 11 13:07:38 2010
@@ -0,0 +1,78 @@
+<?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="FailureToFault2"
+         targetNamespace="http://ode.apache.org/bpel/unit-test"; 
+         xmlns="http://schemas.xmlsoap.org/ws/2004/03/business-process/";
+         xmlns:tns="http://ode.apache.org/bpel/unit-test";
+         xmlns:xsd="http://www.w3.org/2001/XMLSchema";
+         xmlns:ext="http://ode.apache.org/activityRecovery";>
+
+  <import location="services.wsdl"
+          namespace="http://ode.apache.org/bpel/unit-test";
+          importType="http://schemas.xmlsoap.org/wsdl/"/>
+
+  <partnerLinks>
+    <partnerLink name="instantiatingPartnerLink" 
+                 partnerLinkType="tns:InstantiatingPartnerLinkType" 
+                 myRole="me" partnerRole="partner" 
initializePartnerRole="yes"/>
+    <partnerLink name="failingPartnerLink" 
+                 partnerLinkType="tns:FailingPartnerLinkType" 
+                 partnerRole="partner" initializePartnerRole="yes"/>
+  </partnerLinks>
+    
+  <variables>
+    <variable name="request" messageType="tns:Request"/>
+    <variable name="response" messageType="tns:Response"/>
+  </variables>
+
+  <sequence>   
+    <receive name="start"
+             partnerLink="instantiatingPartnerLink"
+             portType="tns:InstantiatingPortType"
+             operation="instantiate"
+             variable="request"
+             createInstance="yes"/>
+    <flow>
+      <links>
+        <link name="successfulInvoke"/>
+      </links>
+      <invoke name="invoke"
+              partnerLink="failingPartnerLink"
+              portType="tns:FailingPortType"
+              operation="invoke"
+              inputVariable="request"
+              outputVariable="response">
+        <sources>
+          <source linkName="successfulInvoke"/>
+        </sources>
+      </invoke>
+      <invoke name="response"
+              partnerLink="instantiatingPartnerLink"
+              portType="tns:ResponsePortType"
+              operation="respond"
+              inputVariable="response">
+        <targets>
+          <target linkName="successfulInvoke"/>
+        </targets>
+      </invoke>
+    </flow>
+  </sequence>
+
+</process>

Propchange: 
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/test/resources/recovery/failure-to-fault2.bpel
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
ode/branches/APACHE_ODE_1.X/bpel-schemas/src/main/xsd/activityRecovery.xsd
URL: 
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-schemas/src/main/xsd/activityRecovery.xsd?rev=908952&view=auto
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-schemas/src/main/xsd/activityRecovery.xsd 
(added)
+++ ode/branches/APACHE_ODE_1.X/bpel-schemas/src/main/xsd/activityRecovery.xsd 
Thu Feb 11 13:07:38 2010
@@ -0,0 +1,31 @@
+<?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.
+  -->
+  
+<schema xmlns="http://www.w3.org/2001/XMLSchema"; 
targetNamespace="http://ode.apache.org/activityRecovery"; 
xmlns:ext="http://ode.apache.org/activityRecovery"; 
elementFormDefault="qualified">
+  <element name="failureHandling">
+    <complexType>
+      <all>
+        <element name="retryFor" type="int" minOccurs="0"></element>
+        <element name="retryDelay" type="int" minOccurs="0"></element>
+        <element name="faultOnFailure" type="boolean" minOccurs="0"></element>
+      </all>
+    </complexType>
+  </element>
+</schema>
\ No newline at end of file

Propchange: 
ode/branches/APACHE_ODE_1.X/bpel-schemas/src/main/xsd/activityRecovery.xsd
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: ode/branches/APACHE_ODE_1.X/bpel-schemas/src/main/xsd/dd.xsd
URL: 
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-schemas/src/main/xsd/dd.xsd?rev=908952&r1=908951&r2=908952&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-schemas/src/main/xsd/dd.xsd (original)
+++ ode/branches/APACHE_ODE_1.X/bpel-schemas/src/main/xsd/dd.xsd Thu Feb 11 
13:07:38 2010
@@ -19,10 +19,13 @@
   -->
 
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
+           xmlns:ext="http://ode.apache.org/activityRecovery";
            targetNamespace="http://www.apache.org/ode/schemas/dd/2007/03";
            xmlns:dd="http://www.apache.org/ode/schemas/dd/2007/03";
            elementFormDefault="qualified">
 
+    <xs:import namespace="http://ode.apache.org/activityRecovery"; 
schemaLocation="activityRecovery.xsd"></xs:import>
+
     <xs:element name="deploy" id="deploy" type="dd:tDeployment">
     </xs:element>
 
@@ -130,6 +133,7 @@
                     <xs:attribute name="name" type="xs:QName" use="required"/>
                 </xs:complexType>
             </xs:element>
+            <xs:element ref="ext:failureHandling" minOccurs="0"/>
         </xs:choice>
         <xs:attribute name="partnerLink" type="xs:string" use="required"/>
     </xs:complexType>

Modified: 
ode/branches/APACHE_ODE_1.X/bpel-store/src/main/java/org/apache/ode/store/ProcessConfImpl.java
URL: 
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-store/src/main/java/org/apache/ode/store/ProcessConfImpl.java?rev=908952&r1=908951&r2=908952&view=diff
==============================================================================
--- 
ode/branches/APACHE_ODE_1.X/bpel-store/src/main/java/org/apache/ode/store/ProcessConfImpl.java
 (original)
+++ 
ode/branches/APACHE_ODE_1.X/bpel-store/src/main/java/org/apache/ode/store/ProcessConfImpl.java
 Thu Feb 11 13:07:38 2010
@@ -33,6 +33,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.ode.activityRecovery.FailureHandlingDocument.FailureHandling;
 import org.apache.ode.bpel.dd.TCleanup;
 import org.apache.ode.bpel.dd.TDeployment;
 import org.apache.ode.bpel.dd.TInvoke;
@@ -49,6 +50,7 @@
 import org.apache.ode.bpel.iapi.ProcessState;
 import org.apache.ode.bpel.iapi.EndpointReferenceContext;
 import org.apache.ode.bpel.iapi.EndpointReference;
+import org.apache.ode.bpel.o.OFailureHandling;
 import org.apache.ode.store.DeploymentUnitDir.CBPInfo;
 import org.apache.ode.utils.CronExpression;
 import org.apache.ode.utils.DOMUtils;
@@ -72,6 +74,7 @@
     private File _configDir;
     private final Map<QName, Node> _props;
     private final HashMap<String, Endpoint> _partnerRoleInitialValues = new 
HashMap<String, Endpoint>();
+    private final HashMap<String, OFailureHandling> 
_partnerRoleFailureHandling = new HashMap<String, OFailureHandling>();
 
     private final HashMap<String, Endpoint> _myRoleEndpoints = new 
HashMap<String, Endpoint>();
     private final ArrayList<QName> _sharedServices = new ArrayList<QName>();
@@ -164,6 +167,17 @@
                 __log.debug("Processing <invoke> element for process " + 
_pinfo.getName() + ": partnerlink " + plinkName + " --> "
                         + service);
                 _partnerRoleInitialValues.put(plinkName, new 
Endpoint(service.getName(), service.getPort()));
+                
+                {
+                    if (invoke.isSetFailureHandling()) {
+                        FailureHandling f = invoke.getFailureHandling();
+                        OFailureHandling g = new OFailureHandling();
+                        if (f.isSetFaultOnFailure()) g.faultOnFailure = 
f.getFaultOnFailure();
+                        if (f.isSetRetryDelay()) g.retryDelay = 
f.getRetryDelay();
+                        if (f.isSetRetryFor()) g.retryFor = f.getRetryFor();
+                        _partnerRoleFailureHandling.put(plinkName, g);
+                    }
+                }
             }
         }
 
@@ -283,6 +297,10 @@
         return Collections.unmodifiableMap(_partnerRoleInitialValues);
     }
 
+    public Map<String, OFailureHandling> getInvokeFailureHandling() {
+        return Collections.unmodifiableMap(_partnerRoleFailureHandling);
+    }
+
     public Map<String, Endpoint> getProvideEndpoints() {
         return Collections.unmodifiableMap(_myRoleEndpoints);
     }


Reply via email to