ode-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthieu Riou" <matthieu.r...@gmail.com>
Subject Re: svn commit: r731639 - in /ode/trunk: axis2/src/main/java/org/apache/ode/axis2/hooks/ bpel-api/src/main/java/org/apache/ode/bpel/common/ bpel-api/src/main/java/org/apache/ode/bpel/rapi/ bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/
Date Tue, 06 Jan 2009 17:56:44 GMT
Karthick,

I think you should revert that patch until:

  a) we figure out why the OModel backward compatibility tests fail
  b) we figure out how to migrate serializable Jacob states after the
changes in CorrelationKey

Thanks,
Matthieu

On Mon, Jan 5, 2009 at 9:57 AM, <karthick@apache.org> wrote:

> Author: karthick
> Date: Mon Jan  5 09:57:19 2009
> New Revision: 731639
>
> URL: http://svn.apache.org/viewvc?rev=731639&view=rev
> Log:
> Add support for unique correlation sets (see ODE-262).
>
> Added:
>
>  ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ConstantsModel.java
>    ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestCorrelationUnique/
>
>  ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestCorrelationUnique/counter.bpel
>
>  ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestCorrelationUnique/counter.wsdl
>
>  ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestCorrelationUnique/deploy.xml
>
>  ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestCorrelationUnique/derby.log
>
>  ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestCorrelationUnique/test1.properties
>
>  ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestCorrelationUnique/test2.properties
>
>  ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestCorrelationUnique/test3.properties
> Modified:
>
>  ode/trunk/axis2/src/main/java/org/apache/ode/axis2/hooks/ODEAxisService.java
>
>  ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/common/CorrelationKey.java
>
>  ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/CorrelationSetModel.java
>
>  ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/InvalidProcessException.java
>
>  ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/PartnerLinkModel.java
>
>  ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ProcessModel.java
>
>  ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CorrelationSet.java
>
>  ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v1/BpelCompilerImpl.java
>
>  ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v1/PickReceiveGenerator.java
>
>  ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v2/BaseCompiler.java
>
>  ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v2/BpelCompilerImpl.java
>
>  ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v2/PickReceiveGenerator.java
>    ode/trunk/bpel-dao/src/main/java/org/apache/ode/bpel/dao/ProcessDAO.java
>
>  ode/trunk/bpel-test/src/test/java/org/apache/ode/test/MessageRouting20Test.java
>
>  ode/trunk/bpel-test/src/test/java/org/apache/ode/test/StructuredActivities20Test.java
>
>  ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/ProcessDaoImpl.java
>
>  ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ProcessDAOImpl.java
>
>  ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/ODEProcess.java
>
>  ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/PartnerLinkMyRoleImpl.java
>
>  ode/trunk/engine/src/main/java/org/apache/ode/bpel/memdao/ProcessDaoImpl.java
>
>  ode/trunk/engine/src/main/java/org/apache/ode/bpel/runtime/InvalidProcessException.java
>
>  ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/BpelJacobRunnable.java
>
>  ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OConstants.java
>
>  ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OPartnerLink.java
>
>  ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OProcess.java
>
>  ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OScope.java
>
>  ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/RuntimeInstanceImpl.java
>
>  ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/BpelJacobRunnable.java
>
>  ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OConstants.java
>
>  ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OPartnerLink.java
>
>  ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OProcess.java
>
>  ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OScope.java
>
>  ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/RuntimeInstanceImpl.java
>
> Modified:
> ode/trunk/axis2/src/main/java/org/apache/ode/axis2/hooks/ODEAxisService.java
> URL:
> http://svn.apache.org/viewvc/ode/trunk/axis2/src/main/java/org/apache/ode/axis2/hooks/ODEAxisService.java?rev=731639&r1=731638&r2=731639&view=diff
>
> ==============================================================================
> ---
> ode/trunk/axis2/src/main/java/org/apache/ode/axis2/hooks/ODEAxisService.java
> (original)
> +++
> ode/trunk/axis2/src/main/java/org/apache/ode/axis2/hooks/ODEAxisService.java
> Mon Jan  5 09:57:19 2009
> @@ -80,7 +80,7 @@
>             WSDL11ToAxisServiceBuilder serviceBuilder = new
> WSDL11ToAxisPatchedBuilder(is, wsdlServiceName, portName);
>             serviceBuilder.setBaseUri(baseUri.toString());
>             serviceBuilder.setCustomResolver(new Axis2UriResolver());
> -            serviceBuilder.setCustomWSDLResolver(new
> Axis2WSDLLocator(baseUri));
> +            serviceBuilder.setCustomWSLD4JResolver(new
> Axis2WSDLLocator(baseUri));
>             serviceBuilder.setServerSide(true);
>
>             AxisService axisService = serviceBuilder.populateService();
>
> Modified:
> ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/common/CorrelationKey.java
> URL:
> http://svn.apache.org/viewvc/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/common/CorrelationKey.java?rev=731639&r1=731638&r2=731639&view=diff
>
> ==============================================================================
> ---
> ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/common/CorrelationKey.java
> (original)
> +++
> ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/common/CorrelationKey.java
> Mon Jan  5 09:57:19 2009
> @@ -52,6 +52,8 @@
>     private int _csetId;
>     /** Key values. */
>     private final String _keyValues[];
> +    /** System-Wide Unique? */
> +    private boolean unique = false;
>
>     /**
>      * Constructor.
> @@ -126,6 +128,20 @@
>     }
>
>     /**
> +     * Is this correlation key system-wide unique?
> +     *
> +     * @return <code>true</code> if the key is declared to be unique
> +     *         otherwise <code>false</code>
> +     */
> +    public boolean isUnique() {
> +       return unique;
> +    }
> +
> +    public void setUnique(boolean unique) {
> +       this.unique = unique;
> +    }
> +
> +    /**
>      * Equals comperator method.
>      *
>      * @param o
>
> Added:
> ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ConstantsModel.java
> URL:
> http://svn.apache.org/viewvc/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ConstantsModel.java?rev=731639&view=auto
>
> ==============================================================================
> ---
> ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ConstantsModel.java
> (added)
> +++
> ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ConstantsModel.java
> Mon Jan  5 09:57:19 2009
> @@ -0,0 +1,29 @@
> +package org.apache.ode.bpel.rapi;
> +
> +import javax.xml.namespace.QName;
> +
> +public interface ConstantsModel {
> +
> +    // standard fault names
> +    public QName getMissingRequest();
> +    public QName getMissingReply();
> +    public QName getUninitializedVariable();
> +    public QName getConflictingReceive();
> +    public QName getSelectionFailure();
> +    public QName getMismatchedAssignmentFailure();
> +    public QName getJoinFailure();
> +    public QName getForcedTermination();
> +    public QName getCorrelationViolation();
> +    public QName getXsltInvalidSource();
> +    public QName getSubLanguageExecutionFault();
> +    public QName getUninitializedPartnerRole();
> +    public QName getForEachCounterError();
> +    public QName getInvalidBranchCondition();
> +    public QName getInvalidExpressionValue();
> +
> +    // non-standard fault names
> +    public QName getRetiredProcess();
> +    public QName getDuplicateInstance();
> +    public QName getUnknownFault();
> +
> +}
>
> Modified:
> ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/CorrelationSetModel.java
> URL:
> http://svn.apache.org/viewvc/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/CorrelationSetModel.java?rev=731639&r1=731638&r2=731639&view=diff
>
> ==============================================================================
> ---
> ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/CorrelationSetModel.java
> (original)
> +++
> ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/CorrelationSetModel.java
> Mon Jan  5 09:57:19 2009
> @@ -10,4 +10,6 @@
>     List<PropertyAliasModel> getAliases(QName messageType);
>
>     List<PropertyExtractor> getExtractors();
> +
> +    boolean isUnique();
>  }
>
> Modified:
> ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/InvalidProcessException.java
> URL:
> http://svn.apache.org/viewvc/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/InvalidProcessException.java?rev=731639&r1=731638&r2=731639&view=diff
>
> ==============================================================================
> ---
> ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/InvalidProcessException.java
> (original)
> +++
> ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/InvalidProcessException.java
> Mon Jan  5 09:57:19 2009
> @@ -31,6 +31,8 @@
>
>     public final static int RETIRED_CAUSE_CODE = 1;
>
> +    public final static int DUPLICATE_CAUSE_CODE = 2;
> +
>     private final int causeCode;
>
>     public InvalidProcessException(String msg, Throwable cause) {
>
> Modified:
> ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/PartnerLinkModel.java
> URL:
> http://svn.apache.org/viewvc/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/PartnerLinkModel.java?rev=731639&r1=731638&r2=731639&view=diff
>
> ==============================================================================
> ---
> ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/PartnerLinkModel.java
> (original)
> +++
> ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/PartnerLinkModel.java
> Mon Jan  5 09:57:19 2009
> @@ -32,4 +32,5 @@
>
>     Set<CorrelationSetModel> getCorrelationSetsForOperation(Operation
> operation);
>
> +    Set<CorrelationSetModel>
> getUniqueCorrelationSetsForOperation(Operation operation);
>  }
>
> Modified:
> ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ProcessModel.java
> URL:
> http://svn.apache.org/viewvc/ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ProcessModel.java?rev=731639&r1=731638&r2=731639&view=diff
>
> ==============================================================================
> ---
> ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ProcessModel.java
> (original)
> +++
> ode/trunk/bpel-api/src/main/java/org/apache/ode/bpel/rapi/ProcessModel.java
> Mon Jan  5 09:57:19 2009
> @@ -22,4 +22,6 @@
>     ActivityModel getChild(final int id);
>
>     int getModelVersion();
> +
> +    ConstantsModel getConstantsModel();
>  }
>
> Modified:
> ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CorrelationSet.java
> URL:
> http://svn.apache.org/viewvc/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CorrelationSet.java?rev=731639&r1=731638&r2=731639&view=diff
>
> ==============================================================================
> ---
> ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CorrelationSet.java
> (original)
> +++
> ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/bom/CorrelationSet.java
> Mon Jan  5 09:57:19 2009
> @@ -73,4 +73,12 @@
>         return _props;
>     }
>
> +    /**
> +     * Is the correlation set system-wide unique?
> +     *
> +     * @return <code>true</code> iff the set is unique
> +     */
> +    public boolean isUnique() {
> +        return getAttribute("unique", "no").equals("yes");
> +    }
>  }
>
> Modified:
> ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v1/BpelCompilerImpl.java
> URL:
> http://svn.apache.org/viewvc/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v1/BpelCompilerImpl.java?rev=731639&r1=731638&r2=731639&view=diff
>
> ==============================================================================
> ---
> ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v1/BpelCompilerImpl.java
> (original)
> +++
> ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v1/BpelCompilerImpl.java
> Mon Jan  5 09:57:19 2009
> @@ -113,6 +113,7 @@
>  import org.apache.ode.bpel.rtrep.v1.OXslSheet;
>  import org.apache.ode.utils.GUID;
>  import org.apache.ode.utils.NSContext;
> +import org.apache.ode.utils.Namespaces;
>  import org.apache.ode.utils.StreamUtils;
>  import org.apache.ode.utils.fs.FileUtils;
>  import org.apache.ode.utils.msg.MessageBundle;
> @@ -768,6 +769,10 @@
>         constants.qnForEachCounterError = new QName(getBpwsNamespace(),
> "forEachCounterError");
>         constants.qnInvalidBranchCondition = new QName(getBpwsNamespace(),
> "invalidBranchCondition");
>         constants.qnInvalidExpressionValue = new QName(getBpwsNamespace(),
> "invalidExpressionValue");
> +
> +        constants.qnDuplicateInstance = new QName(getOdeNamespace(),
> "duplicateInstance");
> +        constants.qnRetiredProcess = new QName(getOdeNamespace(),
> "retiredProcess");
> +        constants.qnUnknownFault = new QName(getOdeNamespace(),
> "unknownFault");
>         return constants;
>     }
>
> @@ -783,7 +788,11 @@
>     // }
>     // }
>
> -    /**
> +    protected String getOdeNamespace() {
> +       return Namespaces.ODE_EXTENSION_NS;
> +    }
> +
> +       /**
>      * Compile an import declaration. According to the specification:
>      * <blockquote> A BPEL4WSWS-BPEL process definition relies on XML
> Schema and
>      * WSDL 1.1 for the definition of datatypes and service interfaces.
> Process
> @@ -1059,6 +1068,7 @@
>         QName[] setprops = cset.getProperties();
>         for (int j = 0; j < setprops.length; ++j)
>             ocset.properties.add(resolveProperty(setprops[j]));
> +        ocset.unique = cset.isUnique();
>         oscope.addCorrelationSet(ocset);
>     }
>
>
> Modified:
> ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v1/PickReceiveGenerator.java
> URL:
> http://svn.apache.org/viewvc/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v1/PickReceiveGenerator.java?rev=731639&r1=731638&r2=731639&view=diff
>
> ==============================================================================
> ---
> ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v1/PickReceiveGenerator.java
> (original)
> +++
> ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v1/PickReceiveGenerator.java
> Mon Jan  5 09:57:19 2009
> @@ -99,6 +99,7 @@
>             case YES:
>                 onMessage.initCorrelations.add(cset);
>
> onMessage.partnerLink.addCorrelationSetForOperation(onMessage.operation,
> cset);
> +
>  onMessage.partnerLink.addUniqueCorrelationSetForOperation(onMessage.operation,
> cset);
>                 break;
>             case JOIN:
>                 if (createInstance) {
>
> Modified:
> ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v2/BaseCompiler.java
> URL:
> http://svn.apache.org/viewvc/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v2/BaseCompiler.java?rev=731639&r1=731638&r2=731639&view=diff
>
> ==============================================================================
> ---
> ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v2/BaseCompiler.java
> (original)
> +++
> ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v2/BaseCompiler.java
> Mon Jan  5 09:57:19 2009
> @@ -30,6 +30,10 @@
>         constants.qnInvalidBranchCondition = new QName(getBpwsNamespace(),
> "invalidBranchCondition");
>         constants.qnInvalidExpressionValue = new QName(getBpwsNamespace(),
> "invalidExpressionValue");
>         constants.qnScopeRollback = new QName(getOdeNamespace(),
> "scopeRollback");
> +
> +        constants.qnDuplicateInstance = new QName(getOdeNamespace(),
> "duplicateInstance");
> +        constants.qnRetiredProcess = new QName(getOdeNamespace(),
> "retiredProcess");
> +        constants.qnUnknownFault = new QName(getOdeNamespace(),
> "unknownFault");
>         return constants;
>     }
>
>
> Modified:
> ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v2/BpelCompilerImpl.java
> URL:
> http://svn.apache.org/viewvc/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v2/BpelCompilerImpl.java?rev=731639&r1=731638&r2=731639&view=diff
>
> ==============================================================================
> ---
> ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v2/BpelCompilerImpl.java
> (original)
> +++
> ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v2/BpelCompilerImpl.java
> Mon Jan  5 09:57:19 2009
> @@ -1053,6 +1053,7 @@
>         QName[] setprops = cset.getProperties();
>         for (int j = 0; j < setprops.length; ++j)
>             ocset.properties.add(resolveProperty(setprops[j]));
> +        ocset.unique = cset.isUnique();
>         oscope.addCorrelationSet(ocset);
>     }
>
> @@ -1296,6 +1297,7 @@
>                         break;
>                     case YES:
>                         oevent.initCorrelations.add(cset);
> +
>  oevent.partnerLink.addUniqueCorrelationSetForOperation(oevent.operation,
> cset);
>                         break;
>                     case JOIN:
>                         throw new
> CompilationException(__cmsgs.errTODO("Rendezvous."));
>
> Modified:
> ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v2/PickReceiveGenerator.java
> URL:
> http://svn.apache.org/viewvc/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v2/PickReceiveGenerator.java?rev=731639&r1=731638&r2=731639&view=diff
>
> ==============================================================================
> ---
> ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v2/PickReceiveGenerator.java
> (original)
> +++
> ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/v2/PickReceiveGenerator.java
> Mon Jan  5 09:57:19 2009
> @@ -100,6 +100,7 @@
>             case YES:
>                 onMessage.initCorrelations.add(cset);
>
> onMessage.partnerLink.addCorrelationSetForOperation(onMessage.operation,
> cset);
> +
>  onMessage.partnerLink.addUniqueCorrelationSetForOperation(onMessage.operation,
> cset);
>                 break;
>             case JOIN:
>                 if (createInstance) {
>
> Modified:
> ode/trunk/bpel-dao/src/main/java/org/apache/ode/bpel/dao/ProcessDAO.java
> URL:
> http://svn.apache.org/viewvc/ode/trunk/bpel-dao/src/main/java/org/apache/ode/bpel/dao/ProcessDAO.java?rev=731639&r1=731638&r2=731639&view=diff
>
> ==============================================================================
> ---
> ode/trunk/bpel-dao/src/main/java/org/apache/ode/bpel/dao/ProcessDAO.java
> (original)
> +++
> ode/trunk/bpel-dao/src/main/java/org/apache/ode/bpel/dao/ProcessDAO.java Mon
> Jan  5 09:57:19 2009
> @@ -84,6 +84,7 @@
>      * @return collection of {@link ProcessInstanceDAO} that match
> correlation key, ordered by date
>      */
>     Collection<ProcessInstanceDAO> findInstance(CorrelationKey cckey);
> +    Collection<ProcessInstanceDAO> findInstance(CorrelationKey cckey,
> boolean wait);
>
>     /**
>      * Remove the routes with the given Id for all the correlators in the
> process.
>
> Modified:
> ode/trunk/bpel-test/src/test/java/org/apache/ode/test/MessageRouting20Test.java
> URL:
> http://svn.apache.org/viewvc/ode/trunk/bpel-test/src/test/java/org/apache/ode/test/MessageRouting20Test.java?rev=731639&r1=731638&r2=731639&view=diff
>
> ==============================================================================
> ---
> ode/trunk/bpel-test/src/test/java/org/apache/ode/test/MessageRouting20Test.java
> (original)
> +++
> ode/trunk/bpel-test/src/test/java/org/apache/ode/test/MessageRouting20Test.java
> Mon Jan  5 09:57:19 2009
> @@ -84,4 +84,7 @@
>
>  negative("target/test-classes/bpel/2.0/NegativeInitializationTest");
>        }
>
> +    @Test public void testCorrelationUnique() throws Throwable {
> +        go("/bpel/2.0/TestCorrelationUnique");
> +    }
>  }
>
> Modified:
> ode/trunk/bpel-test/src/test/java/org/apache/ode/test/StructuredActivities20Test.java
> URL:
> http://svn.apache.org/viewvc/ode/trunk/bpel-test/src/test/java/org/apache/ode/test/StructuredActivities20Test.java?rev=731639&r1=731638&r2=731639&view=diff
>
> ==============================================================================
> ---
> ode/trunk/bpel-test/src/test/java/org/apache/ode/test/StructuredActivities20Test.java
> (original)
> +++
> ode/trunk/bpel-test/src/test/java/org/apache/ode/test/StructuredActivities20Test.java
> Mon Jan  5 09:57:19 2009
> @@ -36,7 +36,6 @@
>          // Test Flow with XPath10
>          go("/bpel/2.0/TestFlowLinks");
>      }
> -       @Ignore
>     @Test public void testIsolatedScopes1() throws Throwable {
>         // Test Flow with XPath10
>         go("/bpel/2.0/TestIsolatedScopes1");
>
> Added:
> ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestCorrelationUnique/counter.bpel
> URL:
> http://svn.apache.org/viewvc/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestCorrelationUnique/counter.bpel?rev=731639&view=auto
>
> ==============================================================================
> ---
> ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestCorrelationUnique/counter.bpel
> (added)
> +++
> ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestCorrelationUnique/counter.bpel
> Mon Jan  5 09:57:19 2009
> @@ -0,0 +1,98 @@
> +<?xml version="1.0"?>
> +<b:process xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> +          xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> +          xsi:schemaLocation="
> http://docs.oasis-open.org/wsbpel/2.0/process/executable
> http://docs.oasis-open.org/wsbpel/2.0/CS01/process/executable/ws-bpel_executable.xsd
> "
> +          xmlns:b="
> http://docs.oasis-open.org/wsbpel/2.0/process/executable"
> +          name="counter"
> +          xmlns:t="http://example.com/bpel/counter"
> +          targetNamespace="http://example.com/bpel/counter">
> +
> +  <b:import importType="http://schemas.xmlsoap.org/wsdl/"
> +           location="counter.wsdl"
> +           namespace="http://example.com/bpel/counter" />
> +
> +  <b:partnerLinks>
> +    <b:partnerLink name="operations" partnerLinkType="t:plink" myRole="me"
> />
> +  </b:partnerLinks>
> +
> +  <b:variables>
> +    <b:variable name="counter" messageType="t:responseMessage" />
> +    <b:variable name="initiation" messageType="t:requestMessage" />
> +    <b:variable name="empty" messageType="t:emptyResponse" />
> +  </b:variables>
> +
> +  <b:correlationSets>
> +    <b:correlationSet name="name" properties="t:counterProp"
> unique="yes"/>
> +  </b:correlationSets>
> +
> +  <b:sequence>
> +    <b:receive partnerLink="operations" createInstance="yes"
> operation="init" portType="t:port"
> +        variable="initiation">
> +      <b:correlations>
> +        <b:correlation set="name" initiate="yes"/>
> +      </b:correlations>
> +    </b:receive>
> +    <b:assign>
> +      <b:copy>
> +        <b:from>0</b:from>
> +        <b:to variable="counter" part="value"></b:to>
> +      </b:copy>
> +    </b:assign>
> +    <b:reply partnerLink="operations" operation="init" variable="empty" />
> +    <b:flow>
> +      <b:while>
> +        <b:condition>true()</b:condition>
> +          <b:scope>
> +            <b:variables>
> +              <b:variable name="tmp" messageType="t:requestMessage" />
> +            </b:variables>
> +            <b:sequence>
> +              <b:receive partnerLink="operations"
> operation="getAndIncrement" portType="t:port"
> +                  variable="tmp">
> +                <b:correlations>
> +                  <b:correlation set="name" initiate="no" />
> +                </b:correlations>
> +              </b:receive>
> +              <b:reply partnerLink="operations"
> operation="getAndIncrement" variable="counter" />
> +              <b:assign>
> +                <b:copy>
> +                  <b:from>$counter.value+1</b:from>
> +                  <b:to>$counter.value</b:to>
> +                </b:copy>
> +              </b:assign>
> +            </b:sequence>
> +          </b:scope>
> +      </b:while>
> +      <b:while>
> +        <b:condition>true()</b:condition>
> +        <b:scope>
> +          <b:variables>
> +            <b:variable name="tmp" messageType="t:requestMessage" />
> +          </b:variables>
> +          <b:sequence>
> +            <b:receive partnerLink="operations" operation="get"
> variable="tmp">
> +              <b:correlations>
> +                <b:correlation set="name" initiate="no" />
> +              </b:correlations>
> +            </b:receive>
> +            <b:reply partnerLink="operations" operation="get"
> variable="counter" />
> +          </b:sequence>
> +        </b:scope>
> +      </b:while>
> +        <b:scope>
> +          <b:variables>
> +            <b:variable name="tmp" messageType="t:requestMessage" />
> +          </b:variables>
> +          <b:sequence>
> +            <b:receive partnerLink="operations" operation="close"
> variable="tmp">
> +              <b:correlations>
> +                <b:correlation set="name" initiate="no" />
> +              </b:correlations>
> +            </b:receive>
> +            <b:reply partnerLink="operations" operation="close"
> variable="empty"/>
> +            <b:exit />
> +          </b:sequence>
> +        </b:scope>
> +    </b:flow>
> +  </b:sequence>
> +</b:process>
>
> Added:
> ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestCorrelationUnique/counter.wsdl
> URL:
> http://svn.apache.org/viewvc/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestCorrelationUnique/counter.wsdl?rev=731639&view=auto
>
> ==============================================================================
> ---
> ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestCorrelationUnique/counter.wsdl
> (added)
> +++
> ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestCorrelationUnique/counter.wsdl
> Mon Jan  5 09:57:19 2009
> @@ -0,0 +1,84 @@
> +<?xml version="1.0" encoding="UTF-8"?>
> +<wsdl:definitions
> +  targetNamespace="http://example.com/bpel/counter"
> +  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> +  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> +  xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance"
> +  xmlns:p="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
> +  xmlns:v="http://docs.oasis-open.org/wsbpel/2.0/varprop"
> +  xmlns:t="http://example.com/bpel/counter">
> +
> +  <wsdl:message name="requestMessage">
> +    <wsdl:part name="name" type="xsd:string" />
> +  </wsdl:message>
> +
> +  <wsdl:message name="responseMessage">
> +    <wsdl:part name="value" type="xsd:int" />
> +  </wsdl:message>
> +
> +  <wsdl:message name="emptyResponse" />
> +
> +  <wsdl:portType name="port">
> +    <wsdl:operation name="init">
> +      <wsdl:input message="t:requestMessage" />
> +      <wsdl:output message="t:emptyResponse" />
> +    </wsdl:operation>
> +    <wsdl:operation name="get">
> +      <wsdl:input message="t:requestMessage" />
> +      <wsdl:output message="t:responseMessage" />
> +    </wsdl:operation>
> +    <wsdl:operation name="getAndIncrement">
> +      <wsdl:input message="t:requestMessage" />
> +      <wsdl:output message="t:responseMessage" />
> +    </wsdl:operation>
> +    <wsdl:operation name="close">
> +      <wsdl:input message="t:requestMessage" />
> +      <wsdl:output message="t:emptyResponse" />
> +    </wsdl:operation>
> +  </wsdl:portType>
> +
> +  <wsdl:binding name="binding" type="t:port">
> +    <soap:binding style="rpc" transport="
> http://schemas.xmlsoap.org/soap/http"/>
> +    <wsdl:operation name="init">
> +      <soap:operation soapAction="" style="rpc"/>
> +      <wsdl:input>
> +        <soap:body namespace="http://example.com/bpel/counter"
> use="literal"/>
> +      </wsdl:input>
> +      <wsdl:output>
> +        <soap:body namespace="http://example.com/bpel/counter"
> use="literal"/>
> +      </wsdl:output>
> +    </wsdl:operation>
> +    <wsdl:operation name="get">
> +      <soap:operation soapAction="" style="rpc"/>
> +      <wsdl:input>
> +        <soap:body namespace="http://example.com/bpel/counter"
> use="literal"/>
> +      </wsdl:input>
> +      <wsdl:output>
> +        <soap:body namespace="http://example.com/bpel/counter"
> use="literal"/>
> +      </wsdl:output>
> +    </wsdl:operation>
> +    <wsdl:operation name="getAndIncrement">
> +      <soap:operation soapAction="" style="rpc"/>
> +      <wsdl:input>
> +        <soap:body namespace="http://example.com/bpel/counter"
> use="literal"/>
> +      </wsdl:input>
> +      <wsdl:output>
> +        <soap:body namespace="http://example.com/bpel/counter"
> use="literal"/>
> +      </wsdl:output>
> +    </wsdl:operation>
> +  </wsdl:binding>
> +  <wsdl:service name="counter">
> +    <wsdl:port name="port" binding="t:binding">
> +      <soap:address location="http://localhost:8080/ode/processes/counter
> "/>
> +    </wsdl:port>
> +  </wsdl:service>
> +
> +  <p:partnerLinkType name="plink">
> +    <p:role name="me" portType="t:port" />
> +    <p:role name="you" portType="t:port" />
> +  </p:partnerLinkType>
> +
> +  <v:property name="counterProp" type="xsd:string" />
> +
> +  <v:propertyAlias propertyName="t:counterProp" part="name"
> messageType="t:requestMessage" />
> +</wsdl:definitions>
> \ No newline at end of file
>
> Added:
> ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestCorrelationUnique/deploy.xml
> URL:
> http://svn.apache.org/viewvc/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestCorrelationUnique/deploy.xml?rev=731639&view=auto
>
> ==============================================================================
> ---
> ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestCorrelationUnique/deploy.xml
> (added)
> +++
> ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestCorrelationUnique/deploy.xml
> Mon Jan  5 09:57:19 2009
> @@ -0,0 +1,9 @@
> +<?xml version='1.0' encoding='UTF-8'?>
> +<dd:deploy xmlns:dd="http://ode.fivesight.com/schemas/2006/06/27/dd">
> +<dd:process xmlns:dd="http://ode.fivesight.com/schemas/2006/06/27/dd"
> xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:this="
> http://example.com/bpel/counter" name="this:counter"
> fileName="counter.bpel">
> +  <dd:property name="PATH">counter</dd:property>
> +  <dd:property name="SVG">counter.svg</dd:property>
> +  <dd:provide partnerLink="operations">
> +    <dd:service name="this:counter" port="port" />
> +  </dd:provide>
> +</dd:process></dd:deploy>
> \ No newline at end of file
>
> Added:
> ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestCorrelationUnique/derby.log
> URL:
> http://svn.apache.org/viewvc/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestCorrelationUnique/derby.log?rev=731639&view=auto
>
> ==============================================================================
> ---
> ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestCorrelationUnique/derby.log
> (added)
> +++
> ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestCorrelationUnique/derby.log
> Mon Jan  5 09:57:19 2009
> @@ -0,0 +1,6 @@
> +----------------------------------------------------------------
> +2008-12-19 19:59:44.327 GMT:
> + Booting Derby version The Apache Software Foundation - Apache Derby -
> 10.1.3.1 - (417277): instance c013800d-011e-50d5-047f-0000031eb850
> +on database directory
> C:\Intalio\integr\intalio-bpms-ee-5.2.3.003-tomcat-5-5.5.26\var\derby\BPMSDB
> +
> +Database Class Loader started - derby.database.classpath=''
>
> Added:
> ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestCorrelationUnique/test1.properties
> URL:
> http://svn.apache.org/viewvc/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestCorrelationUnique/test1.properties?rev=731639&view=auto
>
> ==============================================================================
> ---
> ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestCorrelationUnique/test1.properties
> (added)
> +++
> ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestCorrelationUnique/test1.properties
> Mon Jan  5 09:57:19 2009
> @@ -0,0 +1,22 @@
> +#
> +#    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.
> +#
> +
> +namespace=http://example.com/bpel/counter
> +service=counter
> +operation=init
> +request1=<http://example.com/bpel/counter+service=counter+operation=init+request1=>
> <message><name>foo</name></message>
> +response1=.*
>
> Added:
> ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestCorrelationUnique/test2.properties
> URL:
> http://svn.apache.org/viewvc/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestCorrelationUnique/test2.properties?rev=731639&view=auto
>
> ==============================================================================
> ---
> ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestCorrelationUnique/test2.properties
> (added)
> +++
> ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestCorrelationUnique/test2.properties
> Mon Jan  5 09:57:19 2009
> @@ -0,0 +1,22 @@
> +#
> +#    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.
> +#
> +
> +namespace=http://example.com/bpel/counter
> +service=counter
> +operation=init
> +request1=<http://example.com/bpel/counter+service=counter+operation=init+request1=>
> <message><name>foo</name></message>
> +response1=FAULT
>
> Added:
> ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestCorrelationUnique/test3.properties
> URL:
> http://svn.apache.org/viewvc/ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestCorrelationUnique/test3.properties?rev=731639&view=auto
>
> ==============================================================================
> ---
> ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestCorrelationUnique/test3.properties
> (added)
> +++
> ode/trunk/bpel-test/src/test/resources/bpel/2.0/TestCorrelationUnique/test3.properties
> Mon Jan  5 09:57:19 2009
> @@ -0,0 +1,22 @@
> +#
> +#    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.
> +#
> +
> +namespace=http://example.com/bpel/counter
> +service=counter
> +operation=init
> +request1=<http://example.com/bpel/counter+service=counter+operation=init+request1=>
> <message><name>bar</name></message>
> +response1=.*
>
> Modified:
> ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/ProcessDaoImpl.java
> URL:
> http://svn.apache.org/viewvc/ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/ProcessDaoImpl.java?rev=731639&r1=731638&r2=731639&view=diff
>
> ==============================================================================
> ---
> ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/ProcessDaoImpl.java
> (original)
> +++
> ode/trunk/dao-hibernate/src/main/java/org/apache/ode/daohib/bpel/ProcessDaoImpl.java
> Mon Jan  5 09:57:19 2009
> @@ -29,12 +29,16 @@
>  import org.apache.ode.daohib.bpel.hobj.HProcessInstance;
>  import org.hibernate.Criteria;
>  import org.hibernate.Hibernate;
> +import org.hibernate.HibernateException;
> +import org.hibernate.LockMode;
>  import org.hibernate.Query;
>  import org.hibernate.criterion.Expression;
>  import org.hibernate.criterion.Order;
> +import org.hibernate.criterion.Restrictions;
>
>  import javax.xml.namespace.QName;
>  import java.util.Collection;
> +import java.util.Collections;
>  import java.util.Date;
>  import java.util.Iterator;
>
> @@ -103,18 +107,28 @@
>         return new ProcessInstanceDaoImpl(_sm,instance);
>     }
>
> +    public Collection<ProcessInstanceDAO> findInstance(CorrelationKey key)
> {
> +       return findInstance(key, true);
> +    }
> +
>     /**
>      * @see org.apache.ode.bpel.dao.ProcessDAO#findInstance(CorrelationKey)
>      */
>     @SuppressWarnings("unchecked")
> -    public Collection<ProcessInstanceDAO> findInstance(CorrelationKey
> ckeyValue) {
> -        entering("ProcessDaoImpl.findInstance");
> -        Criteria criteria =
> getSession().createCriteria(HCorrelationSet.class);
> -        criteria.add(Expression.eq("scope.instance.process.id
> ",_process.getId()));
> -        criteria.add(Expression.eq("value",
> ckeyValue.toCanonicalString()));
> -        criteria.addOrder(Order.desc("scope.instance.created"));
> -        return criteria.list();
> -
> +    public Collection<ProcessInstanceDAO> findInstance(CorrelationKey
> ckeyValue, boolean wait) {
> +       try {
> +               entering("ProcessDaoImpl.findInstance");
> +               Criteria correlationSet =
> getSession().createCriteria(HCorrelationSet.class);
> +               Criteria instance =
> correlationSet.createCriteria("scope").createCriteria("instance");
> +               instance.addOrder(Order.desc("created"));
> +               Criteria process = instance.createCriteria("process");
> +               process.add(Restrictions.eq("id", _process.getId()));
> +               correlationSet.add(Expression.eq("value",
> ckeyValue.toCanonicalString()));
> +               correlationSet.setLockMode(wait ? LockMode.UPGRADE :
> LockMode.UPGRADE_NOWAIT);
> +               return correlationSet.list();
> +       } catch (HibernateException he) {
> +               return Collections.EMPTY_LIST;
> +       }
>     }
>
>     /**
>
> Modified:
> ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ProcessDAOImpl.java
> URL:
> http://svn.apache.org/viewvc/ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ProcessDAOImpl.java?rev=731639&r1=731638&r2=731639&view=diff
>
> ==============================================================================
> ---
> ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ProcessDAOImpl.java
> (original)
> +++
> ode/trunk/dao-jpa/src/main/java/org/apache/ode/dao/jpa/ProcessDAOImpl.java
> Mon Jan  5 09:57:19 2009
> @@ -95,8 +95,12 @@
>                return inst;
>        }
>
> +    public Collection<ProcessInstanceDAO> findInstance(CorrelationKey key)
> {
> +       return findInstance(key, true);
> +    }
> +
>        @SuppressWarnings("unchecked")
> -    public Collection<ProcessInstanceDAO> findInstance(CorrelationKey
> ckey) {
> +    public Collection<ProcessInstanceDAO> findInstance(CorrelationKey
> ckey, boolean wait) {
>                Query qry = getEM().createNamedQuery("InstanceByCKey");
>         qry.setParameter("ckey", ckey.toCanonicalString());
>         return qry.getResultList();
>
> Modified:
> ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/ODEProcess.java
> URL:
> http://svn.apache.org/viewvc/ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/ODEProcess.java?rev=731639&r1=731638&r2=731639&view=diff
>
> ==============================================================================
> ---
> ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/ODEProcess.java
> (original)
> +++
> ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/ODEProcess.java
> Mon Jan  5 09:57:19 2009
> @@ -54,6 +54,7 @@
>  import org.apache.ode.bpel.iapi.Endpoint;
>  import org.apache.ode.bpel.iapi.EndpointReference;
>  import org.apache.ode.bpel.iapi.InvocationStyle;
> +import org.apache.ode.bpel.iapi.Message;
>  import org.apache.ode.bpel.iapi.MessageExchange;
>  import org.apache.ode.bpel.iapi.MyRoleMessageExchange;
>  import org.apache.ode.bpel.iapi.PartnerRoleChannel;
> @@ -71,18 +72,23 @@
>  import org.apache.ode.bpel.intercept.MessageExchangeInterceptor;
>  import org.apache.ode.bpel.memdao.BpelDAOConnectionFactoryImpl;
>  import org.apache.ode.bpel.memdao.ProcessInstanceDaoImpl;
> +import org.apache.ode.bpel.rapi.ConstantsModel;
>  import org.apache.ode.bpel.rapi.FaultInfo;
>  import org.apache.ode.bpel.rapi.OdeRTInstance;
>  import org.apache.ode.bpel.rapi.OdeRuntime;
>  import org.apache.ode.bpel.rapi.PartnerLinkModel;
>  import org.apache.ode.bpel.rapi.ProcessModel;
>  import org.apache.ode.bpel.rapi.Serializer;
> +import org.apache.ode.bpel.runtime.InvalidProcessException;
>  import org.apache.ode.il.config.OdeConfigProperties;
>  import org.apache.ode.jacob.soup.ReplacementMap;
>  import org.apache.ode.jacob.vpu.ExecutionQueueImpl;
> +import org.apache.ode.utils.DOMUtils;
>  import org.apache.ode.utils.GUID;
> +import org.apache.ode.utils.Namespaces;
>  import org.apache.ode.utils.ObjectPrinter;
>  import org.apache.ode.utils.msg.MessageBundle;
> +import org.w3c.dom.Document;
>  import org.w3c.dom.Element;
>  import org.w3c.dom.Node;
>
> @@ -236,12 +242,14 @@
>      */
>     void invokeProcess(final MessageExchangeDAO mexdao) {
>         InvocationStyle istyle = mexdao.getInvocationStyle();
> +               ConstantsModel constants = null;
>
>         _hydrationLatch.latch(1);
>         try {
>             // The following check is mostly for sanity purposes. MexImpls
> should prevent this from
>             // happening.
>             PartnerLinkMyRoleImpl target =
> getMyRoleForService(mexdao.getCallee());
> +            constants =
> target._process.getProcessModel().getConstantsModel();
>             Status oldstatus = mexdao.getStatus();
>             if (target == null) {
>                 String errmsg =
> __msgs.msgMyRoleRoutingFailure(mexdao.getMessageExchangeId());
> @@ -322,6 +330,29 @@
>             } else if (cstatus == CorrelationStatus.QUEUED) {
>                 ; // do nothing
>             }
> +        } catch (InvalidProcessException ipe) {
> +               QName faultQName = null;
> +               if (constants != null) {
> +                       Document document = DOMUtils.newDocument();
> +                       Element faultElement =
> document.createElementNS(Namespaces.SOAP_ENV_NS, "Fault");
> +                       Element faultDetail =
> document.createElementNS(Namespaces.ODE_EXTENSION_NS, "fault");
> +                       faultElement.appendChild(faultDetail);
> +                       switch (ipe.getCauseCode()) {
> +                               case
> InvalidProcessException.DUPLICATE_CAUSE_CODE:
> +                                       faultQName =
> constants.getDuplicateInstance();
> +                                       faultDetail.setTextContent("Found a
> duplicate instance with the same message key");
> +                                       break;
> +                               case
> InvalidProcessException.RETIRED_CAUSE_CODE:
> +                                       faultQName =
> constants.getRetiredProcess();
> +                                       faultDetail.setTextContent("The
> process you're trying to instantiate has been retired");
> +                                       break;
> +                               case
> InvalidProcessException.DEFAULT_CAUSE_CODE:
> +                               default:
> +                                       faultQName =
> constants.getUnknownFault();
> +                                       break;
> +                       }
> +                       MexDaoUtil.setFaulted(mexdao, faultQName,
> faultElement);
> +               }
>         } finally {
>             _hydrationLatch.release(1);
>
>
> Modified:
> ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/PartnerLinkMyRoleImpl.java
> URL:
> http://svn.apache.org/viewvc/ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/PartnerLinkMyRoleImpl.java?rev=731639&r1=731638&r2=731639&view=diff
>
> ==============================================================================
> ---
> ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/PartnerLinkMyRoleImpl.java
> (original)
> +++
> ode/trunk/engine/src/main/java/org/apache/ode/bpel/engine/PartnerLinkMyRoleImpl.java
> Mon Jan  5 09:57:19 2009
> @@ -99,7 +99,7 @@
>         }
>
>         // Is this a /possible/ createInstance Operation?
> -        boolean isCreateInstnace =
> _plinkDef.isCreateInstanceOperation(operation);
> +        boolean isCreateInstance =
> _plinkDef.isCreateInstanceOperation(operation);
>         String correlatorId = ODEProcess.genCorrelatorId(_plinkDef,
> operation.getName());
>         CorrelatorDAO correlator =
> _process.getProcessDAO().getCorrelator(correlatorId);
>
> @@ -108,7 +108,7 @@
>         // now, the tricks begin: when a message arrives we have to see if
> there is anyone waiting for it. Get the correlator, a
>         // persisted communnication-reduction data structure supporting
> correlation correlationKey matching!
>
> -        CorrelationKey[] keys;
> +        CorrelationKey[] processKeys, uniqueKeys;
>
>         // We need to compute the correlation keys (based on the operation
>         // we can infer which correlation keys to compute - this is merely
> a set
> @@ -116,7 +116,8 @@
>         // that is ever referenced in an <receive>/<onMessage> on this
>         // partnerlink/operation.
>         try {
> -            keys = computeCorrelationKeys(mex, operation);
> +            processKeys = computeCorrelationKeys(mex, operation);
> +            uniqueKeys = computeUniqueCorrelationKeys(mex, operation);
>         } catch (InvalidMessageException ime) {
>             // We'd like to do a graceful exit here, no sense in rolling
> back due to a
>             // a message format problem.
> @@ -128,14 +129,14 @@
>         String mySessionId =
> mex.getProperty(MessageExchange.PROPERTY_SEP_MYROLE_SESSIONID);
>         String partnerSessionId =
> mex.getProperty(MessageExchange.PROPERTY_SEP_PARTNERROLE_SESSIONID);
>         if (__log.isDebugEnabled()) {
> -            __log.debug("INPUTMSG: " + correlatorId + ": MSG RCVD keys=" +
> CollectionUtils.makeCollection(HashSet.class, keys)
> +            __log.debug("INPUTMSG: " + correlatorId + ": MSG RCVD keys=" +
> CollectionUtils.makeCollection(HashSet.class, processKeys)
>                     + " mySessionId=" + mySessionId + " partnerSessionId="
> + partnerSessionId);
>         }
>
>         CorrelationKey matchedKey = null;
>
>         // Try to find a route for one of our keys.
> -        for (CorrelationKey key : keys) {
> +        for (CorrelationKey key : processKeys) {
>             messageRoute = correlator.findRoute(key);
>             if (messageRoute != null) {
>                 if (__log.isDebugEnabled()) {
> @@ -151,8 +152,8 @@
>         // If no luck, and this operation qualifies for create-instance
>         // treatment, then create a new process
>         // instance.
> -        if (messageRoute == null && isCreateInstnace) {
> -            invokeMyRoleCreateInstance(mex, operation, correlatorId,
> correlator);
> +        if (messageRoute == null && isCreateInstance) {
> +            invokeMyRoleCreateInstance(mex, operation, correlatorId,
> correlator, uniqueKeys);
>         } else if (messageRoute != null) {
>             if (__log.isDebugEnabled()) {
>                 __log.debug("INPUTMSG: " + correlatorId + ": ROUTING to
> instance "
> @@ -195,21 +196,21 @@
>             // } else {
>             // send event
>             CorrelationNoMatchEvent evt = new
> CorrelationNoMatchEvent(mex.getPortType(), mex.getOperation(), mex
> -                    .getMessageExchangeId(), keys);
> +                    .getMessageExchangeId(), processKeys);
>
>             evt.setProcessId(_process.getProcessDAO().getProcessId());
>             evt.setProcessName(_process.getProcessModel().getQName());
>             _process._debugger.onEvent(evt);
>
>
> mex.setCorrelationStatus(MyRoleMessageExchange.CorrelationStatus.QUEUED.toString());
> -            correlator.enqueueMessage(mex, keys);
> +            correlator.enqueueMessage(mex, processKeys);
>         }
>
>         return CorrelationStatus.valueOf(mex.getCorrelationStatus());
>     }
>
>     private void invokeMyRoleCreateInstance(MessageExchangeDAO mex,
> Operation operation, String correlatorId,
> -            CorrelatorDAO correlator) {
> +            CorrelatorDAO correlator, CorrelationKey[] uniqueKeys) {
>         if (__log.isDebugEnabled()) {
>             __log.debug("INPUTMSG: " + correlatorId + ": routing failed,
> CREATING NEW INSTANCE");
>         }
> @@ -224,8 +225,19 @@
>         // return;
>         // }
>
> +        for (CorrelationKey uniqueKey : uniqueKeys) {
> +               // double-check that the correlation set is indeed unique
> +               if (uniqueKey.isUnique()) {
> +                       Collection<ProcessInstanceDAO> instances =
> processDAO.findInstance(uniqueKey, false);
> +                       if (instances.size() != 0) {
> +                    __log.debug("Not creating a new instance for mex " +
> mex + "; unique correlation constraint would be violated!");
> +                    throw new InvalidProcessException("Unique process
> constraint violated", InvalidProcessException.DUPLICATE_CAUSE_CODE);
> +                       }
> +               }
> +        }
> +
>         ProcessInstanceDAO newInstance =
> processDAO.createInstance(correlator);
> -
> +
>         // send process instance event
>         NewProcessInstanceEvent evt = new
> NewProcessInstanceEvent(_process.getProcessModel().getQName(),
>                 processDAO.getProcessId(), newInstance.getInstanceId());
> @@ -263,6 +275,25 @@
>         return keys.toArray(new CorrelationKey[keys.size()]);
>     }
>
> +    private CorrelationKey[]
> computeUniqueCorrelationKeys(MessageExchangeDAO mex, Operation operation) {
> +        Element msg = mex.getRequest().getData();
> +        javax.wsdl.Message msgDescription =
> operation.getInput().getMessage();
> +        List<CorrelationKey> keys = new ArrayList<CorrelationKey>();
> +
> +        Set<CorrelationSetModel> csets =
> _plinkDef.getUniqueCorrelationSetsForOperation(operation);
> +        for (CorrelationSetModel cset : csets) {
> +            CorrelationKey key = computeCorrelationKey(cset,
> msgDescription.getQName(), msg);
> +            keys.add(key);
> +        }
> +
> +        // Let's creata a key based on the sessionId
> +        String mySessionId =
> mex.getProperty(MessageExchange.PROPERTY_SEP_MYROLE_SESSIONID);
> +        if (mySessionId != null)
> +            keys.add(new CorrelationKey(-1, new String[] { mySessionId
> }));
> +
> +        return keys.toArray(new CorrelationKey[keys.size()]);
> +    }
> +
>     private CorrelationKey computeCorrelationKey(CorrelationSetModel cset,
> QName messageName, Element msg) {
>         String[] values;
>         if (cset.getExtractors().isEmpty()) {
> @@ -295,7 +326,9 @@
>             }
>         }
>
> -        return new CorrelationKey(cset.getId(), values);
> +        CorrelationKey key = new CorrelationKey(cset.getId(), values);
> +        key.setUnique(cset.isUnique());
> +        return key;
>     }
>
>        public boolean isOneWayOnly() {
>
> Modified:
> ode/trunk/engine/src/main/java/org/apache/ode/bpel/memdao/ProcessDaoImpl.java
> URL:
> http://svn.apache.org/viewvc/ode/trunk/engine/src/main/java/org/apache/ode/bpel/memdao/ProcessDaoImpl.java?rev=731639&r1=731638&r2=731639&view=diff
>
> ==============================================================================
> ---
> ode/trunk/engine/src/main/java/org/apache/ode/bpel/memdao/ProcessDaoImpl.java
> (original)
> +++
> ode/trunk/engine/src/main/java/org/apache/ode/bpel/memdao/ProcessDaoImpl.java
> Mon Jan  5 09:57:19 2009
> @@ -133,6 +133,10 @@
>     }
>
>     public Collection<ProcessInstanceDAO> findInstance(CorrelationKey key)
> {
> +       return findInstance(key, true);
> +    }
> +
> +    public Collection<ProcessInstanceDAO> findInstance(CorrelationKey key,
> boolean wait) {
>         ArrayList<ProcessInstanceDAO> result = new
> ArrayList<ProcessInstanceDAO>();
>         for (ProcessInstanceDAO instance : _instances.values()) {
>             for (CorrelationSetDAO corrSet : instance.getCorrelationSets())
> {
>
> Modified:
> ode/trunk/engine/src/main/java/org/apache/ode/bpel/runtime/InvalidProcessException.java
> URL:
> http://svn.apache.org/viewvc/ode/trunk/engine/src/main/java/org/apache/ode/bpel/runtime/InvalidProcessException.java?rev=731639&r1=731638&r2=731639&view=diff
>
> ==============================================================================
> ---
> ode/trunk/engine/src/main/java/org/apache/ode/bpel/runtime/InvalidProcessException.java
> (original)
> +++
> ode/trunk/engine/src/main/java/org/apache/ode/bpel/runtime/InvalidProcessException.java
> Mon Jan  5 09:57:19 2009
> @@ -31,6 +31,8 @@
>
>     public final static int RETIRED_CAUSE_CODE = 1;
>
> +    public final static int DUPLICATE_CAUSE_CODE = 2;
> +
>     private final int causeCode;
>
>     public InvalidProcessException(String msg, Throwable cause) {
>
> Modified:
> ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/BpelJacobRunnable.java
> URL:
> http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/BpelJacobRunnable.java?rev=731639&r1=731638&r2=731639&view=diff
>
> ==============================================================================
> ---
> ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/BpelJacobRunnable.java
> (original)
> +++
> ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/BpelJacobRunnable.java
> Mon Jan  5 09:57:19 2009
> @@ -96,6 +96,7 @@
>         }
>
>         CorrelationKey ckeyVal = new
> CorrelationKey(cset.declaration.getId(), propValues);
> +        ckeyVal.setUnique(cset.declaration.unique);
>         getBpelRuntime().writeCorrelation(cset,ckeyVal);
>     }
>
>
> Modified:
> ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OConstants.java
> URL:
> http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OConstants.java?rev=731639&r1=731638&r2=731639&view=diff
>
> ==============================================================================
> ---
> ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OConstants.java
> (original)
> +++
> ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OConstants.java
> Mon Jan  5 09:57:19 2009
> @@ -27,6 +27,8 @@
>  public class OConstants extends OBase {
>
>     private static final long serialVersionUID = 1L;
> +
> +    // standard fault names
>     public QName qnMissingRequest;
>     public QName qnMissingReply;
>     public QName qnUninitializedVariable;
> @@ -43,6 +45,10 @@
>     public QName qnInvalidBranchCondition;
>     public QName qnInvalidExpressionValue;
>
> +    // non-standard fault names
> +    public QName qnRetiredProcess;
> +    public QName qnDuplicateInstance;
> +    public QName qnUnknownFault;
>
>     public OConstants(OProcess owner) {
>         super(owner);
>
> Modified:
> ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OPartnerLink.java
> URL:
> http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OPartnerLink.java?rev=731639&r1=731638&r2=731639&view=diff
>
> ==============================================================================
> ---
> ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OPartnerLink.java
> (original)
> +++
> ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OPartnerLink.java
> Mon Jan  5 09:57:19 2009
> @@ -57,6 +57,9 @@
>     /** The set of CorrelationSets that may be used as a match criteria,
> organized by {@link Operation} */
>     private final HashMap<String,Set<OScope.CorrelationSet>>
> _nonIntitiatingCorrelationSets = new
> HashMap<String,Set<OScope.CorrelationSet>>();
>
> +    /** The set of initiating CorrelationSets that may be used as an
> uniqueness criteria, organized by {@link Operation} */
> +    private final HashMap<String,Set<OScope.CorrelationSet>>
> _uniqueInitiatingCorrelationSets = new
> HashMap<String,Set<OScope.CorrelationSet>>();
> +
>     /** The set of {@link Operation}s that can be used to create a process
> instance. */
>     private final HashSet<String> _createInstanceOperations = new
> HashSet<String>();
>
> @@ -116,6 +119,43 @@
>         return Collections.unmodifiableSet(new HashSet(ret));
>     }
>
> +    /**
> +     * Add a {@link org.apache.ode.bpel.o.OScope.CorrelationSet} to an
> {@link Operation}'s list
> +     * of "unique-initiating" correlation sets. The unique-initiating
> correlation sets are those
> +     * sets that are used (along with the operation) to "initiate"
> incoming messages, provided
> +     * that there doesn't already exist a process instance with that
> correlation key.
> +     * We need to know which correlation sets are used with which
> operation in order to
> +     * pre-compute correlation keys at the time of message receipt.
> +     * @param operation WSDL {@link Operation}
> +     * @param cset unique-initiating correlation used in this operation
> +     */
> +    @SuppressWarnings("unchecked")
> +    public void addUniqueCorrelationSetForOperation(Operation operation,
> OScope.CorrelationSet cset) {
> +       if (cset.unique) {
> +               Set<OScope.CorrelationSet> ret =
> _uniqueInitiatingCorrelationSets.get(operation.getName());
> +               if (ret == null) {
> +                   ret = new HashSet<OScope.CorrelationSet>();
> +
> _uniqueInitiatingCorrelationSets.put(operation.getName(), ret);
> +               }
> +               ret.add(cset);
> +       }
> +    }
> +
> +    /**
> +     * Get all unique initiating correlation sets that are ever used to
> qualify a receive for a the given
> +     * operation.
> +     * @param operation the operation
> +     * @return all unique-initiating correlation sets used in the given
> operation
> +     */
> +    @SuppressWarnings("unchecked")
> +    public Set<CorrelationSetModel>
> getUniqueCorrelationSetsForOperation(Operation operation) {
> +        Set<OScope.CorrelationSet> ret =
> _uniqueInitiatingCorrelationSets.get(operation.getName());
> +        if (ret == null) {
> +            return Collections.EMPTY_SET;
> +        }
> +        return Collections.unmodifiableSet(new HashSet(ret));
> +    }
> +
>     @SuppressWarnings("unchecked")
>     public Operation getMyRoleOperation(String name) {
>         for (Operation op :
> (List<Operation>)myRolePortType.getOperations())
>
> Modified:
> ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OProcess.java
> URL:
> http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OProcess.java?rev=731639&r1=731638&r2=731639&view=diff
>
> ==============================================================================
> ---
> ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OProcess.java
> (original)
> +++
> ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OProcess.java
> Mon Jan  5 09:57:19 2009
> @@ -18,6 +18,7 @@
>  */
>  package org.apache.ode.bpel.rtrep.v1;
>
> +import org.apache.ode.bpel.rapi.ConstantsModel;
>  import org.apache.ode.bpel.rapi.ProcessModel;
>  import org.apache.ode.bpel.rapi.ActivityModel;
>  import org.apache.ode.bpel.rapi.PartnerLinkModel;
> @@ -216,4 +217,81 @@
>     public int getModelVersion() {
>         return 1;
>     }
> +
> +    public ConstantsModel getConstantsModel() {
> +       return new ConstantsModel() {
> +
> +                       public QName getConflictingReceive() {
> +                               return constants.qnConflictingReceive;
> +                       }
> +
> +                       public QName getCorrelationViolation() {
> +                               return constants.qnCorrelationViolation;
> +                       }
> +
> +                       public QName getDuplicateInstance() {
> +                               return constants.qnDuplicateInstance;
> +                       }
> +
> +                       public QName getForEachCounterError() {
> +                               return constants.qnForEachCounterError;
> +                       }
> +
> +                       public QName getForcedTermination() {
> +                               return constants.qnForcedTermination;
> +                       }
> +
> +                       public QName getInvalidBranchCondition() {
> +                               return constants.qnInvalidBranchCondition;
> +                       }
> +
> +                       public QName getInvalidExpressionValue() {
> +                               return constants.qnInvalidExpressionValue;
> +                       }
> +
> +                       public QName getJoinFailure() {
> +                               return constants.qnJoinFailure;
> +                       }
> +
> +                       public QName getMismatchedAssignmentFailure() {
> +                               return
> constants.qnMismatchedAssignmentFailure;
> +                       }
> +
> +                       public QName getMissingReply() {
> +                               return constants.qnMissingReply;
> +                       }
> +
> +                       public QName getMissingRequest() {
> +                               return constants.qnMissingRequest;
> +                       }
> +
> +                       public QName getRetiredProcess() {
> +                               return constants.qnRetiredProcess;
> +                       }
> +
> +                       public QName getSelectionFailure() {
> +                               return constants.qnSelectionFailure;
> +                       }
> +
> +                       public QName getSubLanguageExecutionFault() {
> +                               return
> constants.qnSubLanguageExecutionFault;
> +                       }
> +
> +                       public QName getUninitializedPartnerRole() {
> +                               return
> constants.qnUninitializedPartnerRole;
> +                       }
> +
> +                       public QName getUninitializedVariable() {
> +                               return constants.qnUninitializedVariable;
> +                       }
> +
> +                       public QName getUnknownFault() {
> +                               return constants.qnUnknownFault;
> +                       }
> +
> +                       public QName getXsltInvalidSource() {
> +                               return constants.qnXsltInvalidSource;
> +                       }
> +       };
> +    }
>  }
>
> Modified:
> ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OScope.java
> URL:
> http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OScope.java?rev=731639&r1=731638&r2=731639&view=diff
>
> ==============================================================================
> ---
> ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OScope.java
> (original)
> +++
> ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/OScope.java
> Mon Jan  5 09:57:19 2009
> @@ -158,6 +158,7 @@
>         public String name;
>         public OScope declaringScope;
>         public final List<OProcess.OProperty>properties = new
> ArrayList<OProcess.OProperty>();
> +        public boolean unique;
>
>
>         public CorrelationSet(OProcess owner) {
> @@ -183,7 +184,11 @@
>         }
>
>         public List<PropertyExtractor> getExtractors() {
> -            return new ArrayList();
> +            return new ArrayList<PropertyExtractor>();
> +        }
> +
> +        public boolean isUnique() {
> +               return unique;
>         }
>     }
>
>
> Modified:
> ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/RuntimeInstanceImpl.java
> URL:
> http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/RuntimeInstanceImpl.java?rev=731639&r1=731638&r2=731639&view=diff
>
> ==============================================================================
> ---
> ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/RuntimeInstanceImpl.java
> (original)
> +++
> ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v1/RuntimeInstanceImpl.java
> Mon Jan  5 09:57:19 2009
> @@ -187,6 +187,7 @@
>             propNames[m] = oProperty.name;
>         }
>
> +        ckeyVal.setUnique(cset.declaration.unique);
>         _brc.writeCorrelation(cset, propNames, ckeyVal);
>
>     }
>
> Modified:
> ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/BpelJacobRunnable.java
> URL:
> http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/BpelJacobRunnable.java?rev=731639&r1=731638&r2=731639&view=diff
>
> ==============================================================================
> ---
> ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/BpelJacobRunnable.java
> (original)
> +++
> ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/BpelJacobRunnable.java
> Mon Jan  5 09:57:19 2009
> @@ -96,6 +96,7 @@
>         }
>
>         CorrelationKey ckeyVal = new
> CorrelationKey(cset.declaration.getId(), propValues);
> +        ckeyVal.setUnique(cset.declaration.unique);
>         getBpelRuntime().writeCorrelation(cset,ckeyVal);
>     }
>
>
> Modified:
> ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OConstants.java
> URL:
> http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OConstants.java?rev=731639&r1=731638&r2=731639&view=diff
>
> ==============================================================================
> ---
> ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OConstants.java
> (original)
> +++
> ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OConstants.java
> Mon Jan  5 09:57:19 2009
> @@ -27,6 +27,8 @@
>  public class OConstants extends OBase {
>
>     private static final long serialVersionUID = 1L;
> +
> +    // standard fault names
>     public QName qnMissingRequest;
>     public QName qnMissingReply;
>     public QName qnUninitializedVariable;
> @@ -44,6 +46,10 @@
>     public QName qnInvalidExpressionValue;
>     public QName qnScopeRollback;
>
> +    // non-standard fault names
> +    public QName qnRetiredProcess;
> +    public QName qnDuplicateInstance;
> +    public QName qnUnknownFault;
>
>     public OConstants(OProcess owner) {
>         super(owner);
>
> Modified:
> ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OPartnerLink.java
> URL:
> http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OPartnerLink.java?rev=731639&r1=731638&r2=731639&view=diff
>
> ==============================================================================
> ---
> ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OPartnerLink.java
> (original)
> +++
> ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OPartnerLink.java
> Mon Jan  5 09:57:19 2009
> @@ -57,6 +57,9 @@
>     /** The set of CorrelationSets that may be used as a match criteria,
> organized by {@link Operation} */
>     private final HashMap<String,Set<CorrelationSetModel>>
> _nonIntitiatingCorrelationSets = new
> HashMap<String,Set<CorrelationSetModel>>();
>
> +    /** The set of initiating CorrelationSets that may be used as an
> uniqueness criteria, organized by {@link Operation} */
> +    private final HashMap<String,Set<CorrelationSetModel>>
> _uniqueInitiatingCorrelationSets = new
> HashMap<String,Set<CorrelationSetModel>>();
> +
>     /** The set of {@link Operation}s that can be used to create a process
> instance. */
>     private final HashSet<String> _createInstanceOperations = new
> HashSet<String>();
>
> @@ -138,6 +141,42 @@
>         return Collections.unmodifiableSet(ret);
>     }
>
> +    /**
> +     * Add a {@link org.apache.ode.bpel.o.OScope.CorrelationSet} to an
> {@link Operation}'s list
> +     * of "unique-initiating" correlation sets. The unique-initiating
> correlation sets are those
> +     * sets that are used (along with the operation) to "initiate"
> incoming messages, provided
> +     * that there doesn't already exist a process instance with that
> correlation key.
> +     * We need to know which correlation sets are used with which
> operation in order to
> +     * pre-compute correlation keys at the time of message receipt.
> +     * @param operation WSDL {@link Operation}
> +     * @param cset unique-initiating correlation used in this operation
> +     */
> +    public void addUniqueCorrelationSetForOperation(Operation operation,
> CorrelationSetModel cset) {
> +       if (cset.isUnique()) {
> +               Set<CorrelationSetModel> ret =
> _uniqueInitiatingCorrelationSets.get(operation.getName());
> +               if (ret == null) {
> +                   ret = new HashSet<CorrelationSetModel>();
> +
> _uniqueInitiatingCorrelationSets.put(operation.getName(), ret);
> +               }
> +               ret.add(cset);
> +       }
> +    }
> +
> +    /**
> +     * Get all unique initiating correlation sets that are ever used to
> qualify a receive for a the given
> +     * operation.
> +     * @param operation the operation
> +     * @return all unique-initiating correlation sets used in the given
> operation
> +     */
> +    @SuppressWarnings("unchecked")
> +    public Set<CorrelationSetModel>
> getUniqueCorrelationSetsForOperation(Operation operation) {
> +        Set<CorrelationSetModel> ret =
> _uniqueInitiatingCorrelationSets.get(operation.getName());
> +        if (ret == null) {
> +            return Collections.EMPTY_SET;
> +        }
> +        return Collections.unmodifiableSet(ret);
> +    }
> +
>     @SuppressWarnings("unchecked")
>     public Operation getMyRoleOperation(String name) {
>         for (Operation op :
> (List<Operation>)myRolePortType.getOperations())
>
> Modified:
> ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OProcess.java
> URL:
> http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OProcess.java?rev=731639&r1=731638&r2=731639&view=diff
>
> ==============================================================================
> ---
> ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OProcess.java
> (original)
> +++
> ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OProcess.java
> Mon Jan  5 09:57:19 2009
> @@ -18,6 +18,7 @@
>  */
>  package org.apache.ode.bpel.rtrep.v2;
>
> +import org.apache.ode.bpel.rapi.ConstantsModel;
>  import org.apache.ode.bpel.rapi.ProcessModel;
>  import org.apache.ode.bpel.rapi.PartnerLinkModel;
>  import org.apache.ode.bpel.rapi.PropertyAliasModel;
> @@ -238,4 +239,81 @@
>     public int getModelVersion() {
>         return 2;
>     }
> +
> +    public ConstantsModel getConstantsModel() {
> +       return new ConstantsModel() {
> +
> +                       public QName getConflictingReceive() {
> +                               return constants.qnConflictingReceive;
> +                       }
> +
> +                       public QName getCorrelationViolation() {
> +                               return constants.qnCorrelationViolation;
> +                       }
> +
> +                       public QName getDuplicateInstance() {
> +                               return constants.qnDuplicateInstance;
> +                       }
> +
> +                       public QName getForEachCounterError() {
> +                               return constants.qnForEachCounterError;
> +                       }
> +
> +                       public QName getForcedTermination() {
> +                               return constants.qnForcedTermination;
> +                       }
> +
> +                       public QName getInvalidBranchCondition() {
> +                               return constants.qnInvalidBranchCondition;
> +                       }
> +
> +                       public QName getInvalidExpressionValue() {
> +                               return constants.qnInvalidExpressionValue;
> +                       }
> +
> +                       public QName getJoinFailure() {
> +                               return constants.qnJoinFailure;
> +                       }
> +
> +                       public QName getMismatchedAssignmentFailure() {
> +                               return
> constants.qnMismatchedAssignmentFailure;
> +                       }
> +
> +                       public QName getMissingReply() {
> +                               return constants.qnMissingReply;
> +                       }
> +
> +                       public QName getMissingRequest() {
> +                               return constants.qnMissingRequest;
> +                       }
> +
> +                       public QName getRetiredProcess() {
> +                               return constants.qnRetiredProcess;
> +                       }
> +
> +                       public QName getSelectionFailure() {
> +                               return constants.qnSelectionFailure;
> +                       }
> +
> +                       public QName getSubLanguageExecutionFault() {
> +                               return
> constants.qnSubLanguageExecutionFault;
> +                       }
> +
> +                       public QName getUninitializedPartnerRole() {
> +                               return
> constants.qnUninitializedPartnerRole;
> +                       }
> +
> +                       public QName getUninitializedVariable() {
> +                               return constants.qnUninitializedVariable;
> +                       }
> +
> +                       public QName getUnknownFault() {
> +                               return constants.qnUnknownFault;
> +                       }
> +
> +                       public QName getXsltInvalidSource() {
> +                               return constants.qnXsltInvalidSource;
> +                       }
> +       };
> +    }
>  }
>
> Modified:
> ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OScope.java
> URL:
> http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OScope.java?rev=731639&r1=731638&r2=731639&view=diff
>
> ==============================================================================
> ---
> ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OScope.java
> (original)
> +++
> ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/OScope.java
> Mon Jan  5 09:57:19 2009
> @@ -166,6 +166,7 @@
>         public OScope declaringScope;
>         public final List<OProcess.OProperty> properties = new
> ArrayList<OProcess.OProperty>();
>         public final List<PropertyExtractor> extractors = new
> ArrayList<PropertyExtractor>();
> +        public boolean unique;
>
>         public CorrelationSet(OProcess owner) {
>             super(owner);
> @@ -192,6 +193,10 @@
>         public List<PropertyExtractor> getExtractors() {
>             return extractors;
>         }
> +
> +        public boolean isUnique() {
> +               return unique;
> +        }
>     }
>
>     public static final class Variable extends OBase {
>
> Modified:
> ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/RuntimeInstanceImpl.java
> URL:
> http://svn.apache.org/viewvc/ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/RuntimeInstanceImpl.java?rev=731639&r1=731638&r2=731639&view=diff
>
> ==============================================================================
> ---
> ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/RuntimeInstanceImpl.java
> (original)
> +++
> ode/trunk/runtimes/src/main/java/org/apache/ode/bpel/rtrep/v2/RuntimeInstanceImpl.java
> Mon Jan  5 09:57:19 2009
> @@ -186,6 +186,7 @@
>             propNames[m] = oProperty.name;
>         }
>
> +        ckeyVal.setUnique(cset.declaration.unique);
>         _brc.writeCorrelation(cset, propNames, ckeyVal);
>
>     }
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message