You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by rr...@apache.org on 2009/11/18 13:28:59 UTC
svn commit: r881749 - in /ode/branches/APACHE_ODE_1.X:
bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/
bpel-obj/src/main/java/org/apache/ode/bpel/o/
bpel-runtime/src/main/java/org/apache/ode/bpel/engine/
bpel-runtime/src/main/java/org/apache/...
Author: rr
Date: Wed Nov 18 12:28:58 2009
New Revision: 881749
URL: http://svn.apache.org/viewvc?rev=881749&view=rev
Log:
ODE-634: Event Handlers not working fix
Added:
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/IMAManager.java (with props)
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/migration/OutstandingRequestsMigration.java (with props)
ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/
ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/TestIMA.bpel
ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/TestIMA.wsdl
ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/deploy.xml (with props)
ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/test1.properties (with props)
ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/test2.properties (with props)
ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/test3.properties (with props)
ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/test4.properties (with props)
Modified:
ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java
ode/branches/APACHE_ODE_1.X/bpel-obj/src/main/java/org/apache/ode/bpel/o/OConstants.java
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/OutstandingRequestManager.java
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/migration/MigrationHandler.java
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/replayer/ReplayerBpelRuntimeContextImpl.java
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/BpelRuntimeContext.java
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/EH_EVENT.java
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PICK.java
ode/branches/APACHE_ODE_1.X/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/CoreBpelTest.java
ode/branches/APACHE_ODE_1.X/bpel-test/src/main/java/org/apache/ode/test/BPELTestAbstract.java
ode/branches/APACHE_ODE_1.X/bpel-test/src/test/java/org/apache/ode/test/MessageRouting20Test.java
ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/log4j.properties
Modified: ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java?rev=881749&r1=881748&r2=881749&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java (original)
+++ ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/BpelCompiler.java Wed Nov 18 12:28:58 2009
@@ -779,6 +779,7 @@
private OConstants makeConstants() {
OConstants constants = new OConstants(_oprocess);
constants.qnConflictingReceive = new QName(getBpwsNamespace(), "conflictingReceive");
+ constants.qnConflictingRequest = new QName(getBpwsNamespace(), "conflictingRequest");
constants.qnCorrelationViolation = new QName(getBpwsNamespace(), "correlationViolation");
constants.qnForcedTermination = new QName(getBpwsNamespace(), "forcedTermination");
constants.qnJoinFailure = new QName(getBpwsNamespace(), "joinFailure");
Modified: ode/branches/APACHE_ODE_1.X/bpel-obj/src/main/java/org/apache/ode/bpel/o/OConstants.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-obj/src/main/java/org/apache/ode/bpel/o/OConstants.java?rev=881749&r1=881748&r2=881749&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-obj/src/main/java/org/apache/ode/bpel/o/OConstants.java (original)
+++ ode/branches/APACHE_ODE_1.X/bpel-obj/src/main/java/org/apache/ode/bpel/o/OConstants.java Wed Nov 18 12:28:58 2009
@@ -31,6 +31,7 @@
public QName qnMissingReply;
public QName qnUninitializedVariable;
public QName qnConflictingReceive;
+ public QName qnConflictingRequest;
public QName qnSelectionFailure;
public QName qnMismatchedAssignmentFailure;
public QName qnJoinFailure;
Modified: ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java?rev=881749&r1=881748&r2=881749&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java (original)
+++ ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/BpelRuntimeContextImpl.java Wed Nov 18 12:28:58 2009
@@ -114,6 +114,8 @@
protected OutstandingRequestManager _outstandingRequests;
+ protected IMAManager _imaManager;
+
protected BpelProcess _bpelProcess;
private Date _currentEventDateTime;
@@ -132,14 +134,15 @@
_soup = new ExecutionQueueImpl(null);
_soup.setReplacementMap(_bpelProcess.getReplacementMap(dao.getProcess().getProcessId()));
- _outstandingRequests = new OutstandingRequestManager();
+ _outstandingRequests = null;
+ _imaManager = new IMAManager();
_vpu.setContext(_soup);
if (bpelProcess.isInMemory()) {
ProcessInstanceDaoImpl inmem = (ProcessInstanceDaoImpl) _dao;
if (inmem.getSoup() != null) {
_soup = (ExecutionQueueImpl) inmem.getSoup();
- _outstandingRequests = (OutstandingRequestManager) _soup.getGlobalData();
+ _imaManager = (IMAManager) _soup.getGlobalData();
_vpu.setContext(_soup);
}
} else {
@@ -151,7 +154,7 @@
} catch (Exception ex) {
throw new RuntimeException(ex);
}
- _outstandingRequests = (OutstandingRequestManager) _soup.getGlobalData();
+ _imaManager = (IMAManager) _soup.getGlobalData();
}
}
@@ -332,12 +335,12 @@
correlators.add(processDao.getCorrelator(correlatorId));
}
- int conflict = _outstandingRequests.findConflict(selectors);
+ int conflict = _imaManager.findConflict(selectors);
if (conflict != -1)
throw new FaultException(_bpelProcess.getOProcess().constants.qnConflictingReceive, selectors[conflict]
.toString());
- _outstandingRequests.register(pickResponseChannelStr, selectors);
+ _imaManager.register(pickResponseChannelStr, selectors);
// First check if we match to a new instance.
if (_instantiatingMessageExchange != null && _dao.getState() == ProcessState.STATE_READY) {
@@ -483,13 +486,18 @@
}
public void cancelOutstandingRequests(String channelId) {
- _outstandingRequests.cancel(channelId);
+ _imaManager.cancel(channelId, false);
+ }
+
+ public void processOutstandingRequest(PartnerLinkInstance partnerLink, String opName, String bpelMexId, String odeMexId) throws FaultException {
+ String mexRef = _imaManager.processOutstandingRequest(partnerLink, opName, bpelMexId, odeMexId);
+ if (mexRef != null) {
+ reply(mexRef, partnerLink, opName, bpelMexId, null, _bpelProcess.getOProcess().constants.qnConflictingRequest, true);
+ throw new FaultException(_bpelProcess.getOProcess().constants.qnConflictingRequest);
+ }
}
- public void reply(final PartnerLinkInstance plinkInstnace, final String opName, final String mexId, Element msg,
- QName fault) throws FaultException {
- String mexRef = _outstandingRequests.release(plinkInstnace, opName, mexId);
-
+ public void reply(String mexRef, final PartnerLinkInstance plinkInstnace, final String opName, final String mexId, Element msg, QName fault, boolean failure) throws FaultException {
if (mexRef == null) {
throw new FaultException(_bpelProcess.getOProcess().constants.qnMissingRequest);
}
@@ -510,7 +518,9 @@
_bpelProcess.initMyRoleMex(m);
m.setResponse(new MessageImpl(message));
- if (fault != null) {
+ if (failure) {
+ mex.setStatus(MessageExchange.Status.FAILURE.toString());
+ } else if (fault != null) {
mex.setStatus(MessageExchange.Status.FAULT.toString());
mex.setFault(fault);
evt.setAspect(ProcessMessageExchangeEvent.PROCESS_FAULT);
@@ -557,6 +567,12 @@
sendEvent(evt);
}
+ public void reply(final PartnerLinkInstance plinkInstnace, final String opName, final String mexId, Element msg,
+ QName fault) throws FaultException {
+ String mexRef = _imaManager.release(plinkInstnace, opName, mexId);
+ reply(mexRef, plinkInstnace, opName, mexId, msg, fault, false);
+ }
+
/**
* @see BpelRuntimeContext#writeCorrelation(org.apache.ode.bpel.runtime.CorrelationSetInstance,
* org.apache.ode.bpel.common.CorrelationKey)
@@ -876,13 +892,14 @@
public void execute() {
long maxTime = System.currentTimeMillis() + _maxReductionTimeMs;
boolean canReduce = true;
+ assert _outstandingRequests == null && _imaManager != null;
while (ProcessState.canExecute(_dao.getState()) && System.currentTimeMillis() < maxTime && canReduce) {
canReduce = _vpu.execute();
}
_dao.setLastActiveTime(new Date());
if (!ProcessState.isFinished(_dao.getState())) {
if (__log.isDebugEnabled()) __log.debug("Setting execution state on instance " + _iid);
- _soup.setGlobalData(_outstandingRequests);
+ _soup.setGlobalData(_imaManager);
if (_bpelProcess.isInMemory()) {
// don't serialize in-memory processes
@@ -936,8 +953,6 @@
sendEvent(evt);
}
- _outstandingRequests.associate(responsechannel, mex.getMessageExchangeId());
-
final String mexId = mex.getMessageExchangeId();
_vpu.inject(new JacobRunnable() {
private static final long serialVersionUID = 3168964409165899533L;
@@ -953,7 +968,7 @@
// In case this is a pick event, we remove routes,
// and cancel the outstanding requests.
_dao.getProcess().removeRoutes(timerResponseChannel, _dao);
- _outstandingRequests.cancel(timerResponseChannel);
+ _imaManager.cancel(timerResponseChannel, true);
// Ignore timer events after the process is finished.
if (ProcessState.isFinished(_dao.getState())) {
@@ -976,7 +991,7 @@
// receive/reply association.
final String id = timerResponseChannel.export();
_dao.getProcess().removeRoutes(id, _dao);
- _outstandingRequests.cancel(id);
+ _imaManager.cancel(id, true);
_vpu.inject(new JacobRunnable() {
private static final long serialVersionUID = 6157913683737696396L;
@@ -1095,7 +1110,7 @@
}
private void completeOutstandingMessageExchanges() {
- String[] mexRefs = _outstandingRequests.releaseAll();
+ String[] mexRefs = _imaManager.releaseAll();
for (String mexId : mexRefs) {
MessageExchangeDAO mexDao = _dao.getConnection().getMessageExchange(mexId);
if (mexDao != null) {
@@ -1120,7 +1135,7 @@
}
private void faultOutstandingMessageExchanges(FaultData faultData) {
- String[] mexRefs = _outstandingRequests.releaseAll();
+ String[] mexRefs = _imaManager.releaseAll();
for (String mexId : mexRefs) {
MessageExchangeDAO mexDao = _dao.getConnection().getMessageExchange(mexId);
if (mexDao != null) {
@@ -1140,7 +1155,7 @@
}
private void failOutstandingMessageExchanges() {
- String[] mexRefs = _outstandingRequests.releaseAll();
+ String[] mexRefs = _imaManager.releaseAll();
for (String mexId : mexRefs) {
MessageExchangeDAO mexDao = _dao.getConnection().getMessageExchange(mexId);
if (mexDao != null) {
Added: ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/IMAManager.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/IMAManager.java?rev=881749&view=auto
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/IMAManager.java (added)
+++ ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/IMAManager.java Wed Nov 18 12:28:58 2009
@@ -0,0 +1,291 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.ode.bpel.engine;
+
+import org.apache.ode.bpel.runtime.PartnerLinkInstance;
+import org.apache.ode.bpel.runtime.Selector;
+import org.apache.ode.utils.ObjectPrinter;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import javax.wsdl.OperationType;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * <p>
+ * This class handles behaviour of IMAs (Inbound Message Activities) as specified in WS BPEL.
+ * This includes detecting conflictingReceive and conflictingRequest faults.
+ * </p>
+ */
+public class IMAManager implements Serializable {
+ private static final long serialVersionUID = -5556374398943757951L;
+
+ private static final Log __log = LogFactory.getLog(IMAManager.class);
+
+ // holds rid for registered IMAs
+ public final Map<RequestIdTuple, Entry> _byRid = new HashMap<RequestIdTuple, Entry>();
+ // holds outstanding rid that are now waiting to reply (Open IMAs)
+ public final Map<OutstandingRequestIdTuple, String> _byOrid = new HashMap<OutstandingRequestIdTuple, String>();
+ public final Map<String, Entry> _byChannel = new HashMap<String, Entry>();
+
+ /**
+ * finds conflictingReceive
+ *
+ * @param selectors
+ * @return
+ */
+ int findConflict(Selector selectors[]) {
+ if (__log.isTraceEnabled()) {
+ __log.trace(ObjectPrinter.stringifyMethodEnter("findConflict", new Object[] { "selectors", selectors }));
+ }
+
+ Set<RequestIdTuple> workingSet = new HashSet<RequestIdTuple>(_byRid.keySet());
+ for (int i = 0; i < selectors.length; ++i) {
+ final RequestIdTuple rid = new RequestIdTuple(selectors[i].plinkInstance, selectors[i].opName);
+ if (workingSet.contains(rid)) {
+ return i;
+ }
+ workingSet.add(rid);
+ }
+ return -1;
+ }
+
+ /**
+ * Register IMA
+ *
+ * @param pickResponseChannel
+ * response channel associated with this receive/pick
+ * @param selectors
+ * selectors for this receive/pick
+ */
+ void register(String pickResponseChannel, Selector selectors[]) {
+ if (__log.isTraceEnabled()) {
+ __log.trace(ObjectPrinter.stringifyMethodEnter("register", new Object[] { "pickResponseChannel", pickResponseChannel, "selectors", selectors }));
+ }
+
+ if (_byChannel.containsKey(pickResponseChannel)) {
+ String errmsg = "INTERNAL ERROR: Duplicate ENTRY for RESPONSE CHANNEL " + pickResponseChannel;
+ __log.fatal(errmsg);
+ throw new IllegalArgumentException(errmsg);
+ }
+
+ Entry entry = new Entry(pickResponseChannel, selectors);
+ for (int i = 0; i < selectors.length; ++i) {
+ final RequestIdTuple rid = new RequestIdTuple(selectors[i].plinkInstance, selectors[i].opName);
+ if (_byRid.containsKey(rid)) {
+ String errmsg = "INTERNAL ERROR: Duplicate ENTRY for RID " + rid;
+ __log.fatal(errmsg);
+ throw new IllegalStateException(errmsg);
+ }
+ _byRid.put(rid, entry);
+ }
+
+ _byChannel.put(pickResponseChannel, entry);
+ }
+
+ /**
+ * Registers Open IMA.
+ * It doesn't open IMA for non two way operations.
+ *
+ * @param partnerLink
+ * @param opName
+ * @param mexId
+ * @param mexRef
+ * @return
+ */
+ String processOutstandingRequest(PartnerLinkInstance partnerLink, String opName, String mexId, String mexRef) {
+ if (__log.isTraceEnabled()) {
+ __log.trace(ObjectPrinter.stringifyMethodEnter("process", new Object[] { "partnerLinkInstance", partnerLink, "operationName", opName, "messageExchangeId", mexId, "mexRef", mexRef }));
+ }
+ final OutstandingRequestIdTuple orid = new OutstandingRequestIdTuple(partnerLink, opName, mexId);
+ if (_byOrid.containsKey(orid)) {
+ //conflictingRequest found
+ return mexRef;
+ }
+ // We convert into outstanding request only for in-out operations (pending release operation)
+ if (partnerLink.partnerLink.getMyRoleOperation(opName).getStyle().equals(OperationType.REQUEST_RESPONSE)) {
+ _byOrid.put(orid, mexRef);
+ }
+ return null;
+ }
+
+ /**
+ * This is used to remove IMA from registered state.
+ *
+ * @see #register(String, Selector[])
+ * @param pickResponseChannel
+ */
+ void cancel(String pickResponseChannel, boolean isTimer) {
+ if (__log.isTraceEnabled())
+ __log.trace(ObjectPrinter.stringifyMethodEnter("cancel", new Object[] { "pickResponseChannel", pickResponseChannel }));
+
+ Entry entry = _byChannel.remove(pickResponseChannel);
+ if (entry != null) {
+ while (_byRid.values().remove(entry));
+ } else if (!isTimer){
+ String errmsg = "INTERNAL ERROR: No ENTRY for RESPONSE CHANNEL " + pickResponseChannel;
+ __log.fatal(errmsg);
+ throw new IllegalArgumentException(errmsg);
+ }
+ }
+
+ /**
+ * Release Open IMA.
+ *
+ * @param plinkInstnace
+ * partner link
+ * @param opName
+ * operation
+ * @param mexId
+ * message exchange identifier IN THE BPEL SENSE OF THE TERM (i.e. a receive/reply disambiguator).
+ * @return message exchange identifier associated with the registration that matches the parameters
+ */
+ public String release(PartnerLinkInstance plinkInstnace, String opName, String mexId) {
+ if (__log.isTraceEnabled())
+ __log.trace(ObjectPrinter.stringifyMethodEnter("release", new Object[] { "plinkInstance", plinkInstnace, "opName", opName, "mexId", mexId }));
+
+ final OutstandingRequestIdTuple orid = new OutstandingRequestIdTuple(plinkInstnace, opName, mexId);
+ String mexRef = _byOrid.remove(orid);
+ if (mexRef == null) {
+ if (__log.isDebugEnabled()) {
+ __log.debug("==release: ORID " + orid + " not found in " + _byOrid);
+ }
+ return null;
+ }
+ return mexRef;
+ }
+
+ public void migrateRids(Map<OutstandingRequestManager.RequestIdTuple, OutstandingRequestManager.Entry> oldRids) {
+ for (OutstandingRequestManager.RequestIdTuple oldRid : oldRids.keySet()) {
+ OutstandingRequestManager.Entry oldEntry = oldRids.get(oldRid);
+ if (oldEntry.mexRef != null) {
+ //open IMA
+ OutstandingRequestIdTuple orid = new OutstandingRequestIdTuple(oldRid.partnerLink, oldRid.opName, oldRid.mexId);
+ _byOrid.put(orid, oldEntry.mexRef);
+ } else {
+ //registered IMA
+ RequestIdTuple rid = new RequestIdTuple(oldRid.partnerLink, oldRid.opName);
+ Entry entry = new Entry(oldEntry.pickResponseChannel, (Selector[]) oldEntry.selectors);
+ _byRid.put(rid, entry);
+ _byChannel.put(entry.pickResponseChannel, entry);
+ }
+ }
+ }
+
+ /**
+ * "Release" all Open IMAs
+ *
+ * @return a list of message exchange identifiers for message exchanges that were begun (receive/pick got a message) but not yet completed (reply not yet sent)
+ */
+ public String[] releaseAll() {
+ if (__log.isTraceEnabled())
+ __log.trace(ObjectPrinter.stringifyMethodEnter("releaseAll", null));
+
+ ArrayList<String> mexRefs = new ArrayList<String>();
+ while (!_byOrid.isEmpty()) {
+ String mexRef = _byOrid.entrySet().iterator().next().getValue();
+ mexRefs.add(mexRef);
+ _byOrid.values().remove(mexRef);
+ }
+ return mexRefs.toArray(new String[mexRefs.size()]);
+ }
+
+ public String toString() {
+ return ObjectPrinter.toString(this, new Object[] { "byRid", _byRid, "byOrid", _byOrid, "byChannel", _byChannel });
+ }
+
+ private class RequestIdTuple implements Serializable {
+ private static final long serialVersionUID = -1059389611839777482L;
+ /** On which partner link it was received. */
+ PartnerLinkInstance partnerLink;
+ /** Name of the operation. */
+ String opName;
+
+ /** Constructor. */
+ private RequestIdTuple(PartnerLinkInstance partnerLink, String opName) {
+ this.partnerLink = partnerLink;
+ this.opName = opName;
+ }
+
+ public int hashCode() {
+ return this.partnerLink.hashCode() ^ this.opName.hashCode();
+ }
+
+ public boolean equals(Object obj) {
+ RequestIdTuple other = (RequestIdTuple) obj;
+ return other.partnerLink.equals(partnerLink) && other.opName.equals(opName);
+ }
+
+ public String toString() {
+ return ObjectPrinter.toString(this, new Object[] { "partnerLink", partnerLink, "opName", opName});
+ }
+ }
+
+ private class OutstandingRequestIdTuple implements Serializable {
+ private static final long serialVersionUID = -1059389611839777482L;
+ /** On which partner link it was received. */
+ PartnerLinkInstance partnerLink;
+ /** Name of the operation. */
+ String opName;
+ /** Message exchange identifier. */
+ String mexId;
+
+ /** Constructor. */
+ private OutstandingRequestIdTuple(PartnerLinkInstance partnerLink, String opName, String mexId) {
+ this.partnerLink = partnerLink;
+ this.opName = opName;
+ this.mexId = mexId == null ? "" : mexId;
+ }
+
+ public int hashCode() {
+ return this.partnerLink.hashCode() ^ this.opName.hashCode() ^ this.mexId.hashCode();
+ }
+
+ public boolean equals(Object obj) {
+ OutstandingRequestIdTuple other = (OutstandingRequestIdTuple) obj;
+ return other.partnerLink.equals(partnerLink) && other.opName.equals(opName) && other.mexId.equals(mexId);
+ }
+
+ public String toString() {
+ return ObjectPrinter.toString(this, new Object[] { "partnerLink", partnerLink, "opName", opName, "mexId", mexId });
+ }
+ }
+
+ public class Entry implements Serializable {
+ private static final long serialVersionUID = -583743124656582887L;
+ final String pickResponseChannel;
+ public Selector[] selectors;
+
+ private Entry(String pickResponseChannel, Selector[] selectors) {
+ this.pickResponseChannel = pickResponseChannel;
+ this.selectors = selectors;
+ }
+
+ public String toString() {
+ return ObjectPrinter.toString(this, new Object[] { "pickResponseChannel", pickResponseChannel, "selectors", selectors });
+ }
+ }
+}
Propchange: ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/IMAManager.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/OutstandingRequestManager.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/OutstandingRequestManager.java?rev=881749&r1=881748&r2=881749&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/OutstandingRequestManager.java (original)
+++ ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/OutstandingRequestManager.java Wed Nov 18 12:28:58 2009
@@ -24,6 +24,7 @@
import java.io.Serializable;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
@@ -43,6 +44,7 @@
* for asynchronous messages.
* </p>
*/
+@Deprecated
public class OutstandingRequestManager implements Serializable {
private static final long serialVersionUID = -5556374398943757951L;
@@ -211,19 +213,23 @@
"byChannel", _byChannel
});
}
+
+ public Map<RequestIdTuple, Entry> getRids() {
+ return _byRid;
+ }
/**
* Tuple identifying an outstanding request (i.e. a receive,pick, or onMessage on a
* synchronous operation needing a reply).
*/
- private class RequestIdTuple implements Serializable {
+ public class RequestIdTuple implements Serializable {
private static final long serialVersionUID = -1059389611839777482L;
/** On which partner link it was received. */
- PartnerLinkInstance partnerLink;
+ public PartnerLinkInstance partnerLink;
/** Name of the operation. */
- String opName;
+ public String opName;
/** Message exchange identifier. */
- String mexId;
+ public String mexId;
/** Constructor. */
private RequestIdTuple(PartnerLinkInstance partnerLink, String opName, String mexId) {
@@ -254,9 +260,9 @@
public class Entry implements Serializable {
private static final long serialVersionUID = -583743124656582887L;
- final String pickResponseChannel;
+ public final String pickResponseChannel;
public Object[] selectors;
- String mexRef;
+ public String mexRef;
private Entry(String pickResponseChannel, Selector[] selectors) {
this.pickResponseChannel = pickResponseChannel;
Modified: ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/migration/MigrationHandler.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/migration/MigrationHandler.java?rev=881749&r1=881748&r2=881749&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/migration/MigrationHandler.java (original)
+++ ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/migration/MigrationHandler.java Wed Nov 18 12:28:58 2009
@@ -36,7 +36,7 @@
public class MigrationHandler {
private static final Log __log = LogFactory.getLog(MigrationHandler.class);
- public static final int CURRENT_SCHEMA_VERSION = 5;
+ public static final int CURRENT_SCHEMA_VERSION = 6;
private Contexts _contexts;
private List<MigrationLink> migrationLinks = new ArrayList<MigrationLink>() {{
@@ -44,6 +44,7 @@
add(new MigrationLink(2, 3, new Migration[] { new CorrelationKeySetMigration() } ));
add(new MigrationLink(4, 3, new Migration[] { new CorrelationKeySetMigration() } ));
add(new MigrationLink(3, 5, new Migration[] { new CorrelationKeySetDataMigration() } ));
+ add(new MigrationLink(5, 6, new Migration[] { new OutstandingRequestsMigration() } ));
}};
Added: ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/migration/OutstandingRequestsMigration.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/migration/OutstandingRequestsMigration.java?rev=881749&view=auto
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/migration/OutstandingRequestsMigration.java (added)
+++ ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/migration/OutstandingRequestsMigration.java Wed Nov 18 12:28:58 2009
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.bpel.engine.migration;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.ode.bpel.dao.BpelDAOConnection;
+import org.apache.ode.bpel.dao.ProcessDAO;
+import org.apache.ode.bpel.dao.ProcessInstanceDAO;
+import org.apache.ode.bpel.engine.BpelProcess;
+import org.apache.ode.bpel.engine.IMAManager;
+import org.apache.ode.bpel.engine.OutstandingRequestManager;
+import org.apache.ode.jacob.vpu.ExecutionQueueImpl;
+
+/**
+ * Migrates OutstandingRequestManager to IMAManager
+ *
+ */
+public class OutstandingRequestsMigration implements Migration {
+ private static Log __log = LogFactory.getLog(OutstandingRequestsMigration.class);
+
+ public boolean migrate(Set<BpelProcess> registeredProcesses, BpelDAOConnection connection) {
+ boolean migrationResult = true;
+ for (BpelProcess process : registeredProcesses) {
+ ProcessDAO processDao = connection.getProcess(process.getConf().getProcessId());
+ Collection<ProcessInstanceDAO> pis = processDao.getActiveInstances();
+
+ for (ProcessInstanceDAO instance : pis) {
+ __log.debug("Migrating outstanding requests for for instance " + instance.getInstanceId());
+
+ try {
+ ExecutionQueueImpl soup = new ExecutionQueueImpl(this.getClass().getClassLoader());
+ soup.setReplacementMap(process.getReplacementMap(processDao.getProcessId()));
+ soup.read(new ByteArrayInputStream(instance.getExecutionState()));
+ Object data = soup.getGlobalData();
+ if (data instanceof OutstandingRequestManager) {
+ OutstandingRequestManager orm = (OutstandingRequestManager) data;
+
+ IMAManager imaManager = new IMAManager();
+ imaManager.migrateRids(orm.getRids());
+ soup.setGlobalData(imaManager);
+
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
+ soup.write(bos);
+ instance.setExecutionState(bos.toByteArray());
+ __log.debug("Migrated outstanding requests for for instance " + instance.getInstanceId());
+ }
+ } catch (Exception e) {
+ __log.debug("", e);
+ __log.error("Error migrating outstanding requests for for instance " + instance.getInstanceId());
+ migrationResult = false;
+ }
+ }
+ }
+
+ return migrationResult;
+ }
+}
Propchange: ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/migration/OutstandingRequestsMigration.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/replayer/ReplayerBpelRuntimeContextImpl.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/replayer/ReplayerBpelRuntimeContextImpl.java?rev=881749&r1=881748&r2=881749&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/replayer/ReplayerBpelRuntimeContextImpl.java (original)
+++ ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/engine/replayer/ReplayerBpelRuntimeContextImpl.java Wed Nov 18 12:28:58 2009
@@ -180,7 +180,7 @@
@Override
public void reply(PartnerLinkInstance plinkInstnace, String opName, String mexId, Element msg, QName fault) throws FaultException {
- String mexRef = _outstandingRequests.release(plinkInstnace, opName, mexId);
+ String mexRef = _imaManager.release(plinkInstnace, opName, mexId);
if (mexRef == null) {
throw new FaultException(_bpelProcess.getOProcess().constants.qnMissingRequest);
Modified: ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/BpelRuntimeContext.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/BpelRuntimeContext.java?rev=881749&r1=881748&r2=881749&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/BpelRuntimeContext.java (original)
+++ ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/BpelRuntimeContext.java Wed Nov 18 12:28:58 2009
@@ -296,5 +296,7 @@
QName getProcessQName();
+ void processOutstandingRequest(PartnerLinkInstance partnerLink, String opName, String bpelMexId, String odeMexId) throws FaultException;
+
Date getCurrentEventDateTime();
}
Modified: ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/EH_EVENT.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/EH_EVENT.java?rev=881749&r1=881748&r2=881749&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/EH_EVENT.java (original)
+++ ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/EH_EVENT.java Wed Nov 18 12:28:58 2009
@@ -280,6 +280,12 @@
getBpelRuntimeContext().initializePartnersSessionId(ehScopeFrame.resolve(_oevent.partnerLink),
partnersSessionId);
}
+
+ getBpelRuntimeContext().cancelOutstandingRequests(_pickResponseChannel.export());
+ // this request is now waiting for a reply
+ getBpelRuntimeContext().processOutstandingRequest(_scopeFrame.resolve(_oevent.partnerLink),
+ _oevent.operation.getName(), _oevent.messageExchangeId, mexId);
+
} catch (FaultException e) {
__log.error(e);
if (_fault == null) {
@@ -290,8 +296,6 @@
return;
}
-
-
// load 'onMessage' activity; we'll do this even if a stop/terminate has been
// requested becasue we cannot undo the receipt of the message at this point.
ActivityInfo child = new ActivityInfo(genMonotonic(),
Modified: ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PICK.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PICK.java?rev=881749&r1=881748&r2=881749&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PICK.java (original)
+++ ode/branches/APACHE_ODE_1.X/bpel-runtime/src/main/java/org/apache/ode/bpel/runtime/PICK.java Wed Nov 18 12:28:58 2009
@@ -296,10 +296,7 @@
dpe(_alarm.activity);
}
- if (_opick.onMessages.size() > 1 && onMessage.operation.getOutput() == null) {
- // Releasing other onMessage that could be two-ways with an oustanding request
- getBpelRuntimeContext().cancelOutstandingRequests(_pickResponseChannel.export());
- }
+ getBpelRuntimeContext().cancelOutstandingRequests(_pickResponseChannel.export());
FaultData fault;
initVariable(mexId, onMessage);
@@ -336,6 +333,10 @@
_scopeFrame.resolve(onMessage.partnerLink), partnersSessionId);
}
+ // this request is now waiting for a reply
+ getBpelRuntimeContext().processOutstandingRequest(_scopeFrame.resolve(onMessage.partnerLink),
+ onMessage.operation.getName(), onMessage.messageExchangeId, mexId);
+
} catch (FaultException e) {
__log.error(e);
fault = createFault(e.getQName(), onMessage);
@@ -344,6 +345,7 @@
return;
}
+
// load 'onMessage' activity
// Because we are done with all the DPE, we can simply
// re-use our control
Modified: ode/branches/APACHE_ODE_1.X/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/CoreBpelTest.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/CoreBpelTest.java?rev=881749&r1=881748&r2=881749&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/CoreBpelTest.java (original)
+++ ode/branches/APACHE_ODE_1.X/bpel-runtime/src/test/java/org/apache/ode/bpel/runtime/CoreBpelTest.java Wed Nov 18 12:28:58 2009
@@ -457,4 +457,9 @@
// TODO Auto-generated method stub
return null;
}
+
+ public void processOutstandingRequest(PartnerLinkInstance partnerLink,
+ String opName, String mexId, String mexRef) {
+ // TODO Auto-generated method stub
+ }
}
Modified: ode/branches/APACHE_ODE_1.X/bpel-test/src/main/java/org/apache/ode/test/BPELTestAbstract.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-test/src/main/java/org/apache/ode/test/BPELTestAbstract.java?rev=881749&r1=881748&r2=881749&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-test/src/main/java/org/apache/ode/test/BPELTestAbstract.java (original)
+++ ode/branches/APACHE_ODE_1.X/bpel-test/src/main/java/org/apache/ode/test/BPELTestAbstract.java Wed Nov 18 12:28:58 2009
@@ -234,11 +234,14 @@
final QName serviceId = new QName(testProps.getProperty("namespace"), testProps.getProperty("service"));
final String operation = testProps.getProperty("operation");
+ Boolean sequential = Boolean.parseBoolean(testProps.getProperty("sequential", "false"));
+
+ Invocation last = null;
for (int i = 1; testProps.getProperty("request" + i) != null; i++) {
final String in = testProps.getProperty("request" + i);
final String responsePattern = testProps.getProperty("response" + i);
- addInvoke(testPropsFile + "#" + i, serviceId, operation, in, responsePattern);
+ last = addInvoke(testPropsFile + "#" + i, serviceId, operation, in, responsePattern, sequential ? last : null);
}
propsFileCnt++;
testPropsFile = new File(deployDir, "test" + propsFileCnt + ".properties");
@@ -246,8 +249,13 @@
}
protected Invocation addInvoke(String id, QName target, String operation, String request, String responsePattern) throws Exception {
+ return addInvoke(id, target, operation, request, responsePattern, null);
+ }
+
+ protected Invocation addInvoke(String id, QName target, String operation, String request, String responsePattern, Invocation synchronizeWith)
+ throws Exception {
- Invocation inv = new Invocation(id);
+ Invocation inv = new Invocation(id, synchronizeWith);
inv.target = target;
inv.operation = operation;
inv.request = DOMUtils.stringToDOM(request);
@@ -486,6 +494,12 @@
/** Identifier (for reporting). */
public String id;
+ /** for sync invocations */
+ public Invocation synchronizeWith;
+
+ /** checking completion */
+ public boolean done = false;
+
/** Name of the operation to invoke. */
public String operation;
@@ -528,8 +542,9 @@
QName requestType;
- public Invocation(String id) {
+ public Invocation(String id, Invocation synchronizeWith) {
this.id = id;
+ this.synchronizeWith = synchronizeWith;
}
public String toString() {
@@ -546,6 +561,17 @@
}
public void run() {
+ try {
+ run2();
+ } finally {
+ synchronized (_invocation) {
+ _invocation.done = true;
+ _invocation.notify();
+ }
+ }
+ }
+
+ public void run2() {
final MyRoleMessageExchange mex;
final Future<MessageExchange.Status> running;
@@ -554,6 +580,19 @@
Thread.sleep(_invocation.invokeDelayMs);
} catch (Exception ex) {
}
+
+ if (_invocation.synchronizeWith != null) {
+ synchronized (_invocation.synchronizeWith) {
+ while (!_invocation.synchronizeWith.done) {
+ try {
+ _invocation.synchronizeWith.wait(_invocation.maximumWaitMs);
+ } catch (InterruptedException e) {
+ failure(_invocation, "timed out waiting in sequence", e);
+ return;
+ }
+ }
+ }
+ }
scheduler.beginTransaction();
try {
Modified: ode/branches/APACHE_ODE_1.X/bpel-test/src/test/java/org/apache/ode/test/MessageRouting20Test.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-test/src/test/java/org/apache/ode/test/MessageRouting20Test.java?rev=881749&r1=881748&r2=881749&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-test/src/test/java/org/apache/ode/test/MessageRouting20Test.java (original)
+++ ode/branches/APACHE_ODE_1.X/bpel-test/src/test/java/org/apache/ode/test/MessageRouting20Test.java Wed Nov 18 12:28:58 2009
@@ -127,5 +127,8 @@
@Test public void testConcurrentSyncMex() throws Throwable {
go("/bpel/2.0/TestConcurrentSyncMex");
}
-
+
+ @Test public void testIMA() throws Throwable {
+ go("/bpel/2.0/TestIMA");
+ }
}
Added: ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/TestIMA.bpel
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/TestIMA.bpel?rev=881749&view=auto
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/TestIMA.bpel (added)
+++ ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/TestIMA.bpel Wed Nov 18 12:28:58 2009
@@ -0,0 +1,211 @@
+<!--
+ ~ 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.
+-->
+
+<bpel:process name="TestIMAProcess" targetNamespace="http://ode/bpel/unit-test/TestIMA" suppressJoinFailure="yes" xmlns:tns="http://ode/bpel/unit-test/TestIMA" xmlns:wns="http://ode/bpel/unit-test/TestIMA.wsdl" xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://docs.oasis-open.org/wsbpel/2.0/process/executable /usr/share/bpel-schema/ws-bpel_executable.xsd">
+ <bpel:import location="TestIMA.wsdl" namespace="http://ode/bpel/unit-test/TestIMA.wsdl" importType="http://schemas.xmlsoap.org/wsdl/" />
+ <bpel:partnerLinks>
+ <bpel:partnerLink name="client" partnerLinkType="wns:TestIMAPL" myRole="TestIMAProvider" partnerRole="TestIMAProvider"/>
+ </bpel:partnerLinks>
+ <bpel:variables>
+ <bpel:variable name="input" messageType="wns:TestIMAMessage" />
+ <bpel:variable name="output" messageType="wns:TestIMAMessage" />
+ </bpel:variables>
+ <bpel:correlationSets>
+ <bpel:correlationSet name="CorrelationSet" properties="wns:input"></bpel:correlationSet>
+ </bpel:correlationSets>
+ <bpel:sequence>
+ <bpel:receive partnerLink="client" portType="wns:TestIMA" operation="process" variable="input" createInstance="yes">
+ <bpel:correlations>
+ <bpel:correlation set="CorrelationSet" initiate="yes"></bpel:correlation>
+ </bpel:correlations>
+ </bpel:receive>
+
+ <bpel:scope name="ConflictingReceiveInOnly">
+ <bpel:faultHandlers>
+ <bpel:catch faultName="bpel:conflictingReceive">
+ <bpel:empty/>
+ </bpel:catch>
+ </bpel:faultHandlers>
+ <bpel:sequence>
+ <bpel:flow>
+ <bpel:receive partnerLink="client" operation="inOnly" variable="input">
+ <bpel:correlations>
+ <bpel:correlation set="CorrelationSet" initiate="no"></bpel:correlation>
+ </bpel:correlations>
+ </bpel:receive>
+ <bpel:receive partnerLink="client" operation="inOnly" variable="input">
+ <bpel:correlations>
+ <bpel:correlation set="CorrelationSet" initiate="no"></bpel:correlation>
+ </bpel:correlations>
+ </bpel:receive>
+ </bpel:flow>
+ <bpel:throw faultName="error"/>
+ </bpel:sequence>
+ </bpel:scope>
+
+ <bpel:scope name="ConflictingReceiveInOut">
+ <bpel:faultHandlers>
+ <bpel:catch faultName="bpel:conflictingReceive">
+ <bpel:empty/>
+ </bpel:catch>
+ </bpel:faultHandlers>
+ <bpel:sequence>
+ <bpel:flow>
+ <bpel:receive partnerLink="client" operation="inOut" variable="input">
+ <bpel:correlations>
+ <bpel:correlation set="CorrelationSet" initiate="no"></bpel:correlation>
+ </bpel:correlations>
+ </bpel:receive>
+ <bpel:receive partnerLink="client" operation="inOut" variable="input">
+ <bpel:correlations>
+ <bpel:correlation set="CorrelationSet" initiate="no"></bpel:correlation>
+ </bpel:correlations>
+ </bpel:receive>
+ </bpel:flow>
+ <bpel:throw faultName="error"/>
+ </bpel:sequence>
+ </bpel:scope>
+
+ <bpel:scope name="ConflictingReceiveInOutTwoMexes">
+ <bpel:faultHandlers>
+ <bpel:catch faultName="bpel:conflictingReceive">
+ <bpel:empty/>
+ </bpel:catch>
+ </bpel:faultHandlers>
+ <bpel:sequence>
+ <bpel:flow>
+ <bpel:receive partnerLink="client" operation="inOut" variable="input" messageExchange="mex1">
+ <bpel:correlations>
+ <bpel:correlation set="CorrelationSet" initiate="no"></bpel:correlation>
+ </bpel:correlations>
+ </bpel:receive>
+ <bpel:receive partnerLink="client" operation="inOut" variable="input" messageExchange="mex2">
+ <bpel:correlations>
+ <bpel:correlation set="CorrelationSet" initiate="no"></bpel:correlation>
+ </bpel:correlations>
+ </bpel:receive>
+ </bpel:flow>
+ <bpel:throw faultName="error"/>
+ </bpel:sequence>
+ </bpel:scope>
+
+ <!--
+ ~ This is correct path example, because it relies on sequential operations for the same mex1.
+ ~ No conflictingRequest is thrown here.
+ -->
+ <bpel:scope name="NoConflictingRequest">
+ <bpel:sequence>
+ <bpel:receive partnerLink="client" operation="inOut2" variable="input" messageExchange="mex1">
+ <bpel:correlations>
+ <bpel:correlation set="CorrelationSet" initiate="no"></bpel:correlation>
+ </bpel:correlations>
+ </bpel:receive>
+ <bpel:flow>
+ <bpel:sequence>
+ <bpel:wait>
+ <!-- We need a constraint of executing following reply in new job in order to register concurrent receive before reply -->
+ <bpel:for>'PT1S'</bpel:for>
+ </bpel:wait>
+ <bpel:reply partnerLink="client" portType="wns:TestIMA" operation="inOut2" variable="input" messageExchange="mex1" />
+ </bpel:sequence>
+ <bpel:sequence>
+ <bpel:receive partnerLink="client" operation="inOut2" variable="input" messageExchange="mex1">
+ <bpel:correlations>
+ <bpel:correlation set="CorrelationSet" initiate="no"></bpel:correlation>
+ </bpel:correlations>
+ </bpel:receive>
+ <bpel:reply partnerLink="client" portType="wns:TestIMA" operation="inOut2" variable="input" messageExchange="mex1" />
+ </bpel:sequence>
+ </bpel:flow>
+ </bpel:sequence>
+ </bpel:scope>
+
+ <bpel:scope name="ConflictingRequest">
+ <bpel:sequence>
+ <bpel:receive partnerLink="client" operation="inOut3" variable="input" messageExchange="mex1">
+ <bpel:correlations>
+ <bpel:correlation set="CorrelationSet" initiate="no"></bpel:correlation>
+ </bpel:correlations>
+ </bpel:receive>
+ <bpel:flow>
+ <bpel:scope xmlns:ext="http://ode.apache.org/activityRecovery">
+ <bpel:faultHandlers>
+ <bpel:catch faultName="ext:activityFailure">
+ <bpel:empty/>
+ </bpel:catch>
+ </bpel:faultHandlers>
+ <bpel:sequence>
+ <bpel:invoke operation="inOut3" partnerLink="client" inputVariable="input" outputVariable="output">
+ <ext:failureHandling>
+ <ext:faultOnFailure>true</ext:faultOnFailure>
+ </ext:failureHandling>
+ </bpel:invoke>
+ <bpel:throw faultName="error"></bpel:throw>
+ </bpel:sequence>
+ </bpel:scope>
+ <bpel:scope>
+ <bpel:faultHandlers>
+ <bpel:catch faultName="bpel:conflictingRequest">
+ <bpel:empty/>
+ </bpel:catch>
+ </bpel:faultHandlers>
+ <bpel:sequence>
+ <bpel:receive operation="inOut3" partnerLink="client" variable="input" messageExchange="mex1">
+ <bpel:correlations>
+ <bpel:correlation set="CorrelationSet" initiate="no"></bpel:correlation>
+ </bpel:correlations>
+ </bpel:receive>
+ <bpel:throw faultName="error"></bpel:throw>
+ </bpel:sequence>
+ </bpel:scope>
+ </bpel:flow>
+ <bpel:reply operation="inOut3" partnerLink="client" variable="input" messageExchange="mex1"/>
+
+ <bpel:receive partnerLink="client" operation="inOut3" variable="input" messageExchange="mex1">
+ <bpel:correlations>
+ <bpel:correlation set="CorrelationSet" initiate="no"></bpel:correlation>
+ </bpel:correlations>
+ </bpel:receive>
+ <bpel:reply operation="inOut3" partnerLink="client" variable="input" messageExchange="mex1"/>
+ </bpel:sequence>
+ </bpel:scope>
+
+ <bpel:scope name="TwoMexesInOut">
+ <bpel:sequence>
+ <bpel:receive partnerLink="client" operation="inOut4" variable="input" messageExchange="mex2">
+ <bpel:correlations>
+ <bpel:correlation set="CorrelationSet" initiate="no"></bpel:correlation>
+ </bpel:correlations>
+ </bpel:receive>
+
+ <bpel:receive partnerLink="client" operation="inOut4" variable="input" messageExchange="mex3">
+ <bpel:correlations>
+ <bpel:correlation set="CorrelationSet" initiate="no"></bpel:correlation>
+ </bpel:correlations>
+ </bpel:receive>
+
+ <bpel:reply partnerLink="client" portType="wns:TestIMA" operation="inOut4" variable="input" messageExchange="mex2" />
+ <bpel:reply partnerLink="client" portType="wns:TestIMA" operation="inOut4" variable="input" messageExchange="mex3" />
+ </bpel:sequence>
+ </bpel:scope>
+
+ <bpel:reply partnerLink="client" portType="wns:TestIMA" operation="process" variable="input" />
+ </bpel:sequence>
+</bpel:process>
+
Added: ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/TestIMA.wsdl
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/TestIMA.wsdl?rev=881749&view=auto
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/TestIMA.wsdl (added)
+++ ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/TestIMA.wsdl Wed Nov 18 12:28:58 2009
@@ -0,0 +1,70 @@
+<?xml version="1.0"?>
+<!--
+ ~ 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.
+-->
+<definitions name="TestIMA"
+ targetNamespace="http://ode/bpel/unit-test/TestIMA.wsdl"
+ xmlns:tns="http://ode/bpel/unit-test/TestIMA.wsdl"
+ xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:vprop="http://docs.oasis-open.org/wsbpel/2.0/varprop"
+ >
+
+ <message name="TestIMAMessage">
+ <part name="payload" type="xsd:string"/>
+ <part name="value" type="xsd:string"/>
+ </message>
+
+ <portType name="TestIMA">
+ <operation name="process">
+ <input message="tns:TestIMAMessage" />
+ <output message="tns:TestIMAMessage"/>
+ </operation>
+ <operation name="complete">
+ <input message="tns:TestIMAMessage" />
+ <output message="tns:TestIMAMessage"/>
+ </operation>
+ <operation name="inOnly">
+ <input message="tns:TestIMAMessage"></input>
+ </operation>
+ <operation name="inOut">
+ <input message="tns:TestIMAMessage"></input>
+ <output message="tns:TestIMAMessage"></output>
+ </operation>
+ <operation name="inOut2">
+ <input message="tns:TestIMAMessage"></input>
+ <output message="tns:TestIMAMessage"></output>
+ </operation>
+ <operation name="inOut3">
+ <input message="tns:TestIMAMessage"></input>
+ <output message="tns:TestIMAMessage"></output>
+ </operation>
+ <operation name="inOut4">
+ <input message="tns:TestIMAMessage"></input>
+ <output message="tns:TestIMAMessage"></output>
+ </operation>
+ </portType>
+
+ <plnk:partnerLinkType name="TestIMAPL">
+ <plnk:role name="TestIMAProvider" portType="tns:TestIMA"/>
+ </plnk:partnerLinkType>
+ <vprop:property name="input" type="xsd:string"/>
+ <vprop:propertyAlias propertyName="tns:input" messageType="tns:TestIMAMessage" part="payload" type="xsd:string"/>
+</definitions>
Added: ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/deploy.xml
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/deploy.xml?rev=881749&view=auto
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/deploy.xml (added)
+++ ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/deploy.xml Wed Nov 18 12:28:58 2009
@@ -0,0 +1,33 @@
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+-->
+
+<deploy xmlns="http://www.apache.org/ode/schemas/dd/2007/03"
+ xmlns:pns="http://ode/bpel/unit-test/TestIMA"
+ xmlns:wns="http://ode/bpel/unit-test/TestIMA.wsdl">
+
+ <process name="pns:TestIMAProcess">
+ <active>true</active>
+ <provide partnerLink="client">
+ <service name="wns:TestIMAService" port="wns:TestIMAPort"/>
+ </provide>
+ <invoke partnerLink="client">
+ <service name="wns:TestIMAService" port="wns:TestIMAPort"/>
+ </invoke>
+ </process>
+</deploy>
Propchange: ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/deploy.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/test1.properties
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/test1.properties?rev=881749&view=auto
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/test1.properties (added)
+++ ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/test1.properties Wed Nov 18 12:28:58 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://ode/bpel/unit-test/TestIMA.wsdl
+service=TestIMAService
+operation=process
+request1=<message><payload>test</payload><value>process</value></message>
+response1=.*
Propchange: ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/test1.properties
------------------------------------------------------------------------------
svn:eol-style = native
Added: ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/test2.properties
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/test2.properties?rev=881749&view=auto
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/test2.properties (added)
+++ ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/test2.properties Wed Nov 18 12:28:58 2009
@@ -0,0 +1,27 @@
+#
+# 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.
+#
+
+#NoConflictingRequestInOut
+sequential=true
+namespace=http://ode/bpel/unit-test/TestIMA.wsdl
+service=TestIMAService
+operation=inOut2
+request1=<message><payload>test</payload><value>NoConflictingRequestInOut1</value></message>
+response1=.*
+request2=<message><payload>test</payload><value>NoConflictingRequestInOut2</value></message>
+response2=.*
+
Propchange: ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/test2.properties
------------------------------------------------------------------------------
svn:eol-style = native
Added: ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/test3.properties
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/test3.properties?rev=881749&view=auto
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/test3.properties (added)
+++ ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/test3.properties Wed Nov 18 12:28:58 2009
@@ -0,0 +1,26 @@
+#
+# 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.
+#
+
+#ConflictingRequest
+sequential=true
+namespace=http://ode/bpel/unit-test/TestIMA.wsdl
+service=TestIMAService
+operation=inOut3
+request1=<message><payload>test</payload><value>ConflictingRequest1</value></message>
+response1=.*
+request2=<message><payload>test</payload><value>ConflictingRequest1</value></message>
+response2=.*
Propchange: ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/test3.properties
------------------------------------------------------------------------------
svn:eol-style = native
Added: ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/test4.properties
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/test4.properties?rev=881749&view=auto
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/test4.properties (added)
+++ ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/test4.properties Wed Nov 18 12:28:58 2009
@@ -0,0 +1,26 @@
+#
+# 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.
+#
+
+#TwoMexesInOut
+sequential=false
+namespace=http://ode/bpel/unit-test/TestIMA.wsdl
+service=TestIMAService
+operation=inOut4
+request1=<message><payload>test</payload><value>TwoMexesInOut1</value></message>
+response1=.*
+request2=<message><payload>test</payload><value>TwoMexesInOut2</value></message>
+response2=.*
Propchange: ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/bpel/2.0/TestIMA/test4.properties
------------------------------------------------------------------------------
svn:eol-style = native
Modified: ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/log4j.properties?rev=881749&r1=881748&r2=881749&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/log4j.properties (original)
+++ ode/branches/APACHE_ODE_1.X/bpel-test/src/test/resources/log4j.properties Wed Nov 18 12:28:58 2009
@@ -27,12 +27,14 @@
log4j.category.org.apache.ode.bpel.epr=INFO
log4j.category.org.apache.ode.bpel.extvar.jdbc=DEBUG
log4j.category.org.apache.ode.bpel.runtime=DEBUG
+log4j.category.org.apache.ode=DEBUG
log4j.category.org.apache.ode.daohib.bpel.CorrelatorDaoImpl=DEBUG
+log4j.category.org.apache.ode.bpel.engine.OutstandingRequestManager=TRACE
# Console appender
-log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
-log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
-log4j.appender.CONSOLE.layout.ConversionPattern=%p - %C{1}.%M(%L) | %m%n
+#log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+#log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+#log4j.appender.CONSOLE.layout.ConversionPattern=%p - %C{1}.%M(%L) | %m%n
log4j.appender.FILE=org.apache.log4j.FileAppender
log4j.appender.FILE.File=target/bpel-test.log