diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2008-12-17 14:35:59 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2008-12-17 14:35:59 +0000 |
commit | e932b4b558015ee1e771321786666cf1b3be5361 (patch) | |
tree | d476d776985f7870b65b13cf5abbf0ef5ebb5a0e /branches/sca-java-1.x/modules/implementation-bpel-ode/src/main | |
parent | 507dbf9a94c049f983fa28ccae5ed22add21ea5d (diff) |
Allow for multiple references from a BPEL script.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@727399 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.x/modules/implementation-bpel-ode/src/main')
2 files changed, 21 insertions, 3 deletions
diff --git a/branches/sca-java-1.x/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEExternalService.java b/branches/sca-java-1.x/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEExternalService.java index 15e9229601..6ce6a727af 100644 --- a/branches/sca-java-1.x/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEExternalService.java +++ b/branches/sca-java-1.x/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/ODEExternalService.java @@ -30,11 +30,13 @@ import org.apache.ode.bpel.iapi.MessageExchange; import org.apache.ode.bpel.iapi.PartnerRoleMessageExchange; import org.apache.ode.bpel.iapi.Scheduler; import org.apache.ode.utils.DOMUtils; +import org.apache.tuscany.sca.assembly.ComponentReference; import org.apache.tuscany.sca.interfacedef.Operation; import org.apache.tuscany.sca.interfacedef.wsdl.WSDLInterface; import org.apache.tuscany.sca.runtime.RuntimeComponent; import org.apache.tuscany.sca.runtime.RuntimeComponentReference; import org.apache.tuscany.sca.runtime.RuntimeWire; +import org.osoa.sca.ServiceRuntimeException; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -86,8 +88,21 @@ public class ODEExternalService { TuscanyPRC channel = (TuscanyPRC) partnerRoleMessageExchange.getChannel(); RuntimeComponent tuscanyRuntimeComponent = _server.getTuscanyRuntimeComponent(channel.getProcessName()); - RuntimeComponentReference runtimeComponentReference = - (RuntimeComponentReference)tuscanyRuntimeComponent.getReferences().get(0); + // get the right reference based on the partner link name + String referenceName = channel.getEndpoint().serviceName.getLocalPart(); + RuntimeComponentReference runtimeComponentReference = null; + + for (ComponentReference reference : tuscanyRuntimeComponent.getReferences()){ + if (reference.getName().equals(referenceName)){ + runtimeComponentReference = (RuntimeComponentReference)reference; + break; + } + } + + if (runtimeComponentReference == null){ + throw new ServiceRuntimeException("Can't find component reference for partner link " + referenceName); + } + RuntimeWire runtimeWire = runtimeComponentReference.getRuntimeWire(runtimeComponentReference.getBindings().get(0)); @@ -95,7 +110,6 @@ public class ODEExternalService { Operation operation = findOperation(partnerRoleMessageExchange.getOperation().getName(), runtimeComponentReference); - /* This is how a request looks like (payload is wrapped with extra info) <?xml version="1.0" encoding="UTF-8"?> diff --git a/branches/sca-java-1.x/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/TuscanyPRC.java b/branches/sca-java-1.x/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/TuscanyPRC.java index 8f8f608217..c2c16a24ca 100644 --- a/branches/sca-java-1.x/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/TuscanyPRC.java +++ b/branches/sca-java-1.x/modules/implementation-bpel-ode/src/main/java/org/apache/tuscany/sca/implementation/bpel/ode/TuscanyPRC.java @@ -50,6 +50,10 @@ public class TuscanyPRC implements PartnerRoleChannel { public QName getProcessName() { return this.processName; } + + public Endpoint getEndpoint() { + return endpoint; + } public void close() { |