ode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mszef...@apache.org
Subject svn commit: r581046 - in /ode/trunk: bpel-api/src/main/java/org/apache/ode/bpel/common/ bpel-api/src/main/java/org/apache/ode/bpel/explang/ bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath10/runtime/ bpel-runtime/src/main/java/org/apache/ode/...
Date Mon, 01 Oct 2007 19:44:56 GMT
Author: mszefler
Date: Mon Oct  1 12:44:54 2007
New Revision: 581046

URL: http://svn.apache.org/viewvc?rev=581046&view=rev
Log:
Remove the EvaluationException class, use FaultException instead. 


Removed:
    ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/explang/EvaluationException.java
    ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/explang/TypeCastException.java
Modified:
    ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/common/FaultException.java
    ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/explang/ExpressionLanguageRuntime.java
    ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath10/runtime/XPath10ExpressionRuntime.java
    ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath20/runtime/XPath20ExpressionRuntime.java
    ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelProcess.java
    ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
    ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ACTIVITY.java
    ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ACTIVITYGUARD.java
    ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ASSIGN.java
    ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/BpelRuntimeContext.java
    ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/EH_ALARM.java
    ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ExprEvaluationContextImpl.java
    ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ExpressionLanguageRuntimeRegistry.java
    ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/FLOW.java
    ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/FOREACH.java
    ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/LinkFrame.java
    ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/LinkInfo.java
    ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PICK.java
    ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/REPEATUNTIL.java
    ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPEACT.java
    ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SWITCH.java
    ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/WAIT.java
    ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/WHILE.java
    ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/explang/konst/KonstExpressionLanguageRuntimeImpl.java
    ode/trunk/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/CoreBpelTest.java
    ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestFlowActivity2/TestActivityFlow.bpel

Modified: ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/common/FaultException.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/common/FaultException.java?rev=581046&r1=581045&r2=581046&view=diff
==============================================================================
--- ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/common/FaultException.java (original)
+++ ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/common/FaultException.java Mon Oct  1 12:44:54 2007
@@ -28,21 +28,24 @@
  */
 public class FaultException extends Exception {
   private static final long serialVersionUID = 389190682205802035L;
-  private QName _qname;
+  private final QName _qname;
 
+  
+  public FaultException(QName qname, String message, Throwable cause) {
+      super(qname.toString() + ": " + message, cause);
+      _qname = qname;
+  }
   /**
    * Create a new instance.
    * @param qname the <code>QName</code> of the fault
    * @param message a descriptive message for the exception
    */
   public FaultException(QName qname, String message) {
-    super(message);
-    _qname = qname;
+    this(qname, message, null);
   }
 
   public FaultException(QName qname) {
-    super(qname.toString());
-    _qname = qname;
+    this(qname, null, null);
   }
 
   /**

Modified: ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/explang/ExpressionLanguageRuntime.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/explang/ExpressionLanguageRuntime.java?rev=581046&r1=581045&r2=581046&view=diff
==============================================================================
--- ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/explang/ExpressionLanguageRuntime.java (original)
+++ ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/explang/ExpressionLanguageRuntime.java Mon Oct  1 12:44:54 2007
@@ -36,23 +36,23 @@
   void initialize(Map properties) throws ConfigurationException;
 
   String evaluateAsString(OExpression cexp, EvaluationContext ctx)
-          throws FaultException, EvaluationException;
+          throws FaultException;
 
   boolean evaluateAsBoolean(OExpression cexp, EvaluationContext ctx)
-          throws FaultException, EvaluationException;
+          throws FaultException;
 
   Number evaluateAsNumber(OExpression cexp, EvaluationContext ctx)
-          throws FaultException, EvaluationException;
+          throws FaultException;
 
   List evaluate(OExpression cexp, EvaluationContext ctx)
-          throws FaultException, EvaluationException;
+          throws FaultException;
 
   Calendar evaluateAsDate(OExpression cexp, EvaluationContext context)
-          throws FaultException, EvaluationException;
+          throws FaultException;
 
   Duration evaluateAsDuration(OExpression cexp, EvaluationContext context)
-          throws FaultException, EvaluationException;
+          throws FaultException;
 
   Node evaluateNode(OExpression cexp, EvaluationContext context)
-          throws FaultException, EvaluationException;
+          throws FaultException;
 }

Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath10/runtime/XPath10ExpressionRuntime.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath10/runtime/XPath10ExpressionRuntime.java?rev=581046&r1=581045&r2=581046&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath10/runtime/XPath10ExpressionRuntime.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath10/runtime/XPath10ExpressionRuntime.java Mon Oct  1 12:44:54 2007
@@ -24,7 +24,6 @@
 import org.apache.ode.bpel.elang.xpath10.o.OXPath10Expression;
 import org.apache.ode.bpel.explang.ConfigurationException;
 import org.apache.ode.bpel.explang.EvaluationContext;
-import org.apache.ode.bpel.explang.EvaluationException;
 import org.apache.ode.bpel.explang.ExpressionLanguageRuntime;
 import org.apache.ode.bpel.o.OExpression;
 import org.apache.ode.utils.DOMUtils;
@@ -62,35 +61,34 @@
     public void initialize(Map properties) throws ConfigurationException {
     }
 
-    public String evaluateAsString(OExpression cexp, EvaluationContext ctx) throws FaultException, EvaluationException {
+    public String evaluateAsString(OExpression cexp, EvaluationContext ctx) throws FaultException {
         try {
             return compile((OXPath10Expression) cexp).stringValueOf(createContext((OXPath10Expression) cexp, ctx));
         } catch (JaxenException e) {
-            handleJaxenException(e);
+            handleJaxenException(cexp, e);
         }
         throw new AssertionError("UNREACHABLE");
     }
 
-    public boolean evaluateAsBoolean(OExpression cexp, EvaluationContext ctx) throws FaultException,
-            EvaluationException {
+    public boolean evaluateAsBoolean(OExpression cexp, EvaluationContext ctx) throws FaultException {
         try {
             return compile((OXPath10Expression) cexp).booleanValueOf(createContext((OXPath10Expression) cexp, ctx));
         } catch (JaxenException e) {
-            handleJaxenException(e);
+            handleJaxenException(cexp, e);
         }
         throw new AssertionError("UNREACHABLE");
     }
 
-    public Number evaluateAsNumber(OExpression cexp, EvaluationContext ctx) throws FaultException, EvaluationException {
+    public Number evaluateAsNumber(OExpression cexp, EvaluationContext ctx) throws FaultException {
         try {
             return compile((OXPath10Expression) cexp).numberValueOf(createContext((OXPath10Expression) cexp, ctx));
         } catch (JaxenException e) {
-            handleJaxenException(e);
+            handleJaxenException(cexp, e);
         }
         throw new AssertionError("UNREACHABLE");
     }
 
-    public List evaluate(OExpression cexp, EvaluationContext ctx) throws FaultException, EvaluationException {
+    public List evaluate(OExpression cexp, EvaluationContext ctx) throws FaultException{
         try {
             XPath compiledXPath = compile((OXPath10Expression) cexp);
             Context context = createContext((OXPath10Expression) cexp, ctx);
@@ -111,12 +109,12 @@
             return retVal;
 
         } catch (JaxenException je) {
-            handleJaxenException(je);
+            handleJaxenException(cexp, je);
         }
         throw new AssertionError("UNREACHABLE");
     }
 
-    public Node evaluateNode(OExpression cexp, EvaluationContext ctx) throws FaultException, EvaluationException {
+    public Node evaluateNode(OExpression cexp, EvaluationContext ctx) throws FaultException{
         List retVal = evaluate(cexp, ctx);
         if (retVal.size() == 0)
             throw new FaultException(cexp.getOwner().constants.qnSelectionFailure, "No results for expression: " + cexp);
@@ -126,8 +124,7 @@
         return (Node) retVal.get(0);
     }
 
-    public Calendar evaluateAsDate(OExpression cexp, EvaluationContext context) throws FaultException,
-            EvaluationException {
+    public Calendar evaluateAsDate(OExpression cexp, EvaluationContext context) throws FaultException {
 
         String literal = evaluateAsString(cexp, context);
         try {
@@ -139,8 +136,7 @@
         }
     }
 
-    public Duration evaluateAsDuration(OExpression cexp, EvaluationContext context) throws FaultException,
-            EvaluationException {
+    public Duration evaluateAsDuration(OExpression cexp, EvaluationContext context) throws FaultException{
         String literal = this.evaluateAsString(cexp, context);
         try {
             Duration duration = new org.apache.ode.utils.xsd.Duration(literal);
@@ -175,13 +171,13 @@
         return xpath;
     }
 
-    private void handleJaxenException(JaxenException je) throws EvaluationException, FaultException {
+    private void handleJaxenException(OExpression cexp, JaxenException je) throws FaultException {
         if (je instanceof WrappedFaultException) {
             throw ((WrappedFaultException) je).getFaultException();
         } else if (je.getCause() instanceof WrappedFaultException) {
             throw ((WrappedFaultException) je.getCause()).getFaultException();
         } else {
-            throw new EvaluationException(je.getMessage(), je);
+            throw new FaultException(cexp.getOwner().constants.qnSubLanguageExecutionFault, je.getMessage(), je);
         }
 
     }

Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath20/runtime/XPath20ExpressionRuntime.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath20/runtime/XPath20ExpressionRuntime.java?rev=581046&r1=581045&r2=581046&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath20/runtime/XPath20ExpressionRuntime.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/elang/xpath20/runtime/XPath20ExpressionRuntime.java Mon Oct  1 12:44:54 2007
@@ -28,7 +28,6 @@
 import org.apache.ode.bpel.elang.xpath20.o.OXPath20ExpressionBPEL20;
 import org.apache.ode.bpel.explang.ConfigurationException;
 import org.apache.ode.bpel.explang.EvaluationContext;
-import org.apache.ode.bpel.explang.EvaluationException;
 import org.apache.ode.bpel.explang.ExpressionLanguageRuntime;
 import org.apache.ode.bpel.o.OExpression;
 import org.apache.ode.utils.DOMUtils;
@@ -74,25 +73,25 @@
     /**
      * @see org.apache.ode.bpel.explang.ExpressionLanguageRuntime#evaluateAsString(org.apache.ode.bpel.o.OExpression, org.apache.ode.bpel.explang.EvaluationContext)
      */
-    public String evaluateAsString(OExpression cexp, EvaluationContext ctx) throws FaultException, EvaluationException {
+    public String evaluateAsString(OExpression cexp, EvaluationContext ctx) throws FaultException{
         return (String)evaluate(cexp, ctx, XPathConstants.STRING);
     }
 
     /**
      * @see org.apache.ode.bpel.explang.ExpressionLanguageRuntime#evaluateAsBoolean(org.apache.ode.bpel.o.OExpression, org.apache.ode.bpel.explang.EvaluationContext)
      */
-    public boolean evaluateAsBoolean(OExpression cexp, EvaluationContext ctx) throws FaultException, EvaluationException {
+    public boolean evaluateAsBoolean(OExpression cexp, EvaluationContext ctx) throws FaultException{
         return (Boolean) evaluate(cexp, ctx, XPathConstants.BOOLEAN);
     }
 
-    public Number evaluateAsNumber(OExpression cexp, EvaluationContext ctx) throws FaultException, EvaluationException {
+    public Number evaluateAsNumber(OExpression cexp, EvaluationContext ctx) throws FaultException {
         return (Number) evaluate(cexp, ctx, XPathConstants.NUMBER);
     }
 
     /**
      * @see org.apache.ode.bpel.explang.ExpressionLanguageRuntime#evaluate(org.apache.ode.bpel.o.OExpression, org.apache.ode.bpel.explang.EvaluationContext)
      */
-    public List evaluate(OExpression cexp, EvaluationContext ctx) throws FaultException, EvaluationException {
+    public List evaluate(OExpression cexp, EvaluationContext ctx) throws FaultException {
         List result;
         Object someRes = evaluate(cexp, ctx, XPathConstants.NODESET);
         if (someRes instanceof List) {
@@ -133,7 +132,7 @@
         return result;
     }
 
-    public Node evaluateNode(OExpression cexp, EvaluationContext ctx) throws FaultException, EvaluationException {
+    public Node evaluateNode(OExpression cexp, EvaluationContext ctx) throws FaultException  {
         List retVal = evaluate(cexp, ctx);
         if (retVal.size() == 0)
             throw new FaultException(cexp.getOwner().constants.qnSelectionFailure, "No results for expression: " + cexp);
@@ -142,7 +141,7 @@
         return (Node) retVal.get(0);
     }
 
-    public Calendar evaluateAsDate(OExpression cexp, EvaluationContext context) throws FaultException, EvaluationException {
+    public Calendar evaluateAsDate(OExpression cexp, EvaluationContext context) throws FaultException {
         String literal = evaluateAsString(cexp, context);
         try {
             return ISO8601DateParser.parseCal(literal);
@@ -153,7 +152,7 @@
         }
     }
 
-    public Duration evaluateAsDuration(OExpression cexp, EvaluationContext context) throws FaultException, EvaluationException {
+    public Duration evaluateAsDuration(OExpression cexp, EvaluationContext context) throws FaultException  {
         String literal = this.evaluateAsString(cexp, context);
         try {
             return new Duration(literal);
@@ -164,7 +163,7 @@
         }
     }
 
-    private Object evaluate(OExpression cexp, EvaluationContext ctx, QName type) throws FaultException, EvaluationException {
+    private Object evaluate(OExpression cexp, EvaluationContext ctx, QName type) throws FaultException {
         try {
             net.sf.saxon.xpath.XPathFactoryImpl xpf = new net.sf.saxon.xpath.XPathFactoryImpl();
 
@@ -194,13 +193,13 @@
                     if (cause.getCause() != null) cause = cause.getCause();
                 }
             }
-            throw new EvaluationException("Error while executing an XPath expression: " + cause.toString(), cause);
+            throw new FaultException(cexp.getOwner().constants.qnSubLanguageExecutionFault, cause.getMessage(), cause);
         } catch (WrappedResolverException wre) {
             wre.printStackTrace();
             throw (FaultException)wre.getCause();
         } catch (Throwable t) {
             t.printStackTrace();
-            throw new EvaluationException("Error while executing an XPath expression: ", t);
+            throw new FaultException(cexp.getOwner().constants.qnSubLanguageExecutionFault, t.getMessage(), t);
         }
 
     }

Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelProcess.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelProcess.java?rev=581046&r1=581045&r2=581046&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelProcess.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelProcess.java Mon Oct  1 12:44:54 2007
@@ -48,7 +48,6 @@
 import org.apache.ode.bpel.evt.ProcessInstanceEvent;
 import org.apache.ode.bpel.evt.ScopeEvent;
 import org.apache.ode.bpel.explang.ConfigurationException;
-import org.apache.ode.bpel.explang.EvaluationException;
 import org.apache.ode.bpel.iapi.BpelEngineException;
 import org.apache.ode.bpel.iapi.Endpoint;
 import org.apache.ode.bpel.iapi.EndpointReference;
@@ -451,11 +450,7 @@
         Node lValue = ectx.getRootNode();
 
         if (alias.location != null)
-            try {
-                lValue = _expLangRuntimeRegistry.evaluateNode(alias.location, ectx);
-            } catch (EvaluationException ec) {
-                throw new FaultException(getOProcess().constants.qnSelectionFailure, alias.getDescription());
-            }
+            lValue = _expLangRuntimeRegistry.evaluateNode(alias.location, ectx);
 
         if (lValue == null) {
             String errmsg = __msgs.msgPropertyAliasReturnedNullSet(alias.getDescription(), target);

Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java?rev=581046&r1=581045&r2=581046&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java Mon Oct  1 12:44:54 2007
@@ -117,6 +117,8 @@
 
     private boolean _executed;
 
+    private boolean _forceFlush;
+
     BpelRuntimeContextImpl(BpelInstanceWorker instanceWorker, ProcessInstanceDAO dao) {
         this(instanceWorker, dao, new ExecutionQueueImpl(null));
 
@@ -751,7 +753,7 @@
 
         // Execute the process state reductions
         boolean canReduce = true;
-        while (ProcessState.canExecute(_dao.getState()) && System.currentTimeMillis() < maxTime && canReduce) {
+        while (ProcessState.canExecute(_dao.getState()) && System.currentTimeMillis() < maxTime && canReduce && !_forceFlush) {
             canReduce = _vpu.execute();
         }
 
@@ -1177,5 +1179,9 @@
             __log.debug("initializing partner " + pLink + "  sessionId to " + session);
         fetchPartnerLinkDAO(pLink).setPartnerSessionId(session);
 
+    }
+
+    public void forceFlush() {
+        _forceFlush = true;
     }
 }

Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ACTIVITY.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ACTIVITY.java?rev=581046&r1=581045&r2=581046&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ACTIVITY.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ACTIVITY.java Mon Oct  1 12:44:54 2007
@@ -95,7 +95,7 @@
     protected void dpe(Collection<OLink> links) {
         // Dead path all of the ougoing links (nothing has been activated yet!)
         for (Iterator<OLink> i = links.iterator(); i.hasNext();)
-            _linkFrame.resolve(i.next()).pub.linkStatus(false);
+            _linkFrame.resolve(i.next()).channel.linkStatus(false);
     }
 
     /**

Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ACTIVITYGUARD.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ACTIVITYGUARD.java?rev=581046&r1=581045&r2=581046&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ACTIVITYGUARD.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ACTIVITYGUARD.java Mon Oct  1 12:44:54 2007
@@ -26,7 +26,6 @@
 import org.apache.ode.bpel.evt.ActivityExecStartEvent;
 import org.apache.ode.bpel.evt.ActivityFailureEvent;
 import org.apache.ode.bpel.evt.ActivityRecoveryEvent;
-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.OLink;
@@ -118,7 +117,7 @@
             });
             for (Iterator<OLink> i = _oactivity.targetLinks.iterator();i.hasNext();) {
                 final OLink link = i.next();
-                mlset.add(new LinkStatusChannelListener(_linkFrame.resolve(link).sub) {
+                mlset.add(new LinkStatusChannelListener(_linkFrame.resolve(link).channel) {
                     private static final long serialVersionUID = 1024137371118887935L;
 
                     public void linkStatus(boolean value) {
@@ -138,14 +137,9 @@
         if (transitionCondition == null)
             return true;
 
-        try {
-            return getBpelRuntimeContext().getExpLangRuntime().evaluateAsBoolean(transitionCondition,
-                    new ExprEvaluationContextImpl(_scopeFrame, getBpelRuntimeContext()));
-        } catch (EvaluationException e) {
-            String msg = "Error in transition condition detected at runtime; condition=" + transitionCondition;
-            __log.error(msg,e);
-            throw new InvalidProcessException(msg, e);
-        }
+        return getBpelRuntimeContext().getExpLangRuntime().evaluateAsBoolean(transitionCondition,
+                new ExprEvaluationContextImpl(_scopeFrame, getBpelRuntimeContext()));
+
     }
 
     /**
@@ -220,9 +214,9 @@
                             LinkInfo linfo = _linkFrame.resolve(olink);
                             try {
                                 boolean val = evaluateTransitionCondition(olink.transitionCondition);
-                                linfo.pub.linkStatus(val);
+                                linfo.channel.linkStatus(val);
                             } catch (FaultException e) {
-                                linfo.pub.linkStatus(false);
+                                linfo.channel.linkStatus(false);
                                 __log.error(e);
                                 if (fault == null)
                                     fault = createFault(e.getQName(),olink.transitionCondition);

Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ASSIGN.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ASSIGN.java?rev=581046&r1=581045&r2=581046&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ASSIGN.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ASSIGN.java Mon Oct  1 12:44:54 2007
@@ -25,7 +25,6 @@
 import org.apache.ode.bpel.evt.ScopeEvent;
 import org.apache.ode.bpel.evt.VariableModificationEvent;
 import org.apache.ode.bpel.explang.EvaluationContext;
-import org.apache.ode.bpel.explang.EvaluationException;
 import org.apache.ode.bpel.o.OAssign;
 import org.apache.ode.bpel.o.OAssign.DirectRef;
 import org.apache.ode.bpel.o.OAssign.LValueExpression;
@@ -189,19 +188,10 @@
         } else if (from instanceof OAssign.Expression) {
             List l;
             OExpression expr = ((OAssign.Expression) from).expression;
-            try {
-                l = getBpelRuntimeContext().getExpLangRuntime().evaluate(expr,
-                        getEvaluationContext());
-            } catch (EvaluationException e) {
-                String msg = __msgs.msgEvalException(from.toString(), e
-                        .getMessage());
-                if (__log.isDebugEnabled())
-                    __log.debug(from + ": " + msg);
-                if (e.getCause() instanceof FaultException) throw (FaultException)e.getCause();
-                throw new FaultException(
-                        getOAsssign().getOwner().constants.qnSelectionFailure,
-                        msg);
-            }
+
+            l = getBpelRuntimeContext().getExpLangRuntime().evaluate(expr,
+                    getEvaluationContext());
+
             if (l.size() == 0) {
                 String msg = __msgs.msgRValueNoNodesSelected(expr.toString());
                 if (__log.isDebugEnabled())
@@ -633,13 +623,9 @@
         public Node evaluateQuery(Node root, OExpression expr)
                 throws FaultException {
             _rootNode = root;
-            try {
-                return getBpelRuntimeContext().getExpLangRuntime()
-                        .evaluateNode(expr, this);
-            } catch (org.apache.ode.bpel.explang.EvaluationException e) {
-                throw new InvalidProcessException("Expression Failed: " + expr,
-                        e);
-            }
+            return getBpelRuntimeContext().getExpLangRuntime()
+                    .evaluateNode(expr, this);
+
         }
 
         public Node getPartData(Element message, Part part) throws FaultException {

Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/BpelRuntimeContext.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/BpelRuntimeContext.java?rev=581046&r1=581045&r2=581046&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/BpelRuntimeContext.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/BpelRuntimeContext.java Mon Oct  1 12:44:54 2007
@@ -161,6 +161,7 @@
 
     void writeCorrelation(CorrelationSetInstance cset, CorrelationKey correlation);
 
+    void forceFlush();
     /**
      * Should be invoked by process template, signalling process completion
      * with no faults.

Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/EH_ALARM.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/EH_ALARM.java?rev=581046&r1=581045&r2=581046&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/EH_ALARM.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/EH_ALARM.java Mon Oct  1 12:44:54 2007
@@ -20,7 +20,6 @@
 
 import org.apache.ode.bpel.common.FaultException;
 import org.apache.ode.bpel.explang.EvaluationContext;
-import org.apache.ode.bpel.explang.EvaluationException;
 import org.apache.ode.bpel.o.OEventHandler;
 import org.apache.ode.bpel.o.OScope;
 import org.apache.ode.bpel.runtime.channels.EventHandlerControlChannel;
@@ -85,8 +84,6 @@
         if (_oalarm.forExpr != null)
             try {
                 getBpelRuntimeContext().getExpLangRuntime().evaluateAsDuration(_oalarm.forExpr, getEvaluationContext()).addTo(alarm);
-            } catch (EvaluationException e) {
-                throw new InvalidProcessException(e);
             } catch (FaultException e) {
                 __log.error(e);
                 _psc.completed(createFault(e.getQName(),_oalarm.forExpr), _comps);
@@ -95,8 +92,6 @@
         else if (_oalarm.untilExpr != null)
             try {
                 alarm.setTime(getBpelRuntimeContext().getExpLangRuntime().evaluateAsDate(_oalarm.untilExpr, getEvaluationContext()).getTime());
-            } catch (EvaluationException e) {
-                throw new InvalidProcessException(e);
             } catch (FaultException e) {
                 __log.error(e);
                 _psc.completed(createFault(e.getQName(),_oalarm.untilExpr), _comps);
@@ -213,8 +208,6 @@
                         Calendar next = Calendar.getInstance();
                         try {
                             getBpelRuntimeContext().getExpLangRuntime().evaluateAsDuration(_oalarm.forExpr, getEvaluationContext()).addTo(next);
-                        } catch (EvaluationException e) {
-                            throw new InvalidProcessException(e);
                         } catch (FaultException e) {
                             __log.error(e);
                             _psc.completed(createFault(e.getQName(),_oalarm.forExpr), _comps);

Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ExprEvaluationContextImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ExprEvaluationContextImpl.java?rev=581046&r1=581045&r2=581046&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ExprEvaluationContextImpl.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ExprEvaluationContextImpl.java Mon Oct  1 12:44:54 2007
@@ -35,13 +35,11 @@
 import java.util.Map;
 
 /**
- * The context in which BPEL expressions are evaluated. This class is handed of
- * the {@link org.apache.ode.bpel.o.OExpression} instances to provide access to
- * variables, link statuses, and the like.
+ * The context in which BPEL expressions are evaluated. This class is handed of the {@link org.apache.ode.bpel.o.OExpression}
+ * instances to provide access to variables, link statuses, and the like.
  */
 public class ExprEvaluationContextImpl implements EvaluationContext {
-    private static final Log __log = LogFactory
-            .getLog(ExprEvaluationContextImpl.class);
+    private static final Log __log = LogFactory.getLog(ExprEvaluationContextImpl.class);
 
     private BpelRuntimeContext _native;
 
@@ -51,26 +49,22 @@
 
     private Node _root;
 
-    public ExprEvaluationContextImpl(ScopeFrame scopeInstace,
-                                     BpelRuntimeContext ntv) {
+    public ExprEvaluationContextImpl(ScopeFrame scopeInstace, BpelRuntimeContext ntv) {
         _native = ntv;
         _scopeInstance = scopeInstace;
     }
 
-    public ExprEvaluationContextImpl(ScopeFrame scopeInstace,
-                                     BpelRuntimeContext ntv, Node root) {
+    public ExprEvaluationContextImpl(ScopeFrame scopeInstace, BpelRuntimeContext ntv, Node root) {
         this(scopeInstace, ntv);
         _root = root;
     }
 
-    public ExprEvaluationContextImpl(ScopeFrame scopeInstnce,
-                                     BpelRuntimeContext ntv, Map<OLink, Boolean> linkVals) {
+    public ExprEvaluationContextImpl(ScopeFrame scopeInstnce, BpelRuntimeContext ntv, Map<OLink, Boolean> linkVals) {
         this(scopeInstnce, ntv);
         _linkVals = linkVals;
     }
 
-    public Node readVariable(OScope.Variable variable, OMessageVarType.Part part)
-            throws FaultException {
+    public Node readVariable(OScope.Variable variable, OMessageVarType.Part part) throws FaultException {
         if (__log.isTraceEnabled())
             __log.trace("readVariable(" + variable + "," + part + ")");
 
@@ -78,26 +72,21 @@
 
         Node ret;
         if (variable.type instanceof OConstantVarType) {
-            ret = ((OConstantVarType)variable.type).getValue();
+            ret = ((OConstantVarType) variable.type).getValue();
         } else {
             VariableInstance varInstance = _scopeInstance.resolve(variable);
-            if (varInstance == null) return null;
+            if (varInstance == null)
+                return null;
             ret = _native.fetchVariableData(varInstance, part, false);
         }
         return ret;
     }
 
     public Node evaluateQuery(Node root, OExpression expr) throws FaultException {
-        try {
-            return _native.getExpLangRuntime().evaluateNode(expr,
-                    new ExprEvaluationContextImpl(_scopeInstance, _native, root));
-        } catch (org.apache.ode.bpel.explang.EvaluationException e) {
-            throw new InvalidProcessException("Expression Failed: " + expr, e);
-        }
+        return _native.getExpLangRuntime().evaluateNode(expr, new ExprEvaluationContextImpl(_scopeInstance, _native, root));
     }
 
-    public String readMessageProperty(OScope.Variable variable,
-                                      OProcess.OProperty property) throws FaultException {
+    public String readMessageProperty(OScope.Variable variable, OProcess.OProperty property) throws FaultException {
         VariableInstance varInstance = _scopeInstance.resolve(variable);
         return _native.readProperty(varInstance, property);
     }
@@ -107,8 +96,7 @@
     }
 
     public String toString() {
-        return "{ExprEvaluationContextImpl scopeInstance=" + _scopeInstance
-                + ", activeLinks=" + _linkVals + "}";
+        return "{ExprEvaluationContextImpl scopeInstance=" + _scopeInstance + ", activeLinks=" + _linkVals + "}";
     }
 
     public Node getRootNode() {

Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ExpressionLanguageRuntimeRegistry.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ExpressionLanguageRuntimeRegistry.java?rev=581046&r1=581045&r2=581046&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ExpressionLanguageRuntimeRegistry.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/ExpressionLanguageRuntimeRegistry.java Mon Oct  1 12:44:54 2007
@@ -21,7 +21,6 @@
 import org.apache.ode.bpel.common.FaultException;
 import org.apache.ode.bpel.explang.ConfigurationException;
 import org.apache.ode.bpel.explang.EvaluationContext;
-import org.apache.ode.bpel.explang.EvaluationException;
 import org.apache.ode.bpel.explang.ExpressionLanguageRuntime;
 import org.apache.ode.bpel.o.OExpression;
 import org.apache.ode.bpel.o.OExpressionLanguage;
@@ -34,66 +33,109 @@
 import java.util.Map;
 
 /**
- * A registry of {@link ExpressionLanguageRuntime} objects that is able to map
- * a given expression to the appropriate language runtime.
+ * A registry of {@link ExpressionLanguageRuntime} objects that is able to map a given expression to the appropriate 
+ * language runtime. We also do some exception guarding here so that the core of the engine does not have to deal
+ * with random exceptions from not-quite perfect expression runtime imlementation.
  */
-public class ExpressionLanguageRuntimeRegistry  {
-  private final Map<OExpressionLanguage, ExpressionLanguageRuntime> _runtimes =
-    new HashMap<OExpressionLanguage, ExpressionLanguageRuntime>();
-
-  public ExpressionLanguageRuntimeRegistry()  {}
-
-  public void registerRuntime(OExpressionLanguage oelang) throws ConfigurationException {
-    try {
-      String className = oelang.properties.get("runtime-class");
-      // backward compatibility.
-      className = className.replace("com.fs.pxe.","org.apache.ode.");
-      Class cls = Class.forName(className);
-      ExpressionLanguageRuntime elangRT = (ExpressionLanguageRuntime) cls.newInstance();
-      elangRT.initialize(oelang.properties);
-      _runtimes.put(oelang, elangRT);
-    } catch (ConfigurationException ce) {
-      throw ce;
-    } catch (IllegalAccessException e) {
-      throw new ConfigurationException("Illegal Access Error", e);
-    } catch (InstantiationException e) {
-      throw new ConfigurationException("Instantiation Error", e);
-    } catch (ClassNotFoundException e) {
-      throw new ConfigurationException("Class Not Found Error", e);
-    }
-
-  }
-
-  public String evaluateAsString(OExpression cexp, EvaluationContext ctx) throws FaultException , EvaluationException {
-    return findRuntime(cexp).evaluateAsString(cexp, ctx);
-  }
-
-  public boolean evaluateAsBoolean(OExpression cexp, EvaluationContext ctx) throws FaultException, EvaluationException {
-    return findRuntime(cexp).evaluateAsBoolean(cexp, ctx);
-  }
-
-  public Number evaluateAsNumber(OExpression cexp, EvaluationContext ctx) throws FaultException, EvaluationException {
-    return findRuntime(cexp).evaluateAsNumber(cexp, ctx);
-  }
-
-  public List evaluate(OExpression cexp, EvaluationContext ctx) throws FaultException, EvaluationException {
-    return findRuntime(cexp).evaluate(cexp, ctx);
-  }
-
-  public Node evaluateNode(OExpression cexp, EvaluationContext ctx) throws FaultException, EvaluationException {
-    return findRuntime(cexp).evaluateNode(cexp, ctx);
-  }
-
-  public Calendar evaluateAsDate(OExpression cexp, EvaluationContext ctx) throws FaultException, EvaluationException {
-    return findRuntime(cexp).evaluateAsDate(cexp, ctx);
-  }
-
-  public Duration evaluateAsDuration(OExpression cexp, EvaluationContext ctx) throws FaultException, EvaluationException {
-    return findRuntime(cexp).evaluateAsDuration(cexp, ctx);
-  }
-
-  private ExpressionLanguageRuntime findRuntime(OExpression cexp) {
-    return _runtimes.get(cexp.expressionLanguage);
-  }
+public class ExpressionLanguageRuntimeRegistry {
+    private final Map<OExpressionLanguage, ExpressionLanguageRuntime> _runtimes = new HashMap<OExpressionLanguage, ExpressionLanguageRuntime>();
+
+    public ExpressionLanguageRuntimeRegistry() {
+    }
+
+    public void registerRuntime(OExpressionLanguage oelang) throws ConfigurationException {
+        try {
+            String className = oelang.properties.get("runtime-class");
+            // backward compatibility.
+            className = className.replace("com.fs.pxe.", "org.apache.ode.");
+            Class cls = Class.forName(className);
+            ExpressionLanguageRuntime elangRT = (ExpressionLanguageRuntime) cls.newInstance();
+            elangRT.initialize(oelang.properties);
+            _runtimes.put(oelang, elangRT);
+        } catch (ConfigurationException ce) {
+            throw ce;
+        } catch (IllegalAccessException e) {
+            throw new ConfigurationException("Illegal Access Error", e);
+        } catch (InstantiationException e) {
+            throw new ConfigurationException("Instantiation Error", e);
+        } catch (ClassNotFoundException e) {
+            throw new ConfigurationException("Class Not Found Error", e);
+        }
+
+    }
+
+    public String evaluateAsString(OExpression cexp, EvaluationContext ctx) throws FaultException {
+        try {
+            return findRuntime(cexp).evaluateAsString(cexp, ctx);
+        } catch (FaultException fe) {
+            throw fe;
+        } catch (Throwable t) {
+            throw new FaultException(cexp.getOwner().constants.qnSubLanguageExecutionFault, t.toString(), t);
+        }
+    }
+
+    public boolean evaluateAsBoolean(OExpression cexp, EvaluationContext ctx) throws FaultException {
+        try {
+            return findRuntime(cexp).evaluateAsBoolean(cexp, ctx);
+        } catch (FaultException fe) {
+            throw fe;
+        } catch (Throwable t) {
+            throw new FaultException(cexp.getOwner().constants.qnSubLanguageExecutionFault, t.toString(), t);
+        }
+    }
+
+    public Number evaluateAsNumber(OExpression cexp, EvaluationContext ctx) throws FaultException {
+        try {
+            return findRuntime(cexp).evaluateAsNumber(cexp, ctx);
+        } catch (FaultException fe) {
+            throw fe;
+        } catch (Throwable t) {
+            throw new FaultException(cexp.getOwner().constants.qnSubLanguageExecutionFault, t.toString(), t);
+        }
+    }
+
+    public List evaluate(OExpression cexp, EvaluationContext ctx) throws FaultException {
+        try {
+            return findRuntime(cexp).evaluate(cexp, ctx);
+        } catch (FaultException fe) {
+            throw fe;
+        } catch (Throwable t) {
+            throw new FaultException(cexp.getOwner().constants.qnSubLanguageExecutionFault, t.toString(), t);
+        }
+    }
+
+    public Node evaluateNode(OExpression cexp, EvaluationContext ctx) throws FaultException {
+        try {
+            return findRuntime(cexp).evaluateNode(cexp, ctx);
+        } catch (FaultException fe) {
+            throw fe;
+        } catch (Throwable t) {
+            throw new FaultException(cexp.getOwner().constants.qnSubLanguageExecutionFault, t.toString(), t);
+        }
+    }
+
+    public Calendar evaluateAsDate(OExpression cexp, EvaluationContext ctx) throws FaultException {
+        try {
+            return findRuntime(cexp).evaluateAsDate(cexp, ctx);
+        } catch (FaultException fe) {
+            throw fe;
+        } catch (Throwable t) {
+            throw new FaultException(cexp.getOwner().constants.qnSubLanguageExecutionFault, t.toString(), t);
+        }
+    }
+
+    public Duration evaluateAsDuration(OExpression cexp, EvaluationContext ctx) throws FaultException {
+        try {
+            return findRuntime(cexp).evaluateAsDuration(cexp, ctx);
+        } catch (FaultException fe) {
+            throw fe;
+        } catch (Throwable t) {
+            throw new FaultException(cexp.getOwner().constants.qnSubLanguageExecutionFault, t.toString(), t);
+        }
+    }
+
+    private ExpressionLanguageRuntime findRuntime(OExpression cexp) {
+        return _runtimes.get(cexp.expressionLanguage);
+    }
 
 }

Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/FLOW.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/FLOW.java?rev=581046&r1=581045&r2=581046&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/FLOW.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/FLOW.java Mon Oct  1 12:44:54 2007
@@ -55,7 +55,7 @@
         for (Iterator<OLink> i = _oflow.localLinks.iterator(); i.hasNext(); ) {
             OLink link = i.next();
             LinkStatusChannel lsc = newChannel(LinkStatusChannel.class);
-            myLinkFrame.links.put(link,new LinkInfo(link,lsc,lsc));
+            myLinkFrame.links.put(link,new LinkInfo(link,lsc));
         }
 
         for (Iterator<OActivity> i = _oflow.parallelActivities.iterator(); i.hasNext();) {

Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/FOREACH.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/FOREACH.java?rev=581046&r1=581045&r2=581046&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/FOREACH.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/FOREACH.java Mon Oct  1 12:44:54 2007
@@ -22,7 +22,6 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.ode.bpel.common.FaultException;
-import org.apache.ode.bpel.explang.EvaluationException;
 import org.apache.ode.bpel.o.OExpression;
 import org.apache.ode.bpel.o.OForEach;
 import org.apache.ode.bpel.o.OScope;
@@ -187,11 +186,11 @@
         try {
             return getBpelRuntimeContext().getExpLangRuntime().
                     evaluateAsNumber(condition, getEvaluationContext()).intValue();
-        } catch (EvaluationException e) {
+        } catch (FaultException e) {
             String msg;
             msg = "ForEach counter value couldn't be evaluated as xs:unsignedInt.";
             __log.error(msg, e);
-            throw new FaultException(_oforEach.getOwner().constants.qnForEachCounterError,msg);
+            throw new FaultException(_oforEach.getOwner().constants.qnForEachCounterError,msg, e);
         }
     }
 

Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/LinkFrame.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/LinkFrame.java?rev=581046&r1=581045&r2=581046&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/LinkFrame.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/LinkFrame.java Mon Oct  1 12:44:54 2007
@@ -25,24 +25,25 @@
 import java.util.Map;
 
 /**
- * Link stack frame allowing resolution of {@link OLink} objects to the
- * current {@link LinkInfo} in context.
+ * Link stack frame allowing resolution of {@link OLink} objects to the current {@link LinkInfo} in context.
  */
 class LinkFrame implements Serializable {
 
-	private static final long serialVersionUID = 1L;
-	LinkFrame next;
-  Map<OLink, LinkInfo> links = new HashMap<OLink, LinkInfo>();
+    private static final long serialVersionUID = 1L;
 
-  LinkFrame(LinkFrame next) {
-    this.next = next;
-  }
+    LinkFrame next;
 
-  LinkInfo resolve(OLink link) {
-    LinkInfo li = links.get(link);
-    if (li == null && next != null)
-      return next.resolve(link);
-    return li;
-  }
+    Map<OLink, LinkInfo> links = new HashMap<OLink, LinkInfo>();
+
+    LinkFrame(LinkFrame next) {
+        this.next = next;
+    }
+
+    LinkInfo resolve(OLink link) {
+        LinkInfo li = links.get(link);
+        if (li == null && next != null)
+            return next.resolve(link);
+        return li;
+    }
 
 }

Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/LinkInfo.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/LinkInfo.java?rev=581046&r1=581045&r2=581046&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/LinkInfo.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/LinkInfo.java Mon Oct  1 12:44:54 2007
@@ -27,21 +27,16 @@
  * Run-time represetation of the link data.
  */
 class LinkInfo implements Serializable {
-	private static final long serialVersionUID = 1L;
+    private static final long serialVersionUID = 1L;
 
-	final OLink olink;
+    final OLink olink;
 
-  /** Channel to be used for link status publisher. */
-  final LinkStatusChannel pub;
+    /** Channel to be used for link status publisher. */
+    final LinkStatusChannel channel;
 
-  /** Channel to be used for link status listener. */
-  final LinkStatusChannel sub;
-
-
-  LinkInfo(OLink olink, LinkStatusChannel pub, LinkStatusChannel sub) {
-    this.olink = olink;
-    this.pub = pub;
-    this.sub = sub;
-  }
+    LinkInfo(OLink olink, LinkStatusChannel channel) {
+        this.olink = olink;
+        this.channel = channel;
+    }
 
 }

Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PICK.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PICK.java?rev=581046&r1=581045&r2=581046&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PICK.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PICK.java Mon Oct  1 12:44:54 2007
@@ -28,7 +28,6 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.ode.bpel.common.CorrelationKey;
 import org.apache.ode.bpel.common.FaultException;
-import org.apache.ode.bpel.explang.EvaluationException;
 import org.apache.ode.bpel.o.OElementVarType;
 import org.apache.ode.bpel.o.OMessageVarType;
 import org.apache.ode.bpel.o.OPickReceive;
@@ -123,10 +122,6 @@
             dpe(_opick.outgoingLinks);
             _self.parent.completed(fault, CompensationHandler.emptySet());
             return;
-        } catch (EvaluationException e) {
-            String msg = "Unexpected evaluation error evaluating alarm.";
-            __log.error(msg, e);
-            throw new InvalidProcessException(msg, e);
         }
 
         // Dead path all the alarms that have no chace of coming first.

Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/REPEATUNTIL.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/REPEATUNTIL.java?rev=581046&r1=581045&r2=581046&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/REPEATUNTIL.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/REPEATUNTIL.java Mon Oct  1 12:44:54 2007
@@ -24,7 +24,6 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.ode.bpel.common.FaultException;
-import org.apache.ode.bpel.explang.EvaluationException;
 import org.apache.ode.bpel.o.ORepeatUntil;
 import org.apache.ode.bpel.o.OScope;
 import org.apache.ode.bpel.runtime.channels.FaultData;
@@ -76,13 +75,7 @@
      * @throws FaultException in case of standard expression fault (e.g. selection failure)
      */
     private boolean checkCondition() throws FaultException {
-        try {
-            return getBpelRuntimeContext().getExpLangRuntime().evaluateAsBoolean(getORepeatUntil().untilCondition,getEvaluationContext());
-        } catch (EvaluationException e) {
-            String msg = "Unexpected expression evaluation error checking repeatUntil condition.";
-            __log.error(msg, e);
-            throw new InvalidProcessException(msg,e);
-        }
+        return getBpelRuntimeContext().getExpLangRuntime().evaluateAsBoolean(getORepeatUntil().untilCondition,getEvaluationContext());
     }
 
     private class WAITER extends BpelJacobRunnable {

Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPEACT.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPEACT.java?rev=581046&r1=581045&r2=581046&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPEACT.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SCOPEACT.java Mon Oct  1 12:44:54 2007
@@ -27,6 +27,8 @@
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.ode.bpel.o.OLink;
 import org.apache.ode.bpel.o.OScope;
 import org.apache.ode.bpel.o.OScope.Variable;
@@ -47,6 +49,8 @@
  * A scope activity. The scope activity creates a new scope frame and proceeeds using the {@link SCOPE} template.
  */
 public class SCOPEACT extends ACTIVITY {
+    private static final Log __log = LogFactory.getLog(SCOPEACT.class);
+    
     private static final long serialVersionUID = -4593029783757994939L;
 
     public SCOPEACT(ActivityInfo self, ScopeFrame scopeFrame, LinkFrame linkFrame) {
@@ -55,7 +59,9 @@
 
     public void run() {
 
+        
         if (((OScope) _self.o).isolatedScope) {
+            __log.debug("found ISOLATED scope, instance ISOLATEDGUARD");
             instance(new ISOLATEDGUARD(createLockList(), newChannel(SynchChannel.class)));
 
         } else {
@@ -144,6 +150,8 @@
         @Override
         public void run() {
 
+            __log.debug("LINKSTATUSINTERCEPTOR: running ");
+
             Set<ChannelListener> mlset = new HashSet<ChannelListener>();
             
             if (_status == null)
@@ -153,6 +161,8 @@
     
                     /** Our owner will notify us when it becomes clear what to do with the links. */
                     public void val(Object retVal) {
+                        __log.debug("LINKSTATUSINTERCEPTOR: status received " + retVal);
+                        
                         _status = (Boolean) retVal;
                         for (OLink available : _statuses.keySet())
                             _linkFrame.resolve(available).channel.linkStatus(_statuses.get(available) && _status);
@@ -226,6 +236,7 @@
         public void run() {
             if (_locksNeeded.isEmpty()) {
                 // acquired all locks.
+                __log.debug("ISOLATIONGUARD: got all required locks: " + _locksAcquired);
 
                 ScopeFrame newFrame = new ScopeFrame((OScope) _self.o, getBpelRuntimeContext().createScopeInstance(
                         _scopeFrame.scopeInstanceId, (OScope) _self.o), _scopeFrame, null);
@@ -240,8 +251,11 @@
                 instance(new SCOPE(_self, newFrame, linkframe));
                 return;
             } else {
+                __log.debug("ISOLATIONGUARD: don't have all locks still need: " + _locksNeeded);
+
                 // try to acquire the locks in sequence (IMPORTANT) not all at once.
                 IsolationLock il = _locksNeeded.get(0);
+                
                 if (il.writeLock)
                     il.lockChannel.writeLock(_synchChannel);
                 else
@@ -251,6 +265,7 @@
                     private static final long serialVersionUID = 2857261074409098274L;
 
                     public void ret() {
+                        __log.debug("ISOLATIONGUARD: got lock: " + _locksNeeded.get(0));
                         _locksAcquired.add(_locksNeeded.remove(0));
                         instance(ISOLATEDGUARD.this);
                     }
@@ -267,7 +282,7 @@
      * @author Maciej Szefler <mszefler at gmail dot com>
      *
      */
-    private static class UNLOCKER extends BpelJacobRunnable {
+    private class UNLOCKER extends BpelJacobRunnable {
 
         private static final long serialVersionUID = -476393080609348172L;
 
@@ -294,6 +309,7 @@
         @Override
         public void run() {
 
+            __log.debug("running UNLOCKER");
             object(new ParentScopeChannelListener(_self) {
 
                 public void cancelled() {
@@ -332,6 +348,11 @@
          * 
          */
         private void unlockAll() {
+            __log.debug("UNLOCKER: unlockAll: " + _locks);
+
+            if (((OScope)SCOPEACT.this._self.o).atomicScope)
+                getBpelRuntimeContext().forceFlush();
+                
             for (IsolationLock il : _locks)
                 il.lockChannel.unlock(_synchChannel);
             _locks.clear();

Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SWITCH.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SWITCH.java?rev=581046&r1=581045&r2=581046&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SWITCH.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/SWITCH.java Mon Oct  1 12:44:54 2007
@@ -20,7 +20,6 @@
 
 import org.apache.ode.bpel.common.FaultException;
 import org.apache.ode.bpel.explang.EvaluationContext;
-import org.apache.ode.bpel.explang.EvaluationException;
 import org.apache.ode.bpel.o.OSwitch;
 import org.apache.ode.bpel.runtime.channels.FaultData;
 
@@ -54,11 +53,6 @@
           matchedOCase = ocase;
           break;
         }
-      } catch (EvaluationException e) {
-        String msg = "Unexpected evaluation exception.";
-        __log.error(msg,e);
-        // TODO: Better location information.
-        throw new InvalidProcessException(msg,e);
       }catch(FaultException e){
       	__log.error(e.getMessage(),e);
         faultData = createFault(e.getQName(), ocase);

Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/WAIT.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/WAIT.java?rev=581046&r1=581045&r2=581046&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/WAIT.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/WAIT.java Mon Oct  1 12:44:54 2007
@@ -22,7 +22,6 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.ode.bpel.common.FaultException;
 import org.apache.ode.bpel.explang.EvaluationContext;
-import org.apache.ode.bpel.explang.EvaluationException;
 import org.apache.ode.bpel.o.OWait;
 import org.apache.ode.bpel.runtime.channels.TerminationChannelListener;
 import org.apache.ode.bpel.runtime.channels.TimerResponseChannel;
@@ -54,10 +53,6 @@
                     + "; Reason: " + e.getMessage());
             _self.parent.completed(createFault(e.getQName(), _self.o), CompensationHandler.emptySet());
             return;
-        } catch (EvaluationException ee) {
-            String msg = "Unexpected error evaluating wait condition.";
-            __log.error(msg, ee);
-            throw new InvalidProcessException(msg,ee);
         }
 
 
@@ -99,7 +94,7 @@
     }
 
 
-    protected Date getDueDate() throws FaultException, EvaluationException {
+    protected Date getDueDate() throws FaultException {
 
         OWait wait = (OWait)_self.o;
 

Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/WHILE.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/WHILE.java?rev=581046&r1=581045&r2=581046&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/WHILE.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/WHILE.java Mon Oct  1 12:44:54 2007
@@ -24,7 +24,6 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.ode.bpel.common.FaultException;
-import org.apache.ode.bpel.explang.EvaluationException;
 import org.apache.ode.bpel.o.OScope;
 import org.apache.ode.bpel.o.OWhile;
 import org.apache.ode.bpel.runtime.channels.FaultData;
@@ -57,24 +56,25 @@
             condResult = checkCondition();
         } catch (FaultException fe) {
             __log.error(fe);
-            _self.parent.completed(createFault(fe.getQName(), _self.o),_compHandlers);
+            _self.parent.completed(createFault(fe.getQName(), _self.o), _compHandlers);
             return;
         }
 
         if (condResult) {
-            ActivityInfo child = new ActivityInfo(genMonotonic(),
-                    getOWhile().activity,
-                    newChannel(TerminationChannel.class), newChannel(ParentScopeChannel.class));
+            ActivityInfo child = new ActivityInfo(genMonotonic(), getOWhile().activity, newChannel(TerminationChannel.class),
+                    newChannel(ParentScopeChannel.class));
             instance(createChild(child, _scopeFrame, _linkFrame));
             instance(new WAITER(child));
-        } else /* stop. */ {
+        } else /* stop. */{
             _self.parent.completed(null, _compHandlers);
         }
     }
 
-    /* (non-Javadoc)
-    * @see java.lang.Object#toString()
-    */
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.lang.Object#toString()
+     */
     public String toString() {
         return "<T:Act:While:" + _self.o + ">";
     }
@@ -84,28 +84,25 @@
     }
 
     private OWhile getOWhile() {
-        return (OWhile)_self.o;
+        return (OWhile) _self.o;
     }
 
     /**
      * Evaluates the while condition.
-     *
+     * 
      * @return <code>true</code> if the while condition is satisfied, <code>false</code> otherwise.
-     * @throws FaultException in case of standard expression fault (e.g. selection failure)
+     * @throws FaultException
+     *             in case of standard expression fault (e.g. selection failure)
      */
     private boolean checkCondition() throws FaultException {
-        try {
-            return getBpelRuntimeContext().getExpLangRuntime().evaluateAsBoolean(getOWhile().whileCondition,getEvaluationContext());
-        } catch (EvaluationException e) {
-            String msg = "Unexpected expression evaluation error checking while condition.";
-            __log.error(msg, e);
-            throw new InvalidProcessException(msg,e);
-        }
+        return getBpelRuntimeContext().getExpLangRuntime().evaluateAsBoolean(getOWhile().whileCondition, getEvaluationContext());
     }
 
     private class WAITER extends BpelJacobRunnable {
         private static final long serialVersionUID = -7645042174027252066L;
+
         private ActivityInfo _child;
+
         private boolean _terminated;
 
         WAITER(ActivityInfo child) {
@@ -125,7 +122,7 @@
                 private static final long serialVersionUID = 3907167240907524405L;
 
                 public void compensate(OScope scope, SynchChannel ret) {
-                    _self.parent.compensate(scope,ret);
+                    _self.parent.compensate(scope, ret);
                     instance(WAITER.this);
                 }
 
@@ -137,8 +134,13 @@
                         instance(WHILE.this);
                 }
 
-                public void cancelled() { completed(null, CompensationHandler.emptySet()); }
-                public void failure(String reason, Element data) { completed(null, CompensationHandler.emptySet()); }
+                public void cancelled() {
+                    completed(null, CompensationHandler.emptySet());
+                }
+
+                public void failure(String reason, Element data) {
+                    completed(null, CompensationHandler.emptySet());
+                }
             }));
         }
     }

Modified: ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/explang/konst/KonstExpressionLanguageRuntimeImpl.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/explang/konst/KonstExpressionLanguageRuntimeImpl.java?rev=581046&r1=581045&r2=581046&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/explang/konst/KonstExpressionLanguageRuntimeImpl.java (original)
+++ ode/trunk/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/explang/konst/KonstExpressionLanguageRuntimeImpl.java Mon Oct  1 12:44:54 2007
@@ -38,61 +38,62 @@
   public void initialize(Map properties) throws ConfigurationException {
   }
 
-  public String evaluateAsString(OExpression cexp, EvaluationContext ctx) throws FaultException , EvaluationException {
+  public String evaluateAsString(OExpression cexp, EvaluationContext ctx) throws FaultException  {
     OConstantExpression konst = (OConstantExpression) cexp;
     if (konst.getVal() instanceof String)
       return (String) konst.getVal();
-    throw new TypeCastException(TypeCastException.TYPE_STRING, konst.getVal().toString());
+    throw new FaultException(cexp.getOwner().constants.qnInvalidExpressionValue);
   }
 
-  public boolean evaluateAsBoolean(OExpression cexp, EvaluationContext ctx) throws FaultException, EvaluationException {
+  public boolean evaluateAsBoolean(OExpression cexp, EvaluationContext ctx) throws FaultException {
     OConstantExpression konst = (OConstantExpression) cexp;
     if (konst.getVal() instanceof Boolean)
       return ((Boolean)konst.getVal()).booleanValue();
-    throw new TypeCastException(TypeCastException.TYPE_BOOLEAN, konst.getVal().toString());
+    throw new FaultException(cexp.getOwner().constants.qnInvalidExpressionValue);
+
   }
 
-  public Number evaluateAsNumber(OExpression cexp, EvaluationContext ctx) throws FaultException, EvaluationException {
+  public Number evaluateAsNumber(OExpression cexp, EvaluationContext ctx) throws FaultException{
     OConstantExpression konst = (OConstantExpression) cexp;
     if (konst.getVal() instanceof Number)
       return (Number)konst.getVal();
-    throw new TypeCastException(TypeCastException.TYPE_NUMBER, konst.getVal().toString());
+    throw new FaultException(cexp.getOwner().constants.qnInvalidExpressionValue);
   }
 
   public List evaluate(OExpression cexp, EvaluationContext ctx)
-          throws FaultException, EvaluationException {
+          throws FaultException {
     OConstantExpression konst = (OConstantExpression) cexp;
     if (konst.getVal() instanceof List)
       return (List) konst.getVal();
-    throw new TypeCastException(TypeCastException.TYPE_NODELIST, konst.getVal().toString());
+    throw new FaultException(cexp.getOwner().constants.qnInvalidExpressionValue);
   }
 
-  public Node evaluateNode(OExpression cexp, EvaluationContext context) throws FaultException, EvaluationException {
+  public Node evaluateNode(OExpression cexp, EvaluationContext context) throws FaultException{
     OConstantExpression konst = (OConstantExpression) cexp;
     if (konst.getVal() instanceof Node)
       return (Node) konst.getVal();
-    throw new TypeCastException(TypeCastException.TYPE_NODE, konst.getVal().toString());
+    throw new FaultException(cexp.getOwner().constants.qnInvalidExpressionValue);
   }
 
   public Calendar evaluateAsDate(OExpression cexp, EvaluationContext context)
-          throws FaultException , EvaluationException {
+          throws FaultException  {
     OConstantExpression konst = (OConstantExpression) cexp;
 
     if (konst.getVal() instanceof Calendar)
       return (Calendar) konst.getVal();
 
-    throw new TypeCastException(TypeCastException.TYPE_DATE, konst.getVal().toString());
+    throw new FaultException(cexp.getOwner().constants.qnInvalidExpressionValue);
 
   }
 
   public Duration evaluateAsDuration(OExpression cexp, EvaluationContext context)
-          throws FaultException, EvaluationException {
+          throws FaultException{
 
     OConstantExpression konst = (OConstantExpression) cexp;
 
     if (konst.getVal() instanceof Duration)
       return (Duration) konst.getVal();
+    throw new FaultException(cexp.getOwner().constants.qnInvalidExpressionValue);
 
-    throw new TypeCastException(TypeCastException.TYPE_DURATION, konst.getVal().toString());
   }
 }

Modified: ode/trunk/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/CoreBpelTest.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/CoreBpelTest.java?rev=581046&r1=581045&r2=581046&view=diff
==============================================================================
--- ode/trunk/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/CoreBpelTest.java (original)
+++ ode/trunk/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/CoreBpelTest.java Mon Oct  1 12:44:54 2007
@@ -409,4 +409,9 @@
         
     }
 
+    public void forceFlush() {
+        // TODO Auto-generated method stub
+        
+    }
+
 }

Modified: ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestFlowActivity2/TestActivityFlow.bpel
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestFlowActivity2/TestActivityFlow.bpel?rev=581046&r1=581045&r2=581046&view=diff
==============================================================================
--- ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestFlowActivity2/TestActivityFlow.bpel (original)
+++ ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestFlowActivity2/TestActivityFlow.bpel Mon Oct  1 12:44:54 2007
@@ -61,12 +61,15 @@
 				<link name="probe1-to-probe3"/>
 				<link name="probe2-to-probe3"/>
 			</links>
+			
+
 			<receive name="receive1" partnerLink="request" portType="wns:testFlowActivityPT"
 				operation="request" variable="request" createInstance="yes">
 				<sources>
 					<source linkName="receive-to-assign1"/>
 				</sources>
 			</receive>
+
 			<!-- Copy input variables to internal accumulators -->
 			<!-- After the copy the process splits into two execution paths -->
 			<sequence>



Mime
View raw message