Author: objectiser
Date: 2011-01-24 10:50:17 -0500 (Mon, 24 Jan 2011)
New Revision: 615
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/generator/GeneratorTest.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/parser/ParserTest.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ESBBroker(a)Broker.bpel
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ESBBroker(a)Buyer.bpel
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ESBBroker(a)CreditAgency.bpel
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ESBBroker(a)Supplier.bpel
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ESBBroker(a)SupplierQuoteEngine.bpel
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ESBBroker(a)SupplierTxnProcessor.bpel
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/PurchaseGoods(a)Buyer.bpel
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/PurchaseGoods(a)CreditAgency.bpel
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/PurchaseGoods(a)Store.bpel
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ReqRespFault(a)Buyer.bpel
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ReqRespFault(a)Seller.bpel
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/ESBBroker(a)Broker.spr
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/ESBBroker(a)Buyer.spr
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/ESBBroker(a)CreditAgency.spr
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/ESBBroker(a)SupplierQuoteEngine.spr
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/ESBBroker(a)SupplierTxnProcessor.spr
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/LoanApprovalService(a)Service.scv
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/PurchaseGoods(a)Buyer.spr
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/PurchaseGoods(a)CreditAgency.spr
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/PurchaseGoods(a)Store.spr
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/ReqRespFault(a)Buyer.spr
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/ReqRespFault(a)Seller.spr
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/CompleteTransaction_SupplierTxnProcessor.bpel
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/ESBBrokerProcess_Broker.bpel
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/ESBBrokerProcess_Buyer.bpel
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/ESBBrokerProcess_CreditAgency.bpel
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/LoanApprovalService(a)Service.bpel
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/PurchaseGoodsProcess_Buyer.bpel
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/PurchaseGoodsProcess_CreditAgency.bpel
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/PurchaseGoodsProcess_Store.bpel
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/ReqRespFaultProcess_Buyer.bpel
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/ReqRespFaultProcess_Seller.bpel
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/RequestForQuote_SupplierQuoteEngine.bpel
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/protocol/
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/protocol/ESBBroker.spr
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/protocol/PurchaseGoods.spr
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/protocol/ReqRespFault.spr
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/CompleteTransaction_SupplierTxnProcessor.wsdl
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/CompleteTransaction_SupplierTxnProcessorArtifacts.wsdl
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/ESBBrokerProcess_Broker.wsdl
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/ESBBrokerProcess_BrokerArtifacts.wsdl
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/ESBBrokerProcess_BuyerArtifacts.wsdl
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/ESBBrokerProcess_CreditAgency.wsdl
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/ESBBrokerProcess_CreditAgencyArtifacts.wsdl
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/ESBBrokerProcess_Supplier.wsdl
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/PurchaseGoodsProcess_BuyerArtifacts.wsdl
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/PurchaseGoodsProcess_CreditAgency.wsdl
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/PurchaseGoodsProcess_CreditAgencyArtifacts.wsdl
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/PurchaseGoodsProcess_Store.wsdl
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/PurchaseGoodsProcess_StoreArtifacts.wsdl
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/ReqRespFaultProcess_BuyerArtifacts.wsdl
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/ReqRespFaultProcess_Seller.wsdl
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/ReqRespFaultProcess_SellerArtifacts.wsdl
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/RequestForQuote_SupplierQuoteEngine.wsdl
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/RequestForQuote_SupplierQuoteEngineArtifacts.wsdl
branches/experimental/2.0.x/bundles/org.savara.common/src/main/java/org/savara/common/model/annotation/
branches/experimental/2.0.x/bundles/org.savara.common/src/main/java/org/savara/common/model/annotation/Annotation.java
branches/experimental/2.0.x/bundles/org.savara.common/src/main/java/org/savara/common/model/annotation/AnnotationDefinitions.java
branches/experimental/2.0.x/bundles/org.savara.protocol/src/test/
branches/experimental/2.0.x/bundles/org.savara.protocol/src/test/java/
branches/experimental/2.0.x/bundles/org.savara.protocol/src/test/java/org/
branches/experimental/2.0.x/bundles/org.savara.protocol/src/test/java/org/savara/
branches/experimental/2.0.x/bundles/org.savara.protocol/src/test/java/org/savara/protocol/
branches/experimental/2.0.x/bundles/org.savara.protocol/src/test/java/org/savara/protocol/parser/
branches/experimental/2.0.x/bundles/org.savara.protocol/src/test/java/org/savara/protocol/parser/AnnotationProcessorTest.java
Removed:
branches/experimental/2.0.x/bundles/org.savara.bundles.tests/src/test/resources/bpel/generator/results/ESBBroker(a)Supplier.bpel
branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/generator/Messages.properties
branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/model/annotation/Annotation.java
branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/model/util/AnnotationDefinitions.java
Modified:
branches/experimental/2.0.x/bundles/org.savara.bpel/META-INF/MANIFEST.MF
branches/experimental/2.0.x/bundles/org.savara.bpel/pom.xml
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/ProtocolToBPELModelGenerator.java
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/InteractionModelChangeRule.java
branches/experimental/2.0.x/bundles/org.savara.bundles.tests/src/test/java/org/savara/bundles/tests/bpel/generator/GeneratorTest.java
branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/generator/impl/ContractIntrospector.java
branches/experimental/2.0.x/bundles/org.savara.contract/src/test/java/org/savara/contract/generator/impl/ContractIntrospectorTest.java
branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ChoiceConverterRuleImpl.java
branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ConditionalConverterRuleImpl.java
branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ConverterUtil.java
branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/InteractionConverterRuleImpl.java
branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ProtocolModelConverterRuleImpl.java
branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/resources/results/protocol/ESBBroker.spr
branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/resources/results/protocol/PurchaseGoods.spr
branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/resources/results/protocol/ReqRespFault.spr
branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/export/text/TextProtocolExporter.java
branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/model/util/InteractionUtil.java
branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/model/util/PropertyName.java
branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/parser/AnnotationProcessor.java
branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/impl/WSDLGeneratorImpl.java
branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/java/org/savara/wsdl/generator/WSDLGeneratorTest.java
Log:
Changing to use annotations for storing additional required information, and moving some
tests from the bundles.test plugin into the relevant plugins. Still issue generating bpel
from the protocol+annotations, so currently commented them out. The problem appears to be
based on deriving the contracts from a local model, rather than the CDL basd global model,
so need to understand the differences.
Modified: branches/experimental/2.0.x/bundles/org.savara.bpel/META-INF/MANIFEST.MF
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/META-INF/MANIFEST.MF 2011-01-24
13:49:12 UTC (rev 614)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/META-INF/MANIFEST.MF 2011-01-24
15:50:17 UTC (rev 615)
@@ -16,7 +16,8 @@
org.scribble.protocol,
org.scribble.protocol.parser,
org.savara.pi4soa.cdm;resolution:=optional,
- org.savara.protocol
+ org.savara.protocol,
+ org.scribble.protocol.projection
Export-Package: org.savara.bpel.generator,
org.savara.bpel.model,
org.savara.bpel.model.change,
Modified: branches/experimental/2.0.x/bundles/org.savara.bpel/pom.xml
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/pom.xml 2011-01-24 13:49:12 UTC
(rev 614)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/pom.xml 2011-01-24 15:50:17 UTC
(rev 615)
@@ -30,6 +30,11 @@
<version>${scribble.version}</version>
</dependency>
<dependency>
+ <groupId>org.scribble.bundles</groupId>
+ <artifactId>org.scribble.protocol.projection</artifactId>
+ <version>${scribble.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.savara.bundles</groupId>
<artifactId>org.savara.common</artifactId>
<version>${savara.version}</version>
Modified:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/ProtocolToBPELModelGenerator.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/ProtocolToBPELModelGenerator.java 2011-01-24
13:49:12 UTC (rev 614)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/generator/ProtocolToBPELModelGenerator.java 2011-01-24
15:50:17 UTC (rev 615)
@@ -23,6 +23,8 @@
import org.savara.bpel.model.TProcess;
import org.savara.bpel.model.change.BPELModelChangeContext;
import org.savara.common.model.generator.ModelGenerator;
+import org.savara.contract.generator.ContractGenerator;
+import org.savara.contract.generator.ContractGeneratorFactory;
import org.scribble.common.resource.ResourceLocator;
import org.scribble.common.logging.CachedJournal;
import org.scribble.common.logging.Journal;
@@ -45,6 +47,16 @@
new BPELModelChangeContext(null, new CachedJournal());
ProtocolModel pm=(ProtocolModel)source;
+ /* TODO: Need to sort out contract generation from a local model
+ *
+ *
+ // Derive contracts associated with the protocol model
+ ContractGenerator cg=ContractGeneratorFactory.getContractGenerator();
+ if (cg != null) {
+ cg.generate(pm, context.getJournal(), context.getProtocolContext());
+ }
+ */
+
// Create BPEL model
TProcess bpel=new TProcess();
Modified:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/InteractionModelChangeRule.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/InteractionModelChangeRule.java 2011-01-24
13:49:12 UTC (rev 614)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/InteractionModelChangeRule.java 2011-01-24
15:50:17 UTC (rev 615)
@@ -35,6 +35,8 @@
import org.savara.bpel.util.VariableUtil;
import org.savara.protocol.model.change.ModelChangeContext;
import org.savara.protocol.model.util.InteractionUtil;
+import org.savara.common.model.annotation.Annotation;
+import org.savara.common.model.annotation.AnnotationDefinitions;
import org.savara.contract.model.Contract;
import org.savara.contract.model.Interface;
import org.savara.wsdl.util.WSDLGeneratorUtil;
@@ -45,8 +47,6 @@
*/
public class InteractionModelChangeRule extends AbstractBPELModelChangeRule {
- private static final String INTERFACE_NAME = "interfaceName";
-
/**
* This method determines whether the rule is appropriate
* for the supplied type of model, parent (in the context) and inserted
@@ -167,9 +167,12 @@
if (roleType != null) {
//contract = ModelChangeUtils.getContract(context, roleType);
- if (contract != null) {
- if (interaction.getProperties().containsKey(INTERFACE_NAME)) {
- String intfName=(String)interaction.getProperties().get(INTERFACE_NAME);
+ if (contract != null) {
+ /*
+ Annotation annotation=null;
+ if ((annotation=AnnotationDefinitions.getAnnotation(interaction.getProperties(),
+ AnnotationDefinitions.INTERFACE)) != null) {
+ String
intfName=(String)annotation.getProperties().get(AnnotationDefinitions.NAME_PROPERTY);
intf = contract.getInterface(intfName);
if (intf == null) {
@@ -177,7 +180,7 @@
javax.xml.namespace.QName qname=javax.xml.namespace.QName.valueOf(intfName);
intf = contract.getInterface(qname.getLocalPart());
}
- } else if (contract.getInterfaces().size() > 0) {
+ } else*/ if (contract.getInterfaces().size() > 0) {
intf = contract.getInterfaces().iterator().next();
}
}
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/generator/GeneratorTest.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/generator/GeneratorTest.java
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/generator/GeneratorTest.java 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,322 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.savara.bpel.generator;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestResult;
+import junit.framework.TestSuite;
+
+import org.savara.bpel.generator.ProtocolToBPELModelGenerator;
+import org.savara.bpel.model.TProcess;
+import org.savara.bpel.util.BPELModelUtil;
+import org.savara.common.model.generator.ModelGenerator;
+import org.scribble.common.logging.CachedJournal;
+import org.scribble.protocol.model.Role;
+import org.scribble.protocol.parser.antlr.ANTLRProtocolParser;
+import org.savara.protocol.util.ProtocolServices;
+
+public class GeneratorTest {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite("Protocol->BPEL Generator Tests");
+
+ /*
+ suite.addTest(new ProtocolToBPELTester("ESBBroker",
"Broker"));
+ suite.addTest(new ProtocolToBPELTester("ESBBroker",
"Buyer"));
+ suite.addTest(new ProtocolToBPELTester("ESBBroker",
"SupplierTxnProcessor"));
+ suite.addTest(new ProtocolToBPELTester("ESBBroker",
"CreditAgency"));
+ suite.addTest(new ProtocolToBPELTester("ESBBroker",
"SupplierQuoteEngine"));
+
+ suite.addTest(new ProtocolToBPELTester("PurchaseGoods",
"Buyer"));
+ suite.addTest(new ProtocolToBPELTester("PurchaseGoods",
"CreditAgency"));
+ suite.addTest(new ProtocolToBPELTester("PurchaseGoods",
"Store"));
+
+ suite.addTest(new ProtocolToBPELTester("ReqRespFault",
"Buyer"));
+ suite.addTest(new ProtocolToBPELTester("ReqRespFault",
"Seller"));
+ */
+
+ return suite;
+ }
+
+ protected static class ProtocolToBPELTester extends TestCase {
+
+ /**
+ * This constructor is initialized with the test
+ * name.
+ *
+ * @param name The test name
+ * @param role The role
+ */
+ public ProtocolToBPELTester(String name,
+ String role) {
+ super(name+"@"+role);
+ m_name = name;
+ m_role = role;
+ }
+
+ /**
+ * This method runs the test.
+ *
+ * @param result The test result
+ */
+ public void run(TestResult result) {
+ // Setup scribble services
+ ProtocolServices.setProtocolProjector(
+ new org.scribble.protocol.projection.impl.ProtocolProjectorImpl());
+
+ // Run test
+ result.startTest(this);
+
+ String filename="testmodels/protocol/"+m_name+".spr";
+
+ java.io.InputStream is=
+ ClassLoader.getSystemResourceAsStream(filename);
+
+ if (is == null) {
+ result.addError(this,
+ new Throwable("Unable to locate resource: "+filename));
+ } else {
+ CachedJournal journal=new CachedJournal();
+
+ org.scribble.protocol.model.ProtocolModel model=null;
+
+ ANTLRProtocolParser parser=new ANTLRProtocolParser();
+ parser.addAnnotationProcessor(new org.savara.protocol.parser.AnnotationProcessor());
+
+ try {
+ model = parser.parse(is, journal, null);
+ } catch(Exception e) {
+ result.addError(this, new Throwable("Parsing choreography failed"));
+ }
+
+ if (model == null) {
+ result.addError(this, new Throwable("Model is null"));
+ } else {
+ //org.scribble.protocol.projection.ProtocolProjector projector=
+ // new org.scribble.projector.DefaultProjector();
+
+ org.scribble.protocol.model.Role role=null;
+
+ // Obtain role from definition
+ //Protocol defn=model.getProtocol();
+
+ // Check if subpath definition defined
+ /*
+ if (m_subDefinitionPath != null) {
+ defn = defn.getSubDefinition(m_subDefinitionPath);
+ }
+ */
+
+ java.util.List<org.scribble.protocol.model.Role> roles=model.getRoles();
+ //new org.scribble.model.Role(m_role);
+
+ for (int i=0; role == null && i < roles.size(); i++) {
+ if (roles.get(i).getName().equals(m_role)) {
+ role = roles.get(i);
+ }
+ }
+
+ if (role == null) {
+ result.addError(this,
+ new Throwable("Role '"+m_role+"' not
found"));
+ } else {
+ org.scribble.protocol.projection.ProtocolProjector projector=
+ new org.scribble.protocol.projection.impl.ProtocolProjectorImpl();
+
+ org.scribble.protocol.model.ProtocolModel projected=
+ projector.project(model, role, journal, null);
+
+ /* Currently if a 'fail' is performed in Tycho build, it
+ * hangs the build.
+ if (l.getErrors().size() > 0) {
+ fail("Projection has errors: "+l.getErrors());
+ } else if (projected == null) {
+ fail("Projected model is null, for "+filename+" role
"+role);
+ }
+ */
+
+ java.util.List<Role> projectedRoles=projected.getRoles();
+
+ ModelGenerator generator=new ProtocolToBPELModelGenerator();
+
+ //defn = projected.getProtocol();
+
+ if (generator != null) { // && defn != null) {
+
+ Object target=generator.generate(projected, journal, null);
+
+ /*
+ ModelReference targetRef=
+ new ModelReference(BPELNotation.NOTATION_CODE);
+ targetRef.setAlias(m_name);
+ targetRef.setLocatedRole(m_role);
+
+ DefaultBPELLanguageModel target=
+ new DefaultBPELLanguageModel(targetRef);
+
+ generator.generate(targetRef, role,
+ target, projected);
+ */
+
+ if (target instanceof TProcess) {
+ // Obtain any namespace prefix map
+ java.util.Map<String, String> prefixes=null;
+ /*
+ (java.util.Map<String, String>)
+ projected.getProperties().get(PropertyName.NAMESPACE_PREFIXES);
+ */
+ try {
+ java.io.ByteArrayOutputStream baos=new java.io.ByteArrayOutputStream();
+
+ BPELModelUtil.serialize((TProcess)target, baos, prefixes);
+
+ baos.close();
+
+ String text=new String(baos.toByteArray());
+
+ checkResults(result, text);
+ } catch(Exception e) {
+ result.addError(this, e);
+ }
+ } else {
+ result.addError(this,
+ new Throwable("No BPEL generated"));
+ }
+
+ } else {
+ result.addError(this,
+ new Throwable("Unable to find Model Generator"));
+ }
+ }
+ }
+ }
+
+ result.endTest(this);
+ }
+
+ /**
+ * This method checks the generated BPEL against a
+ * previously stored correct version.
+ *
+ * @param result The test result
+ * @param bpel The BPEL
+ */
+ protected void checkResults(TestResult result, String bpel) {
+ boolean f_valid=false;
+
+ String
filename="results/bpel/"+m_name+"(a)"+m_role+".bpel";
+
+ java.io.InputStream is=
+ //ChoreographyToBPELTester.class.getResourceAsStream(filename);
+ ClassLoader.getSystemResourceAsStream(filename);
+
+ if (is != null) {
+
+ try {
+ byte[] b=new byte[is.available()];
+
+ is.read(b);
+
+ is.close();
+
+ String orig=new String(b);
+
+ if (orig.equals(bpel) == false) {
+ result.addError(this,
+ new Throwable("Generated BPEL does not match stored version"));
+ } else {
+ f_valid = true;
+ }
+ } catch(Exception e) {
+ result.addError(this, e);
+ }
+ } else {
+ result.addError(this,
+ new Throwable("Resulting BPEL '"+filename+
+ "' not found for comparison"));
+ }
+
+ if (f_valid == false) {
+ String srcfile="testmodels/protocol/"+m_name+".spr";
+
+ java.net.URL url=ClassLoader.getSystemResource(srcfile);
+
+ /*
+ try {
+ url = org.eclipse.core.runtime.FileLocator.toFileURL(url);
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
+ */
+
+ if (url != null) {
+ // URL will point to copy of test models in the classes folder, so need
+ // to obtain reference back to source version
+ java.io.File f=null;
+
+ if (url.getFile().indexOf("target/test-classes") != -1) {
+ f = new
java.io.File(url.getFile().replaceFirst("target/test-classes","src/test/resources"));
+ } else if (url.getFile().indexOf("classes") != -1) {
+ f = new
java.io.File(url.getFile().replaceFirst("classes","src/test/resources"));
+ } else if (url.getFile().indexOf("bin") != -1) {
+ f = new
java.io.File(url.getFile().replaceFirst("bin","src/test/resources"));
+ } else {
+ result.addError(this, new Exception("Could not locate results folder to
record expected result"));
+ }
+
+ if (f != null && f.exists()) {
+ f = f.getParentFile().getParentFile();
+
+ java.io.File resultsDir=new java.io.File(f, "results");
+
+ if (resultsDir.exists() == false) {
+ resultsDir.mkdirs();
+ }
+
+ java.io.File resultFile=new java.io.File(resultsDir,
+ m_name+"(a)"+m_role+".generated");
+
+ if (resultFile.exists() == false) {
+ try {
+ java.io.FileOutputStream fos=new java.io.FileOutputStream(resultFile);
+
+ fos.write(bpel.getBytes());
+
+ fos.flush();
+ fos.close();
+
+ } catch(Exception e){
+ result.addError(this, e);
+ }
+ } else {
+ System.err.println("NOTE: Generated output '"+resultFile+
+ "' already exists - not being overwritten");
+ }
+ } else {
+ result.addError(this, new Throwable("Unable to obtain URL for CDM model
source '"+
+ m_name+"': "+url));
+ }
+ }
+ }
+ }
+
+ private String m_name=null;
+ private String m_role=null;
+ }
+}
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/parser/ParserTest.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/parser/ParserTest.java
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/parser/ParserTest.java 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,278 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.savara.bpel.parser;
+
+import java.net.URI;
+
+import org.savara.bpel.parser.BPELProtocolParser;
+import org.scribble.common.logging.CachedJournal;
+import org.scribble.common.resource.ResourceLocator;
+import org.scribble.protocol.DefaultProtocolContext;
+import org.scribble.protocol.model.ProtocolModel;
+
+import junit.framework.TestCase;
+import junit.framework.TestResult;
+import junit.framework.TestSuite;
+
+public class ParserTest extends TestCase {
+
+ public static TestSuite suite() {
+ TestSuite suite = new TestSuite("BPEL->Protocol Parser Tests");
+
+ suite.addTest(new BPELToProtocolTest("ESBBrokerProcess_Broker",
"ESBBroker@Broker"));
+ suite.addTest(new BPELToProtocolTest("ESBBrokerProcess_Buyer",
"ESBBroker@Buyer"));
+ suite.addTest(new BPELToProtocolTest("ESBBrokerProcess_CreditAgency",
"ESBBroker@CreditAgency"));
+
+ suite.addTest(new
BPELToProtocolTest("RequestForQuote_SupplierQuoteEngine",
"ESBBroker@SupplierQuoteEngine"));
+ suite.addTest(new
BPELToProtocolTest("CompleteTransaction_SupplierTxnProcessor",
"ESBBroker@SupplierTxnProcessor"));
+
+ suite.addTest(new BPELToProtocolTest("PurchaseGoodsProcess_Buyer",
"PurchaseGoods@Buyer"));
+ suite.addTest(new
BPELToProtocolTest("PurchaseGoodsProcess_CreditAgency",
"PurchaseGoods@CreditAgency"));
+ suite.addTest(new BPELToProtocolTest("PurchaseGoodsProcess_Store",
"PurchaseGoods@Store"));
+
+ suite.addTest(new BPELToProtocolTest("ReqRespFaultProcess_Buyer",
"ReqRespFault@Buyer"));
+ suite.addTest(new BPELToProtocolTest("ReqRespFaultProcess_Seller",
"ReqRespFault@Seller"));
+
+ /**
+ * TODO: (SAVARA-150) Commenting out this test for now, as we now need the
accompanying WSDL to be able to
+ * resolve the message type's underlying XSD element or type.
+ *
+ suite.addTest(new BPELToConversationTest("LoanApprovalService@Service",
"LoanApprovalService@Service"));
+ */
+
+ return suite;
+ }
+
+ /**
+ * The test case for running the BPEL to Protocol test.
+ */
+ protected static class BPELToProtocolTest extends TestCase {
+
+ /**
+ * This constructor is initialized with the test
+ * name.
+ *
+ * @param name The test name
+ */
+ public BPELToProtocolTest(String bpelName, String scvName) {
+ super(bpelName+"->"+scvName);
+ m_bpelName = bpelName;
+ m_scvName = scvName;
+ }
+
+ /**
+ * This method runs the test.
+ *
+ * @param result The test result
+ */
+ public void run(TestResult result) {
+ result.startTest(this);
+
+ String filename="testmodels/bpel/"+m_bpelName+".bpel";
+
+ java.io.InputStream is=
+ //ParserTest.class.getResourceAsStream(filename);
+ ClassLoader.getSystemResourceAsStream(filename);
+
+ if (is == null) {
+ result.addError(this,
+ new Throwable("Unable to locate resource: "+filename));
+ } else {
+ CachedJournal journal=new CachedJournal();
+
+ org.scribble.protocol.model.ProtocolModel model=null;
+
+ try {
+ BPELProtocolParser parser=new BPELProtocolParser();
+
+ model = parser.parse(is, journal, new DefaultProtocolContext(null,
+ new ResourceLoaderImpl()));
+ } catch(Exception e) {
+ e.printStackTrace();
+ result.addError(this, new Throwable("Parsing BPEL failed"));
+ }
+
+ if (model == null) {
+ result.addError(this, new Throwable("Model is null"));
+
+ } else if (journal.hasErrors()) {
+ result.addError(this, new Throwable("Failed to parse CDM Model"));
+
+ for (int i=0; i < journal.getIssues().size(); i++) {
+ System.err.println("Issue: "+
+ journal.getIssues().get(i).getMessage());
+ }
+ } else {
+ ProtocolModel lm=(ProtocolModel)model;
+
+ try {
+ org.scribble.protocol.export.text.TextProtocolExporter exporter=
+ new org.scribble.protocol.export.text.TextProtocolExporter();
+
+ java.io.ByteArrayOutputStream os=
+ new java.io.ByteArrayOutputStream();
+
+ exporter.export(lm, journal, os);
+
+ os.close();
+
+ String str=new String(os.toByteArray());
+
+ checkResults(result, str);
+
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ result.endTest(this);
+ }
+
+ /**
+ * This method checks the generated jboss-esb.xml against a
+ * previously stored correct version.
+ *
+ * @param result The test result
+ * @param conv The conversation
+ */
+ protected void checkResults(TestResult result, String conv) {
+ boolean f_valid=false;
+
+ String filename="results/protocol/"+m_scvName+".spr";
+
+ java.io.InputStream is=
+ //ParserTest.class.getResourceAsStream(filename);
+ ClassLoader.getSystemResourceAsStream(filename);
+
+ if (is != null) {
+
+ try {
+ byte[] b=new byte[is.available()];
+
+ is.read(b);
+
+ is.close();
+
+ String orig=new String(b);
+
+ if (orig.equals(conv) == false) {
+ result.addError(this,
+ new Throwable("Generated protocol does not match stored version"));
+ } else {
+ f_valid = true;
+ }
+ } catch(Exception e) {
+ result.addError(this, e);
+ }
+ } else {
+ result.addError(this,
+ new Throwable("Resulting protocol '"+filename+
+ "' not found for comparison"));
+ }
+
+ if (f_valid == false) {
+ String bpelfile="testmodels/bpel/"+m_bpelName+".bpel";
+
+ java.net.URL url=//ParserTest.class.getResource(bpelfile);
+ ClassLoader.getSystemResource(bpelfile);
+
+ /*
+ try {
+ url = org.eclipse.core.runtime.FileLocator.toFileURL(url);
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
+ */
+
+ if (url != null) {
+ // URL will point to copy of test models in the classes folder, so need
+ // to obtain reference back to source version
+ java.io.File f=null;
+
+ if (url.getFile().indexOf("target/test-classes") != -1) {
+ f = new
java.io.File(url.getFile().replaceFirst("target/test-classes","src/test/resources"));
+ } else if (url.getFile().indexOf("classes") != -1) {
+ f = new
java.io.File(url.getFile().replaceFirst("classes","src/test/resources"));
+ } else if (url.getFile().indexOf("bin") != -1) {
+ f = new
java.io.File(url.getFile().replaceFirst("bin","src/test/resources"));
+ } else {
+ result.addError(this, new Exception("Could not locate results folder to record
expected result"));
+ }
+
+ if (f != null && f.exists()) {
+ f = f.getParentFile().getParentFile();
+
+ java.io.File resultsDir=new java.io.File(f, "results");
+
+ if (resultsDir.exists() == false) {
+ resultsDir.mkdirs();
+ }
+
+ java.io.File resultFile=new java.io.File(resultsDir,
m_scvName+".generated");
+
+ if (resultFile.exists() == false) {
+ try {
+ java.io.FileOutputStream fos=new java.io.FileOutputStream(resultFile);
+
+ fos.write(conv.getBytes());
+
+ fos.flush();
+ fos.close();
+
+ } catch(Exception e){
+ result.addError(this, e);
+ }
+ } else {
+ System.err.println("NOTE: Generated output '"+resultFile+
+ "' already exists - not being overwritten");
+ }
+ } else {
+ result.addError(this, new Throwable("Unable to obtain URL for BPEL model
source '"+
+ m_bpelName+"': "+url));
+ }
+ }
+ }
+ }
+
+ private String m_bpelName=null;
+ private String m_scvName=null;
+ }
+
+ public static class ResourceLoaderImpl implements ResourceLocator {
+
+ public ResourceLoaderImpl() {
+ }
+
+ public URI getResourceURI(String uri) {
+ // TODO: Create file path based on extension in uri
+ String filename="testmodels/wsdl/"+uri;
+
+ java.net.URI ret=null;
+
+ try {
+ ret = ClassLoader.getSystemResource(filename).toURI();
+ } catch(Exception e) {
+ e.printStackTrace();
+ }
+
+ return(ret);
+ }
+
+ }
+}
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ESBBroker(a)Broker.bpel
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ESBBroker(a)Broker.bpel
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ESBBroker(a)Broker.bpel 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
+<process
xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
xmlns:spr="http://www.pi4soa.org/ESBBroker/Supplier"
xmlns:tns="http://www.pi4soa.org/ESBBroker"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:cay="http://www.pi4soa.org/ESBBroker/CreditAgency"
xmlns:byr="http://www.pi4soa.org/ESBBroker/Buyer"
xmlns:brk="http://www.pi4soa.org/ESBBroker/Broker"
targetNamespace="http://www.pi4soa.org/ESBBroker/Broker"
name="ESBBrokerProcess_Broker">
+ <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="ESBBrokerProcess_Broker.wsdl"
namespace="http://www.pi4soa.org/ESBBroker/Broker"/>
+ <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="ESBBrokerProcess_CreditAgency.wsdl"
namespace="http://www.pi4soa.org/ESBBroker/CreditAgency"/>
+ <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="ESBBrokerProcess_SupplierTxnProcessor.wsdl"
namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
+ <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="ESBBrokerProcess_BrokerArtifacts.wsdl"
namespace="http://www.pi4soa.org/ESBBroker/Broker"/>
+ <partnerLinks>
+ <partnerLink myRole="Broker"
partnerLinkType="brk:BuyerToBrokerServiceLT"
name="BuyerToBroker"/>
+ <partnerLink partnerRole="SupplierQuoteEngineRequester"
partnerLinkType="brk:BrokerToSupplierQuoteEngineLT"
name="BrokerToSupplierQuoteEngine"/>
+ <partnerLink partnerRole="CreditAgencyRequester"
partnerLinkType="brk:BrokerToCreditAgencyLT"
name="BrokerToCreditAgency"/>
+ <partnerLink partnerRole="SupplierTxnProcessorRequester"
partnerLinkType="brk:BrokerToSupplierTxnProcessorLT"
name="BrokerToSupplierTxnProcessor"/>
+ </partnerLinks>
+ <variables>
+ <variable messageType="brk:makeEnquiryRequest"
name="makeEnquiryRequestVar"/>
+ <variable messageType="spr:getQuoteRequest"
name="getQuoteRequestVar"/>
+ <variable messageType="spr:getQuoteResponse"
name="getQuoteResponseVar"/>
+ <variable messageType="brk:makeEnquiryResponse"
name="makeEnquiryResponseVar"/>
+ <variable messageType="cay:checkCreditRequest"
name="checkCreditRequestVar"/>
+ <variable messageType="cay:checkCreditResponse"
name="checkCreditResponseVar"/>
+ <variable messageType="spr:confirmRequest"
name="confirmRequestVar"/>
+ <variable messageType="spr:confirmResponse"
name="confirmResponseVar"/>
+ <variable messageType="brk:buyResponse"
name="buyResponseVar"/>
+ <variable messageType="brk:rejectedFault"
name="rejectedFaultVar"/>
+ <variable messageType="brk:buyRequest"
name="buyRequestVar"/>
+ <variable messageType="brk:cancelRequest"
name="cancelRequestVar"/>
+ </variables>
+ <sequence>
+ <receive createInstance="yes"
variable="makeEnquiryRequestVar" operation="makeEnquiry"
portType="brk:Broker" partnerLink="BuyerToBroker"
name="Receive_Enquiry"/>
+ <while>
+ <sequence>
+ <scope>
+ <sequence>
+ <invoke outputVariable="getQuoteResponseVar"
inputVariable="getQuoteRequestVar" operation="getQuote"
portType="spr:SupplierQuoteEngine"
partnerLink="BrokerToSupplierQuoteEngine"
name="Send_RequestForQuote"/>
+ </sequence>
+ </scope>
+ </sequence>
+ </while>
+ <reply variable="makeEnquiryResponseVar"
operation="makeEnquiry" portType="brk:Broker"
partnerLink="BuyerToBroker" name="Send_QuoteList"/>
+ <pick>
+ <onMessage variable="buyRequestVar" operation="buy"
portType="brk:Broker" partnerLink="BuyerToBroker">
+ <sequence>
+ <scope>
+ <faultHandlers>
+ <catch faultMessageType="cay:invalidCreditFault"
faultVariable="invalidCreditFaultVar"
faultName="cay:invalidCredit">
+<sequence>
+ <reply faultName="brk:rejected" variable="rejectedFaultVar"
operation="buy" portType="brk:Broker"
partnerLink="BuyerToBroker" name="Send_OrderRejected"/>
+</sequence>
+ </catch>
+ </faultHandlers>
+ <sequence>
+ <invoke outputVariable="checkCreditResponseVar"
inputVariable="checkCreditRequestVar" operation="checkCredit"
portType="cay:CreditAgency" partnerLink="BrokerToCreditAgency"
name="Send_CreditInformation"/>
+ <invoke outputVariable="confirmResponseVar"
inputVariable="confirmRequestVar" operation="confirm"
portType="spr:SupplierTxnProcessor"
partnerLink="BrokerToSupplierTxnProcessor"
name="Send_OrderConfirmed"/>
+ <reply variable="buyResponseVar"
operation="buy" portType="brk:Broker"
partnerLink="BuyerToBroker" name="Send_BookingReference"/>
+ </sequence>
+ </scope>
+ </sequence>
+ </onMessage>
+ <onMessage variable="cancelRequestVar"
operation="cancel" portType="brk:Broker"
partnerLink="BuyerToBroker">
+ <sequence/>
+ </onMessage>
+ </pick>
+ </sequence>
+</process>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ESBBroker(a)Buyer.bpel
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ESBBroker(a)Buyer.bpel
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ESBBroker(a)Buyer.bpel 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
+<process
xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
xmlns:spr="http://www.pi4soa.org/ESBBroker/Supplier"
xmlns:tns="http://www.pi4soa.org/ESBBroker"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:cay="http://www.pi4soa.org/ESBBroker/CreditAgency"
xmlns:byr="http://www.pi4soa.org/ESBBroker/Buyer"
xmlns:brk="http://www.pi4soa.org/ESBBroker/Broker"
targetNamespace="http://www.pi4soa.org/ESBBroker/Buyer"
name="ESBBrokerProcess_Buyer">
+ <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="ESBBrokerProcess_Broker.wsdl"
namespace="http://www.pi4soa.org/ESBBroker/Broker"/>
+ <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="ESBBrokerProcess_CreditAgency.wsdl"
namespace="http://www.pi4soa.org/ESBBroker/CreditAgency"/>
+ <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="ESBBrokerProcess_SupplierTxnProcessor.wsdl"
namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
+ <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="ESBBrokerProcess_BuyerArtifacts.wsdl"
namespace="http://www.pi4soa.org/ESBBroker/Buyer"/>
+ <partnerLinks>
+ <partnerLink partnerRole="BrokerRequester"
partnerLinkType="byr:BuyerToBrokerLT" name="BuyerToBroker"/>
+ </partnerLinks>
+ <variables>
+ <variable messageType="brk:makeEnquiryRequest"
name="makeEnquiryRequestVar"/>
+ <variable messageType="brk:makeEnquiryResponse"
name="makeEnquiryResponseVar"/>
+ <variable messageType="brk:buyRequest"
name="buyRequestVar"/>
+ <variable messageType="brk:buyResponse"
name="buyResponseVar"/>
+ <variable messageType="brk:cancelRequest"
name="cancelRequestVar"/>
+ </variables>
+ <sequence>
+ <invoke outputVariable="makeEnquiryResponseVar"
inputVariable="makeEnquiryRequestVar" operation="makeEnquiry"
portType="brk:Broker" partnerLink="BuyerToBroker"
name="Send_Enquiry"/>
+ <if>
+ <sequence>
+ <scope>
+ <faultHandlers>
+ <catch faultMessageType="brk:rejectedFault"
faultVariable="rejectedFaultVar" faultName="brk:rejected">
+ <sequence/>
+ </catch>
+ </faultHandlers>
+ <sequence>
+ <invoke outputVariable="buyResponseVar"
inputVariable="buyRequestVar" operation="buy"
portType="brk:Broker" partnerLink="BuyerToBroker"
name="Send_Buy"/>
+ </sequence>
+ </scope>
+ </sequence>
+ <else>
+ <sequence>
+ <invoke inputVariable="cancelRequestVar"
operation="cancel" portType="brk:Broker"
partnerLink="BuyerToBroker" name="Send_Cancel"/>
+ </sequence>
+ </else>
+ </if>
+ </sequence>
+</process>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ESBBroker(a)CreditAgency.bpel
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ESBBroker(a)CreditAgency.bpel
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ESBBroker(a)CreditAgency.bpel 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
+<process
xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
xmlns:spr="http://www.pi4soa.org/ESBBroker/Supplier"
xmlns:tns="http://www.pi4soa.org/ESBBroker"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:cay="http://www.pi4soa.org/ESBBroker/CreditAgency"
xmlns:byr="http://www.pi4soa.org/ESBBroker/Buyer"
xmlns:brk="http://www.pi4soa.org/ESBBroker/Broker"
targetNamespace="http://www.pi4soa.org/ESBBroker/CreditAgency"
name="ESBBrokerProcess_CreditAgency">
+ <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="ESBBrokerProcess_CreditAgency.wsdl"
namespace="http://www.pi4soa.org/ESBBroker/CreditAgency"/>
+ <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="ESBBrokerProcess_Broker.wsdl"
namespace="http://www.pi4soa.org/ESBBroker/Broker"/>
+ <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="ESBBrokerProcess_SupplierTxnProcessor.wsdl"
namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
+ <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="ESBBrokerProcess_CreditAgencyArtifacts.wsdl"
namespace="http://www.pi4soa.org/ESBBroker/CreditAgency"/>
+ <partnerLinks>
+ <partnerLink myRole="CreditAgency"
partnerLinkType="cay:BrokerToCreditAgencyServiceLT"
name="BrokerToCreditAgency"/>
+ </partnerLinks>
+ <variables>
+ <variable messageType="cay:checkCreditRequest"
name="checkCreditRequestVar"/>
+ <variable messageType="cay:checkCreditResponse"
name="checkCreditResponseVar"/>
+ <variable messageType="cay:invalidCreditFault"
name="invalidCreditFaultVar"/>
+ </variables>
+ <sequence>
+ <receive createInstance="yes"
variable="checkCreditRequestVar" operation="checkCredit"
portType="cay:CreditAgency" partnerLink="BrokerToCreditAgency"
name="Receive_CreditInformation"/>
+ <if>
+ <sequence>
+ <reply variable="checkCreditResponseVar"
operation="checkCredit" portType="cay:CreditAgency"
partnerLink="BrokerToCreditAgency" name="Send_CreditValid"/>
+ </sequence>
+ <else>
+ <sequence>
+ <reply faultName="cay:invalidCredit"
variable="invalidCreditFaultVar" operation="checkCredit"
portType="cay:CreditAgency" partnerLink="BrokerToCreditAgency"
name="Send_CreditInvalid"/>
+ </sequence>
+ </else>
+ </if>
+ </sequence>
+</process>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ESBBroker(a)Supplier.bpel
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ESBBroker(a)Supplier.bpel
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ESBBroker(a)Supplier.bpel 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,3 @@
+<process name="ESBBrokerProcess_Supplier"
xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"...
+ <sequence/>
+</process>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ESBBroker(a)SupplierQuoteEngine.bpel
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ESBBroker(a)SupplierQuoteEngine.bpel
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ESBBroker(a)SupplierQuoteEngine.bpel 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
+<process
xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
xmlns:spr="http://www.pi4soa.org/ESBBroker/Supplier"
xmlns:tns="http://www.pi4soa.org/ESBBroker"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:cay="http://www.pi4soa.org/ESBBroker/CreditAgency"
xmlns:byr="http://www.pi4soa.org/ESBBroker/Buyer"
xmlns:brk="http://www.pi4soa.org/ESBBroker/Broker"
targetNamespace="http://www.pi4soa.org/ESBBroker/Supplier"
name="RequestForQuote_SupplierQuoteEngine">
+ <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="RequestForQuote_SupplierQuoteEngine.wsdl"
namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
+ <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="RequestForQuote_SupplierQuoteEngineArtifacts.wsdl"
namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
+ <partnerLinks>
+ <partnerLink myRole="SupplierQuoteEngine"
partnerLinkType="spr:BrokerToSupplierQuoteEngineServiceLT"
name="BrokerToSupplierQuoteEngine"/>
+ </partnerLinks>
+ <variables>
+ <variable messageType="spr:getQuoteRequest"
name="getQuoteRequestVar"/>
+ <variable messageType="spr:getQuoteResponse"
name="getQuoteResponseVar"/>
+ </variables>
+ <sequence>
+ <receive createInstance="yes"
variable="getQuoteRequestVar" operation="getQuote"
portType="spr:SupplierQuoteEngine"
partnerLink="BrokerToSupplierQuoteEngine"
name="Receive_RequestForQuote"/>
+ <reply variable="getQuoteResponseVar" operation="getQuote"
portType="spr:SupplierQuoteEngine"
partnerLink="BrokerToSupplierQuoteEngine" name="Send_Quote"/>
+ </sequence>
+</process>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ESBBroker(a)SupplierTxnProcessor.bpel
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ESBBroker(a)SupplierTxnProcessor.bpel
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ESBBroker(a)SupplierTxnProcessor.bpel 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
+<process
xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
xmlns:spr="http://www.pi4soa.org/ESBBroker/Supplier"
xmlns:tns="http://www.pi4soa.org/ESBBroker"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:cay="http://www.pi4soa.org/ESBBroker/CreditAgency"
xmlns:byr="http://www.pi4soa.org/ESBBroker/Buyer"
xmlns:brk="http://www.pi4soa.org/ESBBroker/Broker"
targetNamespace="http://www.pi4soa.org/ESBBroker/Supplier"
name="ESBBrokerProcess_SupplierTxnProcessor">
+ <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="ESBBrokerProcess_SupplierTxnProcessor.wsdl"
namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
+ <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="ESBBrokerProcess_Broker.wsdl"
namespace="http://www.pi4soa.org/ESBBroker/Broker"/>
+ <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="ESBBrokerProcess_CreditAgency.wsdl"
namespace="http://www.pi4soa.org/ESBBroker/CreditAgency"/>
+ <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="ESBBrokerProcess_SupplierTxnProcessorArtifacts.wsdl"
namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
+ <partnerLinks>
+ <partnerLink myRole="SupplierTxnProcessor"
partnerLinkType="spr:BrokerToSupplierTxnProcessorServiceLT"
name="BrokerToSupplierTxnProcessor"/>
+ </partnerLinks>
+ <variables>
+ <variable messageType="spr:confirmRequest"
name="confirmRequestVar"/>
+ <variable messageType="spr:confirmResponse"
name="confirmResponseVar"/>
+ </variables>
+ <sequence>
+ <receive createInstance="yes" variable="confirmRequestVar"
operation="confirm" portType="spr:SupplierTxnProcessor"
partnerLink="BrokerToSupplierTxnProcessor"
name="Receive_OrderConfirmed"/>
+ <reply variable="confirmResponseVar" operation="confirm"
portType="spr:SupplierTxnProcessor"
partnerLink="BrokerToSupplierTxnProcessor"
name="Send_BookingReference"/>
+ </sequence>
+</process>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/PurchaseGoods(a)Buyer.bpel
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/PurchaseGoods(a)Buyer.bpel
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/PurchaseGoods(a)Buyer.bpel 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
+<process
xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
xmlns:tns="http://www.jboss.org/savara/examples"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sto="http://www.jboss.org/examples/store"
xmlns:pur="java:org.jboss.savara.examples.purchasing"
targetNamespace="http://www.jboss.org/savara/examples"
name="PurchaseGoodsProcess_Buyer">
+ <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="PurchaseGoodsProcess_CreditAgency.wsdl"
namespace="java:org.jboss.savara.examples.purchasing"/>
+ <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="PurchaseGoodsProcess_Store.wsdl"
namespace="http://www.jboss.org/examples/store"/>
+ <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="PurchaseGoodsProcess_BuyerArtifacts.wsdl"
namespace="http://www.jboss.org/savara/examples"/>
+ <partnerLinks>
+ <partnerLink partnerRole="StoreRequester"
partnerLinkType="tns:BuyerToStoreLT" name="BuyerToStore"/>
+ </partnerLinks>
+ <variables>
+ <variable messageType="sto:buyRequest"
name="buyRequestVar"/>
+ <variable messageType="sto:buyResponse"
name="buyResponseVar"/>
+ </variables>
+ <sequence>
+ <scope>
+ <faultHandlers>
+ <catch faultMessageType="sto:BuyFailedFault"
faultVariable="BuyFailedFaultVar" faultName="sto:BuyFailed">
+ <sequence/>
+ </catch>
+ </faultHandlers>
+ <sequence>
+ <invoke outputVariable="buyResponseVar"
inputVariable="buyRequestVar" operation="buy"
portType="sto:Store" partnerLink="BuyerToStore"
name="Send_BuyRequest"/>
+ </sequence>
+ </scope>
+ </sequence>
+</process>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/PurchaseGoods(a)CreditAgency.bpel
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/PurchaseGoods(a)CreditAgency.bpel
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/PurchaseGoods(a)CreditAgency.bpel 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
+<process
xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
xmlns:tns="http://www.jboss.org/savara/examples"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sto="http://www.jboss.org/examples/store"
xmlns:pur="java:org.jboss.savara.examples.purchasing"
targetNamespace="java:org.jboss.savara.examples.purchasing"
name="PurchaseGoodsProcess_CreditAgency">
+ <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="PurchaseGoodsProcess_CreditAgency.wsdl"
namespace="java:org.jboss.savara.examples.purchasing"/>
+ <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="PurchaseGoodsProcess_Store.wsdl"
namespace="http://www.jboss.org/examples/store"/>
+ <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="PurchaseGoodsProcess_CreditAgencyArtifacts.wsdl"
namespace="java:org.jboss.savara.examples.purchasing"/>
+ <partnerLinks>
+ <partnerLink myRole="CreditAgency"
partnerLinkType="pur:StoreToCreditAgencyServiceLT"
name="StoreToCreditAgency"/>
+ </partnerLinks>
+ <variables>
+ <variable messageType="pur:checkCreditRequest"
name="checkCreditRequestVar"/>
+ <variable messageType="pur:checkCreditResponse"
name="checkCreditResponseVar"/>
+ <variable messageType="pur:CreditCheckFailedFault"
name="CreditCheckFailedFaultVar"/>
+ </variables>
+ <sequence>
+ <receive createInstance="yes"
variable="checkCreditRequestVar" operation="checkCredit"
portType="pur:CreditAgency" partnerLink="StoreToCreditAgency"
name="Receive_CreditCheckRequest"/>
+ <if>
+ <sequence>
+ <reply variable="checkCreditResponseVar"
operation="checkCredit" portType="pur:CreditAgency"
partnerLink="StoreToCreditAgency" name="Send_CreditCheckOk"/>
+ </sequence>
+ <else>
+ <sequence>
+ <reply faultName="pur:CreditCheckFailed"
variable="CreditCheckFailedFaultVar" operation="checkCredit"
portType="pur:CreditAgency" partnerLink="StoreToCreditAgency"
name="Send_CreditCheckInvalid"/>
+ </sequence>
+ </else>
+ </if>
+ </sequence>
+</process>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/PurchaseGoods(a)Store.bpel
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/PurchaseGoods(a)Store.bpel
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/PurchaseGoods(a)Store.bpel 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
+<process
xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
xmlns:tns="http://www.jboss.org/savara/examples"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sto="http://www.jboss.org/examples/store"
xmlns:pur="java:org.jboss.savara.examples.purchasing"
targetNamespace="http://www.jboss.org/examples/store"
name="PurchaseGoodsProcess_Store">
+ <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="PurchaseGoodsProcess_Store.wsdl"
namespace="http://www.jboss.org/examples/store"/>
+ <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="PurchaseGoodsProcess_CreditAgency.wsdl"
namespace="java:org.jboss.savara.examples.purchasing"/>
+ <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="PurchaseGoodsProcess_StoreArtifacts.wsdl"
namespace="http://www.jboss.org/examples/store"/>
+ <partnerLinks>
+ <partnerLink myRole="Store"
partnerLinkType="sto:BuyerToStoreServiceLT" name="BuyerToStore"/>
+ <partnerLink partnerRole="CreditAgencyRequester"
partnerLinkType="sto:StoreToCreditAgencyLT"
name="StoreToCreditAgency"/>
+ </partnerLinks>
+ <variables>
+ <variable messageType="sto:buyRequest"
name="buyRequestVar"/>
+ <variable messageType="pur:checkCreditRequest"
name="checkCreditRequestVar"/>
+ <variable messageType="pur:checkCreditResponse"
name="checkCreditResponseVar"/>
+ <variable messageType="sto:buyResponse"
name="buyResponseVar"/>
+ <variable messageType="sto:BuyFailedFault"
name="BuyFailedFaultVar"/>
+ </variables>
+ <sequence>
+ <receive createInstance="yes" variable="buyRequestVar"
operation="buy" portType="sto:Store"
partnerLink="BuyerToStore" name="Receive_BuyRequest"/>
+ <scope>
+ <faultHandlers>
+ <catch faultMessageType="pur:CreditCheckFailedFault"
faultVariable="CreditCheckFailedFaultVar"
faultName="pur:CreditCheckFailed">
+ <sequence>
+ <reply faultName="sto:BuyFailed"
variable="BuyFailedFaultVar" operation="buy"
portType="sto:Store" partnerLink="BuyerToStore"
name="Send_BuyFailed"/>
+ </sequence>
+ </catch>
+ </faultHandlers>
+ <sequence>
+ <invoke outputVariable="checkCreditResponseVar"
inputVariable="checkCreditRequestVar" operation="checkCredit"
portType="pur:CreditAgency" partnerLink="StoreToCreditAgency"
name="Send_CreditCheckRequest"/>
+ <reply variable="buyResponseVar" operation="buy"
portType="sto:Store" partnerLink="BuyerToStore"
name="Send_BuyConfirmed"/>
+ </sequence>
+ </scope>
+ </sequence>
+</process>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ReqRespFault(a)Buyer.bpel
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ReqRespFault(a)Buyer.bpel
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ReqRespFault(a)Buyer.bpel 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
+<process
xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
xmlns:tns="http://www.pi4soa.org/ReqRespFault"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:byr="http://www.pi4soa.org/ReqRespFault/Buyer"
xmlns:slr="http://www.pi4soa.org/ReqRespFault/Seller"
targetNamespace="http://www.pi4soa.org/ReqRespFault/Buyer"
name="ReqRespFaultProcess_Buyer">
+ <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="ReqRespFaultProcess_Seller.wsdl"
namespace="http://www.pi4soa.org/ReqRespFault/Seller"/>
+ <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="ReqRespFaultProcess_BuyerArtifacts.wsdl"
namespace="http://www.pi4soa.org/ReqRespFault/Buyer"/>
+ <partnerLinks>
+ <partnerLink partnerRole="SellerRequester"
partnerLinkType="byr:BuyerToSellerLT" name="BuyerToSeller"/>
+ </partnerLinks>
+ <variables>
+ <variable messageType="slr:checkCreditRequest"
name="checkCreditRequestVar"/>
+ <variable messageType="slr:checkCreditResponse"
name="checkCreditResponseVar"/>
+ </variables>
+ <sequence>
+ <scope>
+ <faultHandlers>
+ <catch faultMessageType="slr:insufficientCreditFault"
faultVariable="insufficientCreditFaultVar"
faultName="slr:insufficientCredit">
+ <sequence/>
+ </catch>
+ </faultHandlers>
+ <sequence>
+ <invoke outputVariable="checkCreditResponseVar"
inputVariable="checkCreditRequestVar" operation="checkCredit"
portType="slr:Seller" partnerLink="BuyerToSeller"
name="Send_CreditInformation"/>
+ </sequence>
+ </scope>
+ </sequence>
+</process>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ReqRespFault(a)Seller.bpel
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ReqRespFault(a)Seller.bpel
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/ReqRespFault(a)Seller.bpel 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
+<process
xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
xmlns:tns="http://www.pi4soa.org/ReqRespFault"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:byr="http://www.pi4soa.org/ReqRespFault/Buyer"
xmlns:slr="http://www.pi4soa.org/ReqRespFault/Seller"
targetNamespace="http://www.pi4soa.org/ReqRespFault/Seller"
name="ReqRespFaultProcess_Seller">
+ <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="ReqRespFaultProcess_Seller.wsdl"
namespace="http://www.pi4soa.org/ReqRespFault/Seller"/>
+ <import
importType="http://schemas.xmlsoap.org/wsdl/"
location="ReqRespFaultProcess_SellerArtifacts.wsdl"
namespace="http://www.pi4soa.org/ReqRespFault/Seller"/>
+ <partnerLinks>
+ <partnerLink myRole="Seller"
partnerLinkType="slr:BuyerToSellerServiceLT"
name="BuyerToSeller"/>
+ </partnerLinks>
+ <variables>
+ <variable messageType="slr:checkCreditRequest"
name="checkCreditRequestVar"/>
+ <variable messageType="slr:checkCreditResponse"
name="checkCreditResponseVar"/>
+ <variable messageType="slr:insufficientCreditFault"
name="insufficientCreditFaultVar"/>
+ </variables>
+ <sequence>
+ <receive createInstance="yes"
variable="checkCreditRequestVar" operation="checkCredit"
portType="slr:Seller" partnerLink="BuyerToSeller"
name="Receive_CreditInformation"/>
+ <if>
+ <sequence>
+ <reply variable="checkCreditResponseVar"
operation="checkCredit" portType="slr:Seller"
partnerLink="BuyerToSeller" name="Send_CreditValid"/>
+ </sequence>
+ <else>
+ <sequence>
+ <reply faultName="slr:insufficientCredit"
variable="insufficientCreditFaultVar" operation="checkCredit"
portType="slr:Seller" partnerLink="BuyerToSeller"
name="Send_CreditInvalid"/>
+ </sequence>
+ </else>
+ </if>
+ </sequence>
+</process>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/ESBBroker(a)Broker.spr
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/ESBBroker(a)Broker.spr
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/ESBBroker(a)Broker.spr 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,25 @@
+protocol ESBBrokerProcess_Broker @ BrokerBehavior {
+ makeEnquiry(enquiry) from Buyer;
+ repeat {
+ getQuote(requestForQuote) to SupplierQuoteEngine;
+ getQuote(quote) from SupplierQuoteEngine;
+ }
+ makeEnquiry(quoteList) to Buyer;
+ choice from Buyer {
+ buy(buy):
+ checkCredit(CreditCheckRequest) to CreditAgency;
+ choice from CreditAgency {
+ checkCredit(CreditCheckOk):
+ confirm(orderConfirmed) to SupplierTxnProcessor;
+ confirm(bookingReference) from SupplierTxnProcessor;
+ buy(bookingReference) to Buyer;
+
+ checkCredit(CreditCheckInvalid):
+ buy(orderRejected) to Buyer;
+
+ }
+
+ cancel(cancel):
+
+ }
+}
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/ESBBroker(a)Buyer.spr
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/ESBBroker(a)Buyer.spr
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/ESBBroker(a)Buyer.spr 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,16 @@
+protocol ESBBrokerProcess_Buyer @ Buyer {
+ makeEnquiry(enquiry) to Broker;
+ makeEnquiry(quoteList) from Broker;
+ choice to Broker {
+ buy():
+ choice from Broker {
+ buy(bookingReference):
+
+ buy(orderRejected):
+
+ }
+
+ cancel():
+
+ }
+}
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/ESBBroker(a)CreditAgency.spr
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/ESBBroker(a)CreditAgency.spr
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/ESBBroker(a)CreditAgency.spr 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,9 @@
+protocol ESBBrokerProcess_CreditAgency @ CreditAgency {
+ checkCredit(CreditCheckRequest) from Broker;
+ choice to Broker {
+ checkCredit(CreditCheckOk):
+
+ checkCredit(CreditCheckInvalid):
+
+ }
+}
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/ESBBroker(a)SupplierQuoteEngine.spr
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/ESBBroker(a)SupplierQuoteEngine.spr
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/ESBBroker(a)SupplierQuoteEngine.spr 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,4 @@
+protocol RequestForQuote_SupplierQuoteEngine @ SupplierBehavior {
+ getQuote(requestForQuote) from Broker;
+ getQuote(quote) to Broker;
+}
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/ESBBroker(a)SupplierTxnProcessor.spr
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/ESBBroker(a)SupplierTxnProcessor.spr
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/ESBBroker(a)SupplierTxnProcessor.spr 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,4 @@
+protocol CompleteTransaction_SupplierTxnProcessor @ SupplierTxnProcessor {
+ confirm(orderConfirmed) from Broker;
+ confirm(bookingReference) to Broker;
+}
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/LoanApprovalService(a)Service.scv
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/LoanApprovalService(a)Service.scv
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/LoanApprovalService(a)Service.scv 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,41 @@
+namespace null;
+
+conversation loanApprovalProcess {
+ try {
+ boolean receive-to-assess, receive-to-approval, approval-to-reply,
assess-to-setMessage, setMessage-to-reply, assess-to-approval;
+ parallel {
+ request(creditInformationMessage) from customer;
+ receive-to-assess = xpath[true()];
+ receive-to-approval = xpath[true()];
+ } and {
+ when (xpath[$receive-to-assess]) {
+ check(creditInformationMessage) to assessor;
+ if {
+ check(riskAssessmentMessage) from assessor;
+ } else if {
+ check(errorMessage) from assessor;
+ raise lns:loanProcessFault;
+ }
+ assess-to-setMessage = xpath[true()];
+ assess-to-approval = xpath[true()];
+ }
+ } and {
+ when (xpath[$receive-to-approval and $assess-to-approval]) {
+ approve(creditInformationMessage) to approver;
+ if {
+ approve(approvalMessage) from approver;
+ } else if {
+ approve(errorMessage) from approver;
+ raise lns:loanProcessFault;
+ }
+ approval-to-reply = xpath[true()];
+ }
+ } and {
+ when (xpath[$setMessage-to-reply and $approval-to-reply]) {
+ request(approvalMessage) to customer;
+ }
+ }
+ } catch lns:loanProcessFault {
+ request(errorMessage) to customer;
+ }
+}
\ No newline at end of file
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/PurchaseGoods(a)Buyer.spr
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/PurchaseGoods(a)Buyer.spr
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/PurchaseGoods(a)Buyer.spr 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,9 @@
+protocol PurchaseGoodsProcess_Buyer @ Buyer {
+ buy(BuyRequest) to Store;
+ choice from Store {
+ buy(BuyConfirmed):
+
+ buy(BuyFailed):
+
+ }
+}
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/PurchaseGoods(a)CreditAgency.spr
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/PurchaseGoods(a)CreditAgency.spr
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/PurchaseGoods(a)CreditAgency.spr 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,9 @@
+protocol PurchaseGoodsProcess_CreditAgency @ CreditAgencyInterface {
+ checkCredit(CreditCheckRequest) from Store;
+ choice to Store {
+ checkCredit(CreditCheckOk):
+
+ checkCredit(CreditCheckInvalid):
+
+ }
+}
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/PurchaseGoods(a)Store.spr
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/PurchaseGoods(a)Store.spr
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/PurchaseGoods(a)Store.spr 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,12 @@
+protocol PurchaseGoodsProcess_Store @ StoreInterface {
+ buy(BuyRequest) from Buyer;
+ checkCredit(CreditCheckRequest) to CreditAgency;
+ choice from CreditAgency {
+ checkCredit(CreditCheckOk):
+ buy(BuyConfirmed) to Buyer;
+
+ checkCredit(CreditCheckInvalid):
+ buy(BuyFailed) to Buyer;
+
+ }
+}
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/ReqRespFault(a)Buyer.spr
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/ReqRespFault(a)Buyer.spr
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/ReqRespFault(a)Buyer.spr 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,9 @@
+protocol ReqRespFaultProcess_Buyer {
+ checkCredit(CreditCheckRequest) to Seller;
+ choice from Seller {
+ checkCredit(CreditCheckOk):
+
+ checkCredit(CreditCheckInvalid):
+
+ }
+}
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/ReqRespFault(a)Seller.spr
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/ReqRespFault(a)Seller.spr
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/protocol/ReqRespFault(a)Seller.spr 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,9 @@
+protocol ReqRespFaultProcess_Seller @ SellerBehavior {
+ checkCredit(CreditCheckRequest) from Buyer;
+ choice to Buyer {
+ checkCredit(CreditCheckOk):
+
+ checkCredit(CreditCheckInvalid):
+
+ }
+}
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/CompleteTransaction_SupplierTxnProcessor.bpel
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/CompleteTransaction_SupplierTxnProcessor.bpel
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/CompleteTransaction_SupplierTxnProcessor.bpel 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
+<process
xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
xmlns:spr="http://www.pi4soa.org/ESBBroker/Supplier"
xmlns:tns="http://www.pi4soa.org/ESBBroker"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:cay="http://www.pi4soa.org/ESBBroker/CreditAgency"
xmlns:byr="http://www.pi4soa.org/ESBBroker/Buyer"
xmlns:brk="http://www.pi4soa.org/ESBBroker/Broker"
name="CompleteTransaction_SupplierTxnProcessor"
targetNamespace="http://www.pi4soa.org/ESBBroker/Supplier">
+ <import
namespace="http://www.pi4soa.org/ESBBroker/Supplier"
location="CompleteTransaction_SupplierTxnProcessor.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <import
namespace="http://www.pi4soa.org/ESBBroker/Supplier"
location="CompleteTransaction_SupplierTxnProcessorArtifacts.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <partnerLinks>
+ <partnerLink name="BrokerToSupplierTxnProcessor"
partnerLinkType="spr:BrokerToSupplierTxnProcessorServiceLT"
myRole="SupplierTxnProcessor"/>
+ </partnerLinks>
+ <variables>
+ <variable name="confirmRequestVar"
messageType="spr:confirmRequest"/>
+ <variable name="confirmResponseVar"
messageType="spr:confirmResponse"/>
+ </variables>
+ <sequence>
+ <receive partnerLink="BrokerToSupplierTxnProcessor"
portType="spr:SupplierBehavior" operation="confirm"
variable="confirmRequestVar" createInstance="yes"
name="Receive_orderConfirmed"/>
+ <reply partnerLink="BrokerToSupplierTxnProcessor"
portType="spr:SupplierBehavior" operation="confirm"
variable="confirmResponseVar" name="Send_bookingReference"/>
+ </sequence>
+</process>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/ESBBrokerProcess_Broker.bpel
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/ESBBrokerProcess_Broker.bpel
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/ESBBrokerProcess_Broker.bpel 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
+<process
xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
xmlns:spr="http://www.pi4soa.org/ESBBroker/Supplier"
xmlns:tns="http://www.pi4soa.org/ESBBroker"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:cay="http://www.pi4soa.org/ESBBroker/CreditAgency"
xmlns:byr="http://www.pi4soa.org/ESBBroker/Buyer"
xmlns:brk="http://www.pi4soa.org/ESBBroker/Broker"
name="ESBBrokerProcess_Broker"
targetNamespace="http://www.pi4soa.org/ESBBroker/Broker">
+ <import
namespace="http://www.pi4soa.org/ESBBroker/Broker"
location="ESBBrokerProcess_Broker.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <import
namespace="http://www.pi4soa.org/ESBBroker/CreditAgency"
location="ESBBrokerProcess_CreditAgency.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <import
namespace="http://www.pi4soa.org/ESBBroker/Supplier"
location="ESBBrokerProcess_Supplier.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <import
namespace="http://www.pi4soa.org/ESBBroker/Broker"
location="ESBBrokerProcess_BrokerArtifacts.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <partnerLinks>
+ <partnerLink name="BuyerToBroker"
partnerLinkType="brk:BuyerToBrokerServiceLT"
myRole="BrokerBehavior"/>
+ <partnerLink name="BrokerToSupplierQuoteEngine"
partnerLinkType="brk:BrokerToSupplierQuoteEngineLT"
partnerRole="SupplierQuoteEngineRequester"/>
+ <partnerLink name="BrokerToCreditAgency"
partnerLinkType="brk:BrokerToCreditAgencyLT"
partnerRole="CreditAgencyRequester"/>
+ <partnerLink name="BrokerToSupplierTxnProcessor"
partnerLinkType="brk:BrokerToSupplierTxnProcessorLT"
partnerRole="SupplierTxnProcessorRequester"/>
+ </partnerLinks>
+ <variables>
+ <variable name="makeEnquiryRequestVar"
messageType="brk:makeEnquiryRequest"/>
+ <variable name="getQuoteRequestVar"
messageType="spr:getQuoteRequest"/>
+ <variable name="getQuoteResponseVar"
messageType="spr:getQuoteResponse"/>
+ <variable name="makeEnquiryResponseVar"
messageType="brk:makeEnquiryResponse"/>
+ <variable name="checkCreditRequestVar"
messageType="cay:checkCreditRequest"/>
+ <variable name="checkCreditResponseVar"
messageType="cay:checkCreditResponse"/>
+ <variable name="confirmRequestVar"
messageType="spr:confirmRequest"/>
+ <variable name="confirmResponseVar"
messageType="spr:confirmResponse"/>
+ <variable name="buyResponseVar"
messageType="brk:buyResponse"/>
+ <variable name="rejectedFaultVar"
messageType="brk:rejectedFault"/>
+ <variable name="buyRequestVar"
messageType="brk:buyRequest"/>
+ <variable name="cancelRequestVar"
messageType="brk:cancelRequest"/>
+ </variables>
+ <sequence>
+ <receive partnerLink="BuyerToBroker"
portType="brk:BrokerBehavior" operation="makeEnquiry"
variable="makeEnquiryRequestVar" createInstance="yes"
name="Receive_enquiry"/>
+ <while>
+ <sequence>
+ <scope>
+ <sequence>
+ <invoke partnerLink="BrokerToSupplierQuoteEngine"
portType="spr:SupplierBehavior" operation="getQuote"
inputVariable="getQuoteRequestVar"
outputVariable="getQuoteResponseVar" name="Send_requestForQuote"/>
+ </sequence>
+ </scope>
+ </sequence>
+ </while>
+ <reply partnerLink="BuyerToBroker"
portType="brk:BrokerBehavior" operation="makeEnquiry"
variable="makeEnquiryResponseVar" name="Send_quoteList"/>
+ <pick>
+ <onMessage partnerLink="BuyerToBroker"
portType="brk:BrokerBehavior" operation="buy"
variable="buyRequestVar">
+ <sequence>
+ <scope>
+ <faultHandlers>
+ <catch faultName="cay:invalidCredit"
faultVariable="invalidCreditFaultVar"
faultMessageType="cay:invalidCreditFault">
+<sequence>
+ <reply partnerLink="BuyerToBroker"
portType="brk:BrokerBehavior" operation="buy"
variable="rejectedFaultVar" faultName="brk:rejected"
name="Send_orderRejected"/>
+</sequence>
+ </catch>
+ </faultHandlers>
+ <sequence>
+ <invoke partnerLink="BrokerToCreditAgency"
portType="cay:CreditAgencyBehavior" operation="checkCredit"
inputVariable="checkCreditRequestVar"
outputVariable="checkCreditResponseVar"
name="Send_CreditCheckRequest"/>
+ <invoke
partnerLink="BrokerToSupplierTxnProcessor"
portType="spr:SupplierBehavior" operation="confirm"
inputVariable="confirmRequestVar" outputVariable="confirmResponseVar"
name="Send_orderConfirmed"/>
+ <reply partnerLink="BuyerToBroker"
portType="brk:BrokerBehavior" operation="buy"
variable="buyResponseVar" name="Send_bookingReference"/>
+ </sequence>
+ </scope>
+ </sequence>
+ </onMessage>
+ <onMessage partnerLink="BuyerToBroker"
portType="brk:BrokerBehavior" operation="cancel"
variable="cancelRequestVar">
+ <sequence/>
+ </onMessage>
+ </pick>
+ </sequence>
+</process>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/ESBBrokerProcess_Buyer.bpel
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/ESBBrokerProcess_Buyer.bpel
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/ESBBrokerProcess_Buyer.bpel 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
+<process
xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
xmlns:spr="http://www.pi4soa.org/ESBBroker/Supplier"
xmlns:tns="http://www.pi4soa.org/ESBBroker"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:cay="http://www.pi4soa.org/ESBBroker/CreditAgency"
xmlns:byr="http://www.pi4soa.org/ESBBroker/Buyer"
xmlns:brk="http://www.pi4soa.org/ESBBroker/Broker"
name="ESBBrokerProcess_Buyer"
targetNamespace="http://www.pi4soa.org/ESBBroker/Buyer"
xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable...
+ <import
namespace="http://www.pi4soa.org/ESBBroker/Broker"
location="ESBBrokerProcess_Broker.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <import
namespace="http://www.pi4soa.org/ESBBroker/CreditAgency"
location="ESBBrokerProcess_CreditAgency.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <import
namespace="http://www.pi4soa.org/ESBBroker/Supplier"
location="ESBBrokerProcess_Supplier.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <import
namespace="http://www.pi4soa.org/ESBBroker/Buyer"
location="ESBBrokerProcess_BuyerArtifacts.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <partnerLinks>
+ <partnerLink name="BuyerToBroker"
partnerLinkType="byr:BuyerToBrokerLT" partnerRole="BrokerRequester"
myRole="Buyer"/>
+ </partnerLinks>
+ <variables>
+ <variable name="makeEnquiryRequestVar"
messageType="brk:makeEnquiryRequest"/>
+ <variable name="makeEnquiryResponseVar"
messageType="brk:makeEnquiryResponse"/>
+ <variable name="buyRequestVar"
messageType="byr:buyRequest"/>
+ <variable name="buyResponseVar"
messageType="brk:buyResponse"/>
+ <variable name="cancelRequestVar"
messageType="byr:cancelRequest"/>
+ </variables>
+ <sequence>
+ <invoke partnerLink="BuyerToBroker"
portType="brk:BrokerBehavior" operation="makeEnquiry"
inputVariable="makeEnquiryRequestVar"
outputVariable="makeEnquiryResponseVar" name="Send_enquiry"/>
+ <if>
+ <sequence>
+ <scope>
+ <faultHandlers>
+ <catch faultName="brk:rejected"
faultVariable="rejectedFaultVar"
faultMessageType="brk:rejectedFault">
+ <sequence/>
+ </catch>
+ </faultHandlers>
+ <sequence>
+ <invoke partnerLink="BuyerToBroker"
portType="byr:BuyerBehavior" operation="buy"
inputVariable="buyRequestVar" outputVariable="buyResponseVar"
name="Send_buy"/>
+ </sequence>
+ </scope>
+ </sequence>
+ <else>
+ <sequence>
+ <invoke partnerLink="BuyerToBroker"
portType="byr:BuyerBehavior" operation="cancel"
inputVariable="cancelRequestVar" name="Send_cancel"/>
+ </sequence>
+ </else>
+ </if>
+ </sequence>
+</process>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/ESBBrokerProcess_CreditAgency.bpel
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/ESBBrokerProcess_CreditAgency.bpel
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/ESBBrokerProcess_CreditAgency.bpel 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
+<process
xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
xmlns:spr="http://www.pi4soa.org/ESBBroker/Supplier"
xmlns:tns="http://www.pi4soa.org/ESBBroker"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:cay="http://www.pi4soa.org/ESBBroker/CreditAgency"
xmlns:byr="http://www.pi4soa.org/ESBBroker/Buyer"
xmlns:brk="http://www.pi4soa.org/ESBBroker/Broker"
name="ESBBrokerProcess_CreditAgency"
targetNamespace="http://www.pi4soa.org/ESBBroker/CreditAgency">
+ <import
namespace="http://www.pi4soa.org/ESBBroker/CreditAgency"
location="ESBBrokerProcess_CreditAgency.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <import
namespace="http://www.pi4soa.org/ESBBroker/Broker"
location="ESBBrokerProcess_Broker.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <import
namespace="http://www.pi4soa.org/ESBBroker/Supplier"
location="ESBBrokerProcess_Supplier.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <import
namespace="http://www.pi4soa.org/ESBBroker/Supplier"
location="ESBBrokerProcess_SupplierTxnProcessor.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <import
namespace="http://www.pi4soa.org/ESBBroker/CreditAgency"
location="ESBBrokerProcess_CreditAgencyArtifacts.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <partnerLinks>
+ <partnerLink name="BrokerToCreditAgency"
partnerLinkType="cay:BrokerToCreditAgencyServiceLT"
myRole="CreditAgency"/>
+ </partnerLinks>
+ <variables>
+ <variable name="checkCreditRequestVar"
messageType="cay:checkCreditRequest"/>
+ <variable name="checkCreditResponseVar"
messageType="cay:checkCreditResponse"/>
+ <variable name="invalidCreditFaultVar"
messageType="cay:invalidCreditFault"/>
+ </variables>
+ <sequence>
+ <receive partnerLink="BrokerToCreditAgency"
portType="cay:CreditAgencyBehavior" operation="checkCredit"
variable="checkCreditRequestVar" createInstance="yes"
name="Receive_CreditCheckRequest"/>
+ <if>
+ <sequence>
+ <reply partnerLink="BrokerToCreditAgency"
portType="cay:CreditAgencyBehavior" operation="checkCredit"
variable="checkCreditResponseVar" name="Send_CreditCheckOk"/>
+ </sequence>
+ <else>
+ <sequence>
+ <reply partnerLink="BrokerToCreditAgency"
portType="cay:CreditAgencyBehavior" operation="checkCredit"
variable="invalidCreditFaultVar" faultName="cay:invalidCredit"
name="Send_CreditCheckInvalid"/>
+ </sequence>
+ </else>
+ </if>
+ </sequence>
+</process>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/LoanApprovalService(a)Service.bpel
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/LoanApprovalService(a)Service.bpel
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/LoanApprovalService(a)Service.bpel 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,123 @@
+<process name="loanApprovalProcess"
+
targetNamespace="http://example.com/loan-approval/"
+
xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
+
xmlns:lns="http://example.com/loan-approval/wsdl/"
+ suppressJoinFailure="yes">
+ <import
importType="http://schemas.xmlsoap.org/wsdl/"
+ location="loanServicePT.wsdl"
+
namespace="http://example.com/loan-approval/wsdl/" />
+ <partnerLinks>
+ <partnerLink name="customer"
+ partnerLinkType="lns:loanPartnerLT"
+ myRole="loanService" />
+ <partnerLink name="approver"
+ partnerLinkType="lns:loanApprovalLT"
+ partnerRole="approver" />
+ <partnerLink name="assessor"
+ partnerLinkType="lns:riskAssessmentLT"
+ partnerRole="assessor" />
+ </partnerLinks>
+ <variables>
+ <variable name="request"
+ messageType="lns:creditInformationMessage" />
+ <variable name="risk"
+ messageType="lns:riskAssessmentMessage" />
+ <variable name="approval"
+ messageType="lns:approvalMessage" />
+ </variables>
+ <faultHandlers>
+ <catch faultName="lns:loanProcessFault"
+ faultVariable="error"
+ faultMessageType="lns:errorMessage">
+ <reply partnerLink="customer"
+ portType="lns:loanServicePT"
+ operation="request" variable="error"
+ faultName="unableToHandleRequest" />
+ </catch>
+ </faultHandlers>
+ <flow>
+ <links>
+ <link name="receive-to-assess" />
+ <link name="receive-to-approval" />
+ <link name="approval-to-reply" />
+ <link name="assess-to-setMessage" />
+ <link name="setMessage-to-reply" />
+ <link name="assess-to-approval" />
+ </links>
+ <receive partnerLink="customer"
+ portType="lns:loanServicePT"
+ operation="request"
+ variable="request"
+ createInstance="yes">
+ <sources>
+ <source linkName="receive-to-assess">
+ <transitionCondition>
+ $request.amount < 10000
+ </transitionCondition>
+ </source>
+ <source linkName="receive-to-approval">
+ <transitionCondition>
+ $request.amount >= 10000
+ </transitionCondition>
+ </source>
+ </sources>
+ </receive>
+ <invoke partnerLink="assessor"
+ portType="lns:riskAssessmentPT"
+ operation="check"
+ inputVariable="request"
+ outputVariable="risk">
+ <targets>
+ <target linkName="receive-to-assess" />
+ </targets>
+ <sources>
+ <source linkName="assess-to-setMessage">
+ <transitionCondition>
+ $risk.level='low'
+ </transitionCondition>
+ </source>
+ <source linkName="assess-to-approval">
+ <transitionCondition>
+ $risk.level!='low'
+ </transitionCondition>
+ </source>
+ </sources>
+ </invoke>
+ <assign>
+ <targets>
+ <target linkName="assess-to-setMessage" />
+ </targets>
+ <sources>
+ <source linkName="setMessage-to-reply" />
+ </sources>
+ <copy>
+ <from>
+ <literal>yes</literal>
+ </from>
+ <to variable="approval" part="accept" />
+ </copy>
+ </assign>
+ <invoke partnerLink="approver"
+ portType="lns:loanApprovalPT"
+ operation="approve"
+ inputVariable="request"
+ outputVariable="approval">
+ <targets>
+ <target linkName="receive-to-approval" />
+ <target linkName="assess-to-approval" />
+ </targets>
+ <sources>
+ <source linkName="approval-to-reply" />
+ </sources>
+ </invoke>
+ <reply partnerLink="customer"
+ portType="lns:loanServicePT"
+ operation="request"
+ variable="approval">
+ <targets>
+ <target linkName="setMessage-to-reply" />
+ <target linkName="approval-to-reply" />
+ </targets>
+ </reply>
+ </flow>
+</process>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/PurchaseGoodsProcess_Buyer.bpel
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/PurchaseGoodsProcess_Buyer.bpel
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/PurchaseGoodsProcess_Buyer.bpel 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
+<process
xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
xmlns:tns="http://www.jboss.org/savara/examples"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sto="http://www.jboss.org/examples/store"
xmlns:pur="java:org.jboss.savara.examples.purchasing"
name="PurchaseGoodsProcess_Buyer"
targetNamespace="http://www.jboss.org/savara/examples"
xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable...
+ <import namespace="java:org.jboss.savara.examples.purchasing"
location="PurchaseGoodsProcess_CreditAgency.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <import
namespace="http://www.jboss.org/examples/store"
location="PurchaseGoodsProcess_Store.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <import
namespace="http://www.jboss.org/savara/examples"
location="PurchaseGoodsProcess_BuyerArtifacts.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <partnerLinks>
+ <partnerLink name="BuyerToStore" myRole="Buyer"
partnerLinkType="tns:BuyerToStoreLT"
partnerRole="StoreRequester"/>
+ </partnerLinks>
+ <variables>
+ <variable name="buyRequestVar"
messageType="sto:buyRequest"/>
+ <variable name="buyResponseVar"
messageType="sto:buyResponse"/>
+ </variables>
+ <sequence>
+ <scope>
+ <faultHandlers>
+ <catch faultName="sto:BuyFailed"
faultVariable="BuyFailedFaultVar"
faultMessageType="sto:BuyFailedFault">
+ <sequence/>
+ </catch>
+ </faultHandlers>
+ <sequence>
+ <invoke partnerLink="BuyerToStore"
portType="sto:StoreInterface" operation="buy"
inputVariable="buyRequestVar" outputVariable="buyResponseVar"
name="Send_BuyRequest"/>
+ </sequence>
+ </scope>
+ </sequence>
+</process>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/PurchaseGoodsProcess_CreditAgency.bpel
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/PurchaseGoodsProcess_CreditAgency.bpel
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/PurchaseGoodsProcess_CreditAgency.bpel 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
+<process
xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
xmlns:tns="http://www.jboss.org/savara/examples"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sto="http://www.jboss.org/examples/store"
xmlns:pur="java:org.jboss.savara.examples.purchasing"
name="PurchaseGoodsProcess_CreditAgency"
targetNamespace="java:org.jboss.savara.examples.purchasing">
+ <import namespace="java:org.jboss.savara.examples.purchasing"
location="PurchaseGoodsProcess_CreditAgency.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <import
namespace="http://www.jboss.org/examples/store"
location="PurchaseGoodsProcess_Store.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <import namespace="java:org.jboss.savara.examples.purchasing"
location="PurchaseGoodsProcess_CreditAgencyArtifacts.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <partnerLinks>
+ <partnerLink name="StoreToCreditAgency"
partnerLinkType="pur:StoreToCreditAgencyServiceLT"
myRole="CreditAgencyInterface"/>
+ </partnerLinks>
+ <variables>
+ <variable name="checkCreditRequestVar"
messageType="pur:checkCreditRequest"/>
+ <variable name="checkCreditResponseVar"
messageType="pur:checkCreditResponse"/>
+ <variable name="CreditCheckFailedFaultVar"
messageType="pur:CreditCheckFailedFault"/>
+ </variables>
+ <sequence>
+ <receive partnerLink="StoreToCreditAgency"
portType="pur:CreditAgencyInterface" operation="checkCredit"
variable="checkCreditRequestVar" createInstance="yes"
name="Receive_CreditCheckRequest"/>
+ <if>
+ <sequence>
+ <reply partnerLink="StoreToCreditAgency"
portType="pur:CreditAgencyInterface" operation="checkCredit"
variable="checkCreditResponseVar" name="Send_CreditCheckOk"/>
+ </sequence>
+ <else>
+ <sequence>
+ <reply partnerLink="StoreToCreditAgency"
portType="pur:CreditAgencyInterface" operation="checkCredit"
variable="CreditCheckFailedFaultVar" faultName="pur:CreditCheckFailed"
name="Send_CreditCheckInvalid"/>
+ </sequence>
+ </else>
+ </if>
+ </sequence>
+</process>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/PurchaseGoodsProcess_Store.bpel
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/PurchaseGoodsProcess_Store.bpel
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/PurchaseGoodsProcess_Store.bpel 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
+<process
xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
xmlns:tns="http://www.jboss.org/savara/examples"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sto="http://www.jboss.org/examples/store"
xmlns:pur="java:org.jboss.savara.examples.purchasing"
name="PurchaseGoodsProcess_Store"
targetNamespace="http://www.jboss.org/examples/store">
+ <import
namespace="http://www.jboss.org/examples/store"
location="PurchaseGoodsProcess_Store.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <import namespace="java:org.jboss.savara.examples.purchasing"
location="PurchaseGoodsProcess_CreditAgency.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <import
namespace="http://www.jboss.org/examples/store"
location="PurchaseGoodsProcess_StoreArtifacts.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <partnerLinks>
+ <partnerLink name="BuyerToStore"
partnerLinkType="sto:BuyerToStoreServiceLT"
myRole="StoreInterface"/>
+ <partnerLink name="StoreToCreditAgency"
partnerLinkType="sto:StoreToCreditAgencyLT"
partnerRole="CreditAgencyRequester"/>
+ </partnerLinks>
+ <variables>
+ <variable name="buyRequestVar"
messageType="sto:buyRequest"/>
+ <variable name="checkCreditRequestVar"
messageType="pur:checkCreditRequest"/>
+ <variable name="checkCreditResponseVar"
messageType="pur:checkCreditResponse"/>
+ <variable name="buyResponseVar"
messageType="sto:buyResponse"/>
+ <variable name="BuyFailedFaultVar"
messageType="sto:BuyFailedFault"/>
+ </variables>
+ <sequence>
+ <receive partnerLink="BuyerToStore"
portType="sto:StoreInterface" operation="buy"
variable="buyRequestVar" createInstance="yes"
name="Receive_BuyRequest"/>
+ <scope>
+ <faultHandlers>
+ <catch faultName="pur:CreditCheckFailed"
faultVariable="CreditCheckFailedFaultVar"
faultMessageType="pur:CreditCheckFailedFault">
+ <sequence>
+ <reply partnerLink="BuyerToStore"
portType="sto:StoreInterface" operation="buy"
variable="BuyFailedFaultVar" faultName="sto:BuyFailed"
name="Send_BuyFailed"/>
+ </sequence>
+ </catch>
+ </faultHandlers>
+ <sequence>
+ <invoke partnerLink="StoreToCreditAgency"
portType="pur:CreditAgencyInterface" operation="checkCredit"
inputVariable="checkCreditRequestVar"
outputVariable="checkCreditResponseVar"
name="Send_CreditCheckRequest"/>
+ <reply partnerLink="BuyerToStore"
portType="sto:StoreInterface" operation="buy"
variable="buyResponseVar" name="Send_BuyConfirmed"/>
+ </sequence>
+ </scope>
+ </sequence>
+</process>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/ReqRespFaultProcess_Buyer.bpel
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/ReqRespFaultProcess_Buyer.bpel
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/ReqRespFaultProcess_Buyer.bpel 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
+<process
xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
xmlns:tns="http://www.pi4soa.org/ReqRespFault"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:byr="http://www.pi4soa.org/ReqRespFault/Buyer"
xmlns:slr="http://www.pi4soa.org/ReqRespFault/Seller"
name="ReqRespFaultProcess_Buyer"
targetNamespace="http://www.pi4soa.org/ReqRespFault/Buyer">
+ <import
namespace="http://www.pi4soa.org/ReqRespFault/Seller"
location="ReqRespFaultProcess_Seller.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <import
namespace="http://www.pi4soa.org/ReqRespFault/Buyer"
location="ReqRespFaultProcess_BuyerArtifacts.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <partnerLinks>
+ <partnerLink name="BuyerToSeller"
partnerLinkType="byr:BuyerToSellerLT"
partnerRole="SellerRequester"/>
+ </partnerLinks>
+ <variables>
+ <variable name="checkCreditRequestVar"
messageType="slr:checkCreditRequest"/>
+ <variable name="checkCreditResponseVar"
messageType="slr:checkCreditResponse"/>
+ </variables>
+ <sequence>
+ <scope>
+ <faultHandlers>
+ <catch faultName="slr:insufficientCredit"
faultVariable="insufficientCreditFaultVar"
faultMessageType="slr:insufficientCreditFault">
+ <sequence/>
+ </catch>
+ </faultHandlers>
+ <sequence>
+ <invoke partnerLink="BuyerToSeller"
portType="slr:SellerBehavior" operation="checkCredit"
inputVariable="checkCreditRequestVar"
outputVariable="checkCreditResponseVar"
name="Send_CreditCheckRequest"/>
+ </sequence>
+ </scope>
+ </sequence>
+</process>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/ReqRespFaultProcess_Seller.bpel
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/ReqRespFaultProcess_Seller.bpel
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/ReqRespFaultProcess_Seller.bpel 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
+<process
xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
xmlns:tns="http://www.pi4soa.org/ReqRespFault"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:byr="http://www.pi4soa.org/ReqRespFault/Buyer"
xmlns:slr="http://www.pi4soa.org/ReqRespFault/Seller"
name="ReqRespFaultProcess_Seller"
targetNamespace="http://www.pi4soa.org/ReqRespFault/Seller">
+ <import
namespace="http://www.pi4soa.org/ReqRespFault/Seller"
location="ReqRespFaultProcess_Seller.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <import
namespace="http://www.pi4soa.org/ReqRespFault/Seller"
location="ReqRespFaultProcess_SellerArtifacts.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <partnerLinks>
+ <partnerLink name="BuyerToSeller"
partnerLinkType="slr:BuyerToSellerServiceLT"
myRole="SellerBehavior"/>
+ </partnerLinks>
+ <variables>
+ <variable name="checkCreditRequestVar"
messageType="slr:checkCreditRequest"/>
+ <variable name="checkCreditResponseVar"
messageType="slr:checkCreditResponse"/>
+ <variable name="insufficientCreditFaultVar"
messageType="slr:insufficientCreditFault"/>
+ </variables>
+ <sequence>
+ <receive partnerLink="BuyerToSeller"
portType="slr:SellerBehavior" operation="checkCredit"
variable="checkCreditRequestVar" createInstance="yes"
name="Receive_CreditCheckRequest"/>
+ <if>
+ <sequence>
+ <reply partnerLink="BuyerToSeller"
portType="slr:SellerBehavior" operation="checkCredit"
variable="checkCreditResponseVar" name="Send_CreditCheckOk"/>
+ </sequence>
+ <else>
+ <sequence>
+ <reply partnerLink="BuyerToSeller"
portType="slr:SellerBehavior" operation="checkCredit"
variable="insufficientCreditFaultVar"
faultName="slr:insufficientCredit"
name="Send_CreditCheckInvalid"/>
+ </sequence>
+ </else>
+ </if>
+ </sequence>
+</process>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/RequestForQuote_SupplierQuoteEngine.bpel
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/RequestForQuote_SupplierQuoteEngine.bpel
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/bpel/RequestForQuote_SupplierQuoteEngine.bpel 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
+<process
xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
xmlns:spr="http://www.pi4soa.org/ESBBroker/Supplier"
xmlns:tns="http://www.pi4soa.org/ESBBroker"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:cay="http://www.pi4soa.org/ESBBroker/CreditAgency"
xmlns:byr="http://www.pi4soa.org/ESBBroker/Buyer"
xmlns:brk="http://www.pi4soa.org/ESBBroker/Broker"
name="RequestForQuote_SupplierQuoteEngine"
targetNamespace="http://www.pi4soa.org/ESBBroker/Supplier"
xmlns:bpel="http://docs.oasis-open.org/wsbpel/2.0/process/executable...
+ <import
namespace="http://www.pi4soa.org/ESBBroker/Supplier"
location="RequestForQuote_SupplierQuoteEngine.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <import
namespace="http://www.pi4soa.org/ESBBroker/Supplier"
location="RequestForQuote_SupplierQuoteEngineArtifacts.wsdl"
importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <partnerLinks>
+ <partnerLink name="BrokerToSupplierQuoteEngine"
partnerLinkType="spr:BrokerToSupplierQuoteEngineServiceLT"
myRole="SupplierBehavior"/>
+ </partnerLinks>
+ <variables>
+ <variable name="getQuoteRequestVar"
messageType="spr:getQuoteRequest"/>
+ <variable name="getQuoteResponseVar"
messageType="spr:getQuoteResponse"/>
+ </variables>
+ <sequence>
+ <receive partnerLink="BrokerToSupplierQuoteEngine"
portType="spr:SupplierBehavior" operation="getQuote"
variable="getQuoteRequestVar" createInstance="yes"
name="Receive_requestForQuote"/>
+ <reply partnerLink="BrokerToSupplierQuoteEngine"
portType="spr:SupplierBehavior" operation="getQuote"
variable="getQuoteResponseVar" name="Send_quote"/>
+ </sequence>
+</process>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/protocol/ESBBroker.spr
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/protocol/ESBBroker.spr
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/protocol/ESBBroker.spr 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,91 @@
+[[
Type(prefix=tns,namespace=http://www.pi4soa.org/ESBBroker) ]]
+[[
Type(prefix=xsd,namespace=http://www.w3.org/2001/XMLSchema) ]]
+[[
Type(prefix=brk,namespace=http://www.pi4soa.org/ESBBroker/Broker) ]]
+[[
Type(prefix=byr,namespace=http://www.pi4soa.org/ESBBroker/Buyer) ]]
+[[
Type(prefix=cay,namespace=http://www.pi4soa.org/ESBBroker/CreditAgency) ]]
+[[
Type(prefix=spr,namespace=http://www.pi4soa.org/ESBBroker/Supplier) ]]
+protocol ESBBrokerProcess {
+ role Broker, Buyer, CreditAgency, Supplier;
+ [[
Interface(name={http://www.pi4soa.org/ESBBroker}BrokerBehavior) ]]
+ [[ Correlation(request=makeEnquiry) ]]
+ makeEnquiry(Enquiry) from Buyer to Broker;
+ repeat {
+ run RequestForQuote(Broker);
+ }
+ [[
Interface(name={http://www.pi4soa.org/ESBBroker}BrokerBehavior) ]]
+ [[ Correlation(replyTo=makeEnquiry) ]]
+ makeEnquiry(QuoteList) from Broker to Buyer;
+ choice from Buyer to Broker {
+ [[ Correlation(request=buy) ]]
+ buy(Buy):
+ role SupplierTxnProcessor;
+ [[
Interface(name={http://www.pi4soa.org/ESBBroker}CreditAgencyBehavior) ]]
+ [[ Correlation(request=checkCredit) ]]
+ checkCredit(CreditInformation) from Broker to CreditAgency;
+ choice from CreditAgency to Broker {
+ [[ Correlation(replyTo=checkCredit) ]]
+ checkCredit(CreditValid):
+ [[
Interface(name={http://www.pi4soa.org/ESBBroker}SupplierBehavior) ]]
+ [[ Correlation(request=confirm) ]]
+ confirm(OrderConfirmed) from Broker to SupplierTxnProcessor;
+ [[
Interface(name={http://www.pi4soa.org/ESBBroker}SupplierBehavior) ]]
+ [[ Correlation(replyTo=confirm) ]]
+ confirm(BookingReference) from SupplierTxnProcessor to Broker;
+ [[
Interface(name={http://www.pi4soa.org/ESBBroker}BrokerBehavior) ]]
+ [[ Correlation(replyTo=buy) ]]
+ buy(BookingReference) from Broker to Buyer;
+
+ [[ Fault(name=invalidCredit) ]]
+ [[ Correlation(replyTo=checkCredit) ]]
+ checkCredit(CreditInvalid):
+ [[ Fault(name=rejected) ]]
+ [[
Interface(name={http://www.pi4soa.org/ESBBroker}BrokerBehavior) ]]
+ [[ Correlation(replyTo=buy) ]]
+ buy(OrderRejected) from Broker to Buyer;
+
+ }
+
+ cancel(Cancel):
+
+ }
+ protocol CompleteTransaction(role Buyer, role Broker, role CreditAgency) {
+ role SupplierTxnProcessor;
+ [[
Interface(name={http://www.pi4soa.org/ESBBroker}BrokerBehavior) ]]
+ [[ Correlation(request=buy) ]]
+ buy(Buy) from Buyer to Broker;
+ [[
Interface(name={http://www.pi4soa.org/ESBBroker}CreditAgencyBehavior) ]]
+ [[ Correlation(request=checkCredit) ]]
+ checkCredit(CreditInformation) from Broker to CreditAgency;
+ choice from CreditAgency to Broker {
+ [[ Correlation(replyTo=checkCredit) ]]
+ checkCredit(CreditValid):
+ [[
Interface(name={http://www.pi4soa.org/ESBBroker}SupplierBehavior) ]]
+ [[ Correlation(request=confirm) ]]
+ confirm(OrderConfirmed) from Broker to SupplierTxnProcessor;
+ [[
Interface(name={http://www.pi4soa.org/ESBBroker}SupplierBehavior) ]]
+ [[ Correlation(replyTo=confirm) ]]
+ confirm(BookingReference) from SupplierTxnProcessor to Broker;
+ [[
Interface(name={http://www.pi4soa.org/ESBBroker}BrokerBehavior) ]]
+ [[ Correlation(replyTo=buy) ]]
+ buy(BookingReference) from Broker to Buyer;
+
+ [[ Fault(name=invalidCredit) ]]
+ [[ Correlation(replyTo=checkCredit) ]]
+ checkCredit(CreditInvalid):
+ [[ Fault(name=rejected) ]]
+ [[
Interface(name={http://www.pi4soa.org/ESBBroker}BrokerBehavior) ]]
+ [[ Correlation(replyTo=buy) ]]
+ buy(OrderRejected) from Broker to Buyer;
+
+ }
+ }
+ protocol RequestForQuote(role Broker) {
+ role SupplierQuoteEngine;
+ [[
Interface(name={http://www.pi4soa.org/ESBBroker}SupplierBehavior) ]]
+ [[ Correlation(request=getQuote) ]]
+ getQuote(RequestForQuote) from Broker to SupplierQuoteEngine;
+ [[
Interface(name={http://www.pi4soa.org/ESBBroker}SupplierBehavior) ]]
+ [[ Correlation(replyTo=getQuote) ]]
+ getQuote(Quote) from SupplierQuoteEngine to Broker;
+ }
+}
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/protocol/PurchaseGoods.spr
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/protocol/PurchaseGoods.spr
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/protocol/PurchaseGoods.spr 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,29 @@
+[[
Type(prefix=tns,namespace=http://www.jboss.org/savara/examples) ]]
+[[
Type(prefix=xsd,namespace=http://www.w3.org/2001/XMLSchema) ]]
+[[ Type(prefix=pur,namespace=java:org.jboss.savara.examples.purchasing) ]]
+[[
Type(prefix=sto,namespace=http://www.jboss.org/examples/store) ]]
+protocol PurchaseGoodsProcess {
+ role Buyer, CreditAgency, Store;
+ [[
Interface(name={http://www.jboss.org/examples/store}StoreInterface) ]]
+ [[ Correlation(request=buy) ]]
+ buy(BuyRequest) from Buyer to Store;
+ [[ Interface(name={java:org.jboss.savara.examples.purchasing}CreditAgencyInterface) ]]
+ [[ Correlation(request=checkCredit) ]]
+ checkCredit(CreditCheckRequest) from Store to CreditAgency;
+ choice from CreditAgency to Store {
+ [[ Correlation(replyTo=checkCredit) ]]
+ checkCredit(CreditCheckOk):
+ [[
Interface(name={http://www.jboss.org/examples/store}StoreInterface) ]]
+ [[ Correlation(replyTo=buy) ]]
+ buy(BuyConfirmed) from Store to Buyer;
+
+ [[ Fault(name=CreditCheckFailed) ]]
+ [[ Correlation(replyTo=checkCredit) ]]
+ checkCredit(CreditCheckInvalid):
+ [[ Fault(name=BuyFailed) ]]
+ [[
Interface(name={http://www.jboss.org/examples/store}StoreInterface) ]]
+ [[ Correlation(replyTo=buy) ]]
+ buy(BuyFailed) from Store to Buyer;
+
+ }
+}
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/protocol/ReqRespFault.spr
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/protocol/ReqRespFault.spr
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/protocol/ReqRespFault.spr 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,19 @@
+[[
Type(prefix=tns,namespace=http://www.pi4soa.org/ReqRespFault) ]]
+[[
Type(prefix=xsd,namespace=http://www.w3.org/2001/XMLSchema) ]]
+[[
Type(prefix=byr,namespace=http://www.pi4soa.org/ReqRespFault/Buyer) ]]
+[[
Type(prefix=slr,namespace=http://www.pi4soa.org/ReqRespFault/Seller) ]]
+protocol ReqRespFaultProcess {
+ role Buyer, Seller;
+ [[
Interface(name={http://www.pi4soa.org/ReqRespFault}SellerBehavior) ]]
+ [[ Correlation(request=checkCredit) ]]
+ checkCredit(CreditInformation) from Buyer to Seller;
+ choice from Seller to Buyer {
+ [[ Correlation(replyTo=checkCredit) ]]
+ checkCredit(CreditValid):
+
+ [[ Fault(name=insufficientCredit) ]]
+ [[ Correlation(replyTo=checkCredit) ]]
+ checkCredit(CreditInvalid):
+
+ }
+}
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/CompleteTransaction_SupplierTxnProcessor.wsdl
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/CompleteTransaction_SupplierTxnProcessor.wsdl
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/CompleteTransaction_SupplierTxnProcessor.wsdl 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="no"?>
+<wsdl:definitions
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:brk="http://www.pi4soa.org/ESBBroker/Broker"
xmlns:byr="http://www.pi4soa.org/ESBBroker/Buyer"
xmlns:cay="http://www.pi4soa.org/ESBBroker/CreditAgency"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:spr="http://www.pi4soa.org/ESBBroker/Supplier"
xmlns:tns="http://www.pi4soa.org/ESBBroker"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Supplier"
targetNamespace="http://www.pi4soa.org/ESBBroker/Supplier">
+ <types
xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <schema
xmlns="http://www.w3.org/2001/XMLSchema"/>
+ </types>
+ <wsdl:message name="confirmRequest">
+ <wsdl:part element="orderConfirmed" name="content">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="confirmResponse">
+ <wsdl:part element="bookingReference" name="content">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="getQuoteResponse">
+ <wsdl:part element="quote" name="content">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="getQuoteRequest">
+ <wsdl:part element="requestForQuote" name="content">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:portType name="SupplierBehavior">
+ <wsdl:operation name="confirm">
+ <wsdl:input message="spr:confirmRequest">
+ </wsdl:input>
+ <wsdl:output message="spr:confirmResponse">
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="getQuote">
+ <wsdl:input message="spr:getQuoteRequest">
+ </wsdl:input>
+ <wsdl:output message="spr:getQuoteResponse">
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="SupplierBehaviorBinding"
type="spr:SupplierBehavior">
+ <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="confirm">
+ <soap:operation
soapAction="http://www.pi4soa.org/ESBBroker/Supplier/confirm"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="getQuote">
+ <soap:operation
soapAction="http://www.pi4soa.org/ESBBroker/Supplier/getQuote"/...
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="SupplierService">
+ <wsdl:port binding="spr:SupplierBehaviorBinding"
name="SupplierBehaviorPort">
+ <soap:address
location="http://localhost:8080/SupplierService/SupplierBehaviorPort"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/CompleteTransaction_SupplierTxnProcessorArtifacts.wsdl
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/CompleteTransaction_SupplierTxnProcessorArtifacts.wsdl
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/CompleteTransaction_SupplierTxnProcessorArtifacts.wsdl 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="no"?>
+<wsdl:definitions
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:ns1="http://www.pi4soa.org/ESBBroker/Supplier"
xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
targetNamespace="http://www.pi4soa.org/ESBBroker/Supplier">
+ <wsdl:import location="CompleteTransaction_SupplierTxnProcessor.wsdl"
namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
+ <plnk:partnerLinkType name="BrokerToSupplierTxnProcessorServiceLT">
+ <plnk:role name="SupplierTxnProcessorService"
portType="ns1:SupplierBehavior"/>
+ </plnk:partnerLinkType>
+</wsdl:definitions>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/ESBBrokerProcess_Broker.wsdl
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/ESBBrokerProcess_Broker.wsdl
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/ESBBrokerProcess_Broker.wsdl 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="no"?>
+<wsdl:definitions
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:brk="http://www.pi4soa.org/ESBBroker/Broker"
xmlns:byr="http://www.pi4soa.org/ESBBroker/Buyer"
xmlns:cay="http://www.pi4soa.org/ESBBroker/CreditAgency"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:spr="http://www.pi4soa.org/ESBBroker/Supplier"
xmlns:tns="http://www.pi4soa.org/ESBBroker"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Broker"
targetNamespace="http://www.pi4soa.org/ESBBroker/Broker">
+ <types
xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <schema
xmlns="http://www.w3.org/2001/XMLSchema"/>
+ </types>
+ <wsdl:message name="rejectedFault">
+ <wsdl:part element="orderRejected" name="content">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="makeEnquiryRequest">
+ <wsdl:part element="enquiry" name="content">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="buyResponse">
+ <wsdl:part element="bookingReference" name="content">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="makeEnquiryResponse">
+ <wsdl:part element="quoteList" name="content">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="buyRequest">
+ <wsdl:part element="buy" name="content">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="cancelRequest">
+ <wsdl:part element="cancel" name="content">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:portType name="BrokerBehavior">
+ <wsdl:operation name="buy">
+ <wsdl:input message="brk:buyRequest">
+ </wsdl:input>
+ <wsdl:output message="brk:buyResponse">
+ </wsdl:output>
+ <wsdl:fault message="brk:rejectedFault"
name="rejected">
+ </wsdl:fault>
+ </wsdl:operation>
+ <wsdl:operation name="makeEnquiry">
+ <wsdl:input message="brk:makeEnquiryRequest">
+ </wsdl:input>
+ <wsdl:output message="brk:makeEnquiryResponse">
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="cancel">
+ <wsdl:input message="brk:cancelRequest">
+ </wsdl:input>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="BrokerBehaviorBinding"
type="brk:BrokerBehavior">
+ <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="buy">
+ <soap:operation
soapAction="http://www.pi4soa.org/ESBBroker/Broker/buy"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ <wsdl:fault name="rejected">
+ <soap:fault name="rejected" use="literal"/>
+ </wsdl:fault>
+ </wsdl:operation>
+ <wsdl:operation name="makeEnquiry">
+ <soap:operation
soapAction="http://www.pi4soa.org/ESBBroker/Broker/makeEnquiry"...
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="cancel">
+ <soap:operation
soapAction="http://www.pi4soa.org/ESBBroker/Broker/cancel"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="BrokerService">
+ <wsdl:port binding="brk:BrokerBehaviorBinding"
name="BrokerBehaviorPort">
+ <soap:address
location="http://localhost:8080/BrokerService/BrokerBehaviorPort"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/ESBBrokerProcess_BrokerArtifacts.wsdl
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/ESBBrokerProcess_BrokerArtifacts.wsdl
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/ESBBrokerProcess_BrokerArtifacts.wsdl 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="no"?>
+<wsdl:definitions
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:ns1="http://www.pi4soa.org/ESBBroker/Broker"
xmlns:ns2="http://www.pi4soa.org/ESBBroker/Supplier"
xmlns:ns3="http://www.pi4soa.org/ESBBroker/CreditAgency"
xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
targetNamespace="http://www.pi4soa.org/ESBBroker/Broker">
+ <wsdl:import location="ESBBrokerProcess_Broker.wsdl"
namespace="http://www.pi4soa.org/ESBBroker/Broker"/>
+ <wsdl:import location="ESBBrokerProcess_CreditAgency.wsdl"
namespace="http://www.pi4soa.org/ESBBroker/CreditAgency"/>
+ <wsdl:import location="ESBBrokerProcess_Supplier.wsdl"
namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
+ <plnk:partnerLinkType name="BuyerToBrokerServiceLT">
+ <plnk:role name="BrokerBehavior"
portType="ns1:BrokerBehavior"/>
+ </plnk:partnerLinkType>
+ <plnk:partnerLinkType name="BrokerToSupplierQuoteEngineLT">
+ <plnk:role name="SupplierQuoteEngineRequester"
portType="ns2:SupplierBehavior"/>
+ </plnk:partnerLinkType>
+ <plnk:partnerLinkType name="BrokerToCreditAgencyLT">
+ <plnk:role name="CreditAgencyRequester"
portType="ns3:CreditAgencyBehavior"/>
+ </plnk:partnerLinkType>
+ <plnk:partnerLinkType name="BrokerToSupplierTxnProcessorLT">
+ <plnk:role name="SupplierTxnProcessorRequester"
portType="ns2:SupplierBehavior"/>
+ </plnk:partnerLinkType>
+</wsdl:definitions>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/ESBBrokerProcess_BuyerArtifacts.wsdl
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/ESBBrokerProcess_BuyerArtifacts.wsdl
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/ESBBrokerProcess_BuyerArtifacts.wsdl 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="no"?>
+<wsdl:definitions
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:ns1="http://www.pi4soa.org/ESBBroker/Broker"
xmlns:ns2="http://www.pi4soa.org/ESBBroker/Buyer"
xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
targetNamespace="http://www.pi4soa.org/ESBBroker/Buyer">
+ <!-- >wsdl:import location="ESBBrokerProcess_Buyer.wsdl"
namespace="http://www.pi4soa.org/ESBBroker/Buyer"/ -->
+ <wsdl:import location="ESBBrokerProcess_Broker.wsdl"
namespace="http://www.pi4soa.org/ESBBroker/Broker"/>
+ <wsdl:import location="ESBBrokerProcess_CreditAgency.wsdl"
namespace="http://www.pi4soa.org/ESBBroker/CreditAgency"/>
+ <wsdl:import location="ESBBrokerProcess_Supplier.wsdl"
namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
+ <plnk:partnerLinkType name="BuyerToBrokerLT">
+ <plnk:role name="BrokerRequester"
portType="ns1:BrokerBehavior"/>
+ <plnk:role name="BrokerBehavior"
portType="ns2:BuyerBehavior"/>
+ </plnk:partnerLinkType>
+</wsdl:definitions>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/ESBBrokerProcess_CreditAgency.wsdl
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/ESBBrokerProcess_CreditAgency.wsdl
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/ESBBrokerProcess_CreditAgency.wsdl 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="no"?>
+<wsdl:definitions
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:brk="http://www.pi4soa.org/ESBBroker/Broker"
xmlns:byr="http://www.pi4soa.org/ESBBroker/Buyer"
xmlns:cay="http://www.pi4soa.org/ESBBroker/CreditAgency"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:spr="http://www.pi4soa.org/ESBBroker/Supplier"
xmlns:tns="http://www.pi4soa.org/ESBBroker"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="CreditAgency"
targetNamespace="http://www.pi4soa.org/ESBBroker/CreditAgency">
+ <types
xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <schema
xmlns="http://www.w3.org/2001/XMLSchema"/>
+ </types>
+ <wsdl:message name="checkCreditResponse">
+ <wsdl:part element="CreditCheckOk" name="content">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="checkCreditRequest">
+ <wsdl:part element="CreditCheckRequest"
name="content">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="invalidCreditFault">
+ <wsdl:part element="CreditCheckInvalid"
name="content">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:portType name="CreditAgencyBehavior">
+ <wsdl:operation name="checkCredit">
+ <wsdl:input message="cay:checkCreditRequest">
+ </wsdl:input>
+ <wsdl:output message="cay:checkCreditResponse">
+ </wsdl:output>
+ <wsdl:fault message="cay:invalidCreditFault"
name="invalidCredit">
+ </wsdl:fault>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="CreditAgencyBehaviorBinding"
type="cay:CreditAgencyBehavior">
+ <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="checkCredit">
+ <soap:operation
soapAction="http://www.pi4soa.org/ESBBroker/CreditAgency/checkCredit...
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ <wsdl:fault name="invalidCredit">
+ <soap:fault name="invalidCredit"
use="literal"/>
+ </wsdl:fault>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="CreditAgencyService">
+ <wsdl:port binding="cay:CreditAgencyBehaviorBinding"
name="CreditAgencyBehaviorPort">
+ <soap:address
location="http://localhost:8080/CreditAgencyService/CreditAgencyBehaviorPort"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/ESBBrokerProcess_CreditAgencyArtifacts.wsdl
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/ESBBrokerProcess_CreditAgencyArtifacts.wsdl
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/ESBBrokerProcess_CreditAgencyArtifacts.wsdl 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="no"?>
+<wsdl:definitions
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:ns1="http://www.pi4soa.org/ESBBroker/CreditAgency"
xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
targetNamespace="http://www.pi4soa.org/ESBBroker/CreditAgency">
+ <wsdl:import location="ESBBrokerProcess_CreditAgency.wsdl"
namespace="http://www.pi4soa.org/ESBBroker/CreditAgency"/>
+ <wsdl:import location="ESBBrokerProcess_Broker.wsdl"
namespace="http://www.pi4soa.org/ESBBroker/Broker"/>
+ <wsdl:import location="ESBBrokerProcess_Supplier.wsdl"
namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
+ <plnk:partnerLinkType name="BrokerToCreditAgencyServiceLT">
+ <plnk:role name="CreditAgencyService"
portType="ns1:CreditAgencyBehavior"/>
+ </plnk:partnerLinkType>
+</wsdl:definitions>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/ESBBrokerProcess_Supplier.wsdl
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/ESBBrokerProcess_Supplier.wsdl
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/ESBBrokerProcess_Supplier.wsdl 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="no"?>
+<wsdl:definitions
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:brk="http://www.pi4soa.org/ESBBroker/Broker"
xmlns:byr="http://www.pi4soa.org/ESBBroker/Buyer"
xmlns:cay="http://www.pi4soa.org/ESBBroker/CreditAgency"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:spr="http://www.pi4soa.org/ESBBroker/Supplier"
xmlns:tns="http://www.pi4soa.org/ESBBroker"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Supplier"
targetNamespace="http://www.pi4soa.org/ESBBroker/Supplier">
+ <types
xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <schema
xmlns="http://www.w3.org/2001/XMLSchema"/>
+ </types>
+ <wsdl:message name="confirmRequest">
+ <wsdl:part element="orderConfirmed" name="content">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="confirmResponse">
+ <wsdl:part element="bookingReference" name="content">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="getQuoteResponse">
+ <wsdl:part element="quote" name="content">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="getQuoteRequest">
+ <wsdl:part element="requestForQuote" name="content">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:portType name="SupplierBehavior">
+ <wsdl:operation name="confirm">
+ <wsdl:input message="spr:confirmRequest">
+ </wsdl:input>
+ <wsdl:output message="spr:confirmResponse">
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="getQuote">
+ <wsdl:input message="spr:getQuoteRequest">
+ </wsdl:input>
+ <wsdl:output message="spr:getQuoteResponse">
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="SupplierBehaviorBinding"
type="spr:SupplierBehavior">
+ <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="confirm">
+ <soap:operation
soapAction="http://www.pi4soa.org/ESBBroker/Supplier/confirm"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="getQuote">
+ <soap:operation
soapAction="http://www.pi4soa.org/ESBBroker/Supplier/getQuote"/...
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="SupplierService">
+ <wsdl:port binding="spr:SupplierBehaviorBinding"
name="SupplierBehaviorPort">
+ <soap:address
location="http://localhost:8080/SupplierService/SupplierBehaviorPort"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/PurchaseGoodsProcess_BuyerArtifacts.wsdl
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/PurchaseGoodsProcess_BuyerArtifacts.wsdl
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/PurchaseGoodsProcess_BuyerArtifacts.wsdl 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="no"?>
+<wsdl:definitions
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:ns1="http://www.jboss.org/examples/store"
xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
targetNamespace="http://www.jboss.org/savara/examples">
+ <wsdl:import location="PurchaseGoodsProcess_Buyer.wsdl"
namespace="http://www.jboss.org/savara/examples"/>
+ <wsdl:import location="PurchaseGoodsProcess_CreditAgency.wsdl"
namespace="java:org.jboss.savara.examples.purchasing"/>
+ <wsdl:import location="PurchaseGoodsProcess_Store.wsdl"
namespace="http://www.jboss.org/examples/store"/>
+ <plnk:partnerLinkType name="BuyerToStoreLT">
+ <plnk:role name="StoreRequester"
portType="ns1:StoreInterface"/>
+ </plnk:partnerLinkType>
+</wsdl:definitions>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/PurchaseGoodsProcess_CreditAgency.wsdl
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/PurchaseGoodsProcess_CreditAgency.wsdl
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/PurchaseGoodsProcess_CreditAgency.wsdl 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="no"?>
+<wsdl:definitions
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:pur="java:org.jboss.savara.examples.purchasing"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:sto="http://www.jboss.org/examples/store"
xmlns:tns="http://www.jboss.org/savara/examples"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="CreditAgency"
targetNamespace="java:org.jboss.savara.examples.purchasing">
+ <types
xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <schema
xmlns="http://www.w3.org/2001/XMLSchema"/>
+ </types>
+ <wsdl:message name="checkCreditRequest">
+ <wsdl:part name="content"
type="pur:CreditCheckRequest">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="CreditCheckFailedFault">
+ <wsdl:part name="content"
type="pur:CreditCheckInvalid">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="checkCreditResponse">
+ <wsdl:part name="content" type="pur:CreditCheckOk">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:portType name="CreditAgencyInterface">
+ <wsdl:operation name="checkCredit">
+ <wsdl:input message="pur:checkCreditRequest">
+ </wsdl:input>
+ <wsdl:output message="pur:checkCreditResponse">
+ </wsdl:output>
+ <wsdl:fault message="pur:CreditCheckFailedFault"
name="CreditCheckFailed">
+ </wsdl:fault>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="CreditAgencyInterfaceBinding"
type="pur:CreditAgencyInterface">
+ <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="checkCredit">
+ <soap:operation
soapAction="java:org.jboss.savara.examples.purchasing/checkCredit"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ <wsdl:fault name="CreditCheckFailed">
+ <soap:fault name="CreditCheckFailed"
use="literal"/>
+ </wsdl:fault>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="CreditAgencyService">
+ <wsdl:port binding="pur:CreditAgencyInterfaceBinding"
name="CreditAgencyInterfacePort">
+ <soap:address
location="http://localhost:8080/CreditAgencyService/CreditAgencyInterfacePort"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/PurchaseGoodsProcess_CreditAgencyArtifacts.wsdl
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/PurchaseGoodsProcess_CreditAgencyArtifacts.wsdl
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/PurchaseGoodsProcess_CreditAgencyArtifacts.wsdl 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="no"?>
+<wsdl:definitions
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:ns1="java:org.jboss.savara.examples.purchasing"
xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
targetNamespace="java:org.jboss.savara.examples.purchasing">
+ <wsdl:import location="PurchaseGoodsProcess_CreditAgency.wsdl"
namespace="java:org.jboss.savara.examples.purchasing"/>
+ <wsdl:import location="PurchaseGoodsProcess_Store.wsdl"
namespace="http://www.jboss.org/examples/store"/>
+ <plnk:partnerLinkType name="StoreToCreditAgencyServiceLT">
+ <plnk:role name="CreditAgencyInterface"
portType="ns1:CreditAgencyInterface"/>
+ </plnk:partnerLinkType>
+</wsdl:definitions>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/PurchaseGoodsProcess_Store.wsdl
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/PurchaseGoodsProcess_Store.wsdl
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/PurchaseGoodsProcess_Store.wsdl 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="no"?>
+<wsdl:definitions
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:pur="java:org.jboss.savara.examples.purchasing"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:sto="http://www.jboss.org/examples/store"
xmlns:tns="http://www.jboss.org/savara/examples"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Store"
targetNamespace="http://www.jboss.org/examples/store">
+ <types
xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <schema
xmlns="http://www.w3.org/2001/XMLSchema"/>
+ </types>
+ <wsdl:message name="BuyFailedFault">
+ <wsdl:part name="content" type="sto:BuyFailed">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="buyRequest">
+ <wsdl:part name="content" type="sto:BuyRequest">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="buyResponse">
+ <wsdl:part name="content" type="sto:BuyConfirmed">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:portType name="StoreInterface">
+ <wsdl:operation name="buy">
+ <wsdl:input message="sto:buyRequest">
+ </wsdl:input>
+ <wsdl:output message="sto:buyResponse">
+ </wsdl:output>
+ <wsdl:fault message="sto:BuyFailedFault"
name="BuyFailed">
+ </wsdl:fault>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="StoreInterfaceBinding"
type="sto:StoreInterface">
+ <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="buy">
+ <soap:operation
soapAction="http://www.jboss.org/examples/store/buy"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ <wsdl:fault name="BuyFailed">
+ <soap:fault name="BuyFailed" use="literal"/>
+ </wsdl:fault>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="StoreService">
+ <wsdl:port binding="sto:StoreInterfaceBinding"
name="StoreInterfacePort">
+ <soap:address
location="http://localhost:8080/StoreService/StoreInterfacePort"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/PurchaseGoodsProcess_StoreArtifacts.wsdl
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/PurchaseGoodsProcess_StoreArtifacts.wsdl
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/PurchaseGoodsProcess_StoreArtifacts.wsdl 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="no"?>
+<wsdl:definitions
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:ns1="http://www.jboss.org/examples/store"
xmlns:ns2="java:org.jboss.savara.examples.purchasing"
xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
targetNamespace="http://www.jboss.org/examples/store">
+ <wsdl:import location="PurchaseGoodsProcess_Store.wsdl"
namespace="http://www.jboss.org/examples/store"/>
+ <wsdl:import location="PurchaseGoodsProcess_CreditAgency.wsdl"
namespace="java:org.jboss.savara.examples.purchasing"/>
+ <plnk:partnerLinkType name="BuyerToStoreServiceLT">
+ <plnk:role name="StoreInterface"
portType="ns1:StoreInterface"/>
+ </plnk:partnerLinkType>
+ <plnk:partnerLinkType name="StoreToCreditAgencyLT">
+ <plnk:role name="CreditAgencyRequester"
portType="ns2:CreditAgencyInterface"/>
+ </plnk:partnerLinkType>
+</wsdl:definitions>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/ReqRespFaultProcess_BuyerArtifacts.wsdl
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/ReqRespFaultProcess_BuyerArtifacts.wsdl
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/ReqRespFaultProcess_BuyerArtifacts.wsdl 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="no"?>
+<wsdl:definitions
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:ns1="http://www.pi4soa.org/ReqRespFault/Seller"
xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
targetNamespace="http://www.pi4soa.org/ReqRespFault/Buyer">
+ <wsdl:import location="ReqRespFaultProcess_Buyer.wsdl"
namespace="http://www.pi4soa.org/ReqRespFault/Buyer"/>
+ <wsdl:import location="ReqRespFaultProcess_Seller.wsdl"
namespace="http://www.pi4soa.org/ReqRespFault/Seller"/>
+ <plnk:partnerLinkType name="BuyerToSellerLT">
+ <plnk:role name="SellerRequester"
portType="ns1:SellerBehavior"/>
+ </plnk:partnerLinkType>
+</wsdl:definitions>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/ReqRespFaultProcess_Seller.wsdl
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/ReqRespFaultProcess_Seller.wsdl
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/ReqRespFaultProcess_Seller.wsdl 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="no"?>
+<wsdl:definitions
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:byr="http://www.pi4soa.org/ReqRespFault/Buyer"
xmlns:slr="http://www.pi4soa.org/ReqRespFault/Seller"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://www.pi4soa.org/ReqRespFault"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Seller"
targetNamespace="http://www.pi4soa.org/ReqRespFault/Seller">
+ <types
xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <schema
xmlns="http://www.w3.org/2001/XMLSchema"/>
+ </types>
+ <wsdl:message name="checkCreditRequest">
+ <wsdl:part element="CreditCheckRequest"
name="content">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="checkCreditResponse">
+ <wsdl:part element="CreditCheckOk" name="content">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="insufficientCreditFault">
+ <wsdl:part element="CreditCheckInvalid"
name="content">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:portType name="SellerBehavior">
+ <wsdl:operation name="checkCredit">
+ <wsdl:input message="slr:checkCreditRequest">
+ </wsdl:input>
+ <wsdl:output message="slr:checkCreditResponse">
+ </wsdl:output>
+ <wsdl:fault message="slr:insufficientCreditFault"
name="insufficientCredit">
+ </wsdl:fault>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="SellerBehaviorBinding"
type="slr:SellerBehavior">
+ <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="checkCredit">
+ <soap:operation
soapAction="http://www.pi4soa.org/ReqRespFault/Seller/checkCredit&qu...
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ <wsdl:fault name="insufficientCredit">
+ <soap:fault name="insufficientCredit"
use="literal"/>
+ </wsdl:fault>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="SellerService">
+ <wsdl:port binding="slr:SellerBehaviorBinding"
name="SellerBehaviorPort">
+ <soap:address
location="http://localhost:8080/SellerService/SellerBehaviorPort"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/ReqRespFaultProcess_SellerArtifacts.wsdl
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/ReqRespFaultProcess_SellerArtifacts.wsdl
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/ReqRespFaultProcess_SellerArtifacts.wsdl 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="no"?>
+<wsdl:definitions
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:ns1="http://www.pi4soa.org/ReqRespFault/Seller"
xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
targetNamespace="http://www.pi4soa.org/ReqRespFault/Seller">
+ <wsdl:import location="ReqRespFaultProcess_Seller.wsdl"
namespace="http://www.pi4soa.org/ReqRespFault/Seller"/>
+ <plnk:partnerLinkType name="BuyerToSellerServiceLT">
+ <plnk:role name="SellerBehavior"
portType="ns1:SellerBehavior"/>
+ </plnk:partnerLinkType>
+</wsdl:definitions>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/RequestForQuote_SupplierQuoteEngine.wsdl
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/RequestForQuote_SupplierQuoteEngine.wsdl
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/RequestForQuote_SupplierQuoteEngine.wsdl 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="no"?>
+<wsdl:definitions
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:brk="http://www.pi4soa.org/ESBBroker/Broker"
xmlns:byr="http://www.pi4soa.org/ESBBroker/Buyer"
xmlns:cay="http://www.pi4soa.org/ESBBroker/CreditAgency"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:spr="http://www.pi4soa.org/ESBBroker/Supplier"
xmlns:tns="http://www.pi4soa.org/ESBBroker"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Supplier"
targetNamespace="http://www.pi4soa.org/ESBBroker/Supplier">
+ <types
xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <schema
xmlns="http://www.w3.org/2001/XMLSchema"/>
+ </types>
+ <wsdl:message name="confirmRequest">
+ <wsdl:part element="orderConfirmed" name="content">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="confirmResponse">
+ <wsdl:part element="bookingReference" name="content">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="getQuoteResponse">
+ <wsdl:part element="quote" name="content">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="getQuoteRequest">
+ <wsdl:part element="requestForQuote" name="content">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:portType name="SupplierBehavior">
+ <wsdl:operation name="confirm">
+ <wsdl:input message="spr:confirmRequest">
+ </wsdl:input>
+ <wsdl:output message="spr:confirmResponse">
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="getQuote">
+ <wsdl:input message="spr:getQuoteRequest">
+ </wsdl:input>
+ <wsdl:output message="spr:getQuoteResponse">
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="SupplierBehaviorBinding"
type="spr:SupplierBehavior">
+ <soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="confirm">
+ <soap:operation
soapAction="http://www.pi4soa.org/ESBBroker/Supplier/confirm"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="getQuote">
+ <soap:operation
soapAction="http://www.pi4soa.org/ESBBroker/Supplier/getQuote"/...
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="SupplierService">
+ <wsdl:port binding="spr:SupplierBehaviorBinding"
name="SupplierBehaviorPort">
+ <soap:address
location="http://localhost:8080/SupplierService/SupplierBehaviorPort"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
Added:
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/RequestForQuote_SupplierQuoteEngineArtifacts.wsdl
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/RequestForQuote_SupplierQuoteEngineArtifacts.wsdl
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/wsdl/RequestForQuote_SupplierQuoteEngineArtifacts.wsdl 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"
standalone="no"?>
+<wsdl:definitions
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:ns1="http://www.pi4soa.org/ESBBroker/Supplier"
xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
targetNamespace="http://www.pi4soa.org/ESBBroker/Supplier">
+ <wsdl:import location="RequestForQuote_SupplierQuoteEngine.wsdl"
namespace="http://www.pi4soa.org/ESBBroker/Supplier"/>
+ <plnk:partnerLinkType name="BrokerToSupplierQuoteEngineServiceLT">
+ <plnk:role name="SupplierBehavior"
portType="ns1:SupplierBehavior"/>
+ </plnk:partnerLinkType>
+</wsdl:definitions>
Modified:
branches/experimental/2.0.x/bundles/org.savara.bundles.tests/src/test/java/org/savara/bundles/tests/bpel/generator/GeneratorTest.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bundles.tests/src/test/java/org/savara/bundles/tests/bpel/generator/GeneratorTest.java 2011-01-24
13:49:12 UTC (rev 614)
+++
branches/experimental/2.0.x/bundles/org.savara.bundles.tests/src/test/java/org/savara/bundles/tests/bpel/generator/GeneratorTest.java 2011-01-24
15:50:17 UTC (rev 615)
@@ -25,8 +25,9 @@
import org.savara.bpel.generator.ProtocolToBPELModelGenerator;
import org.savara.bpel.model.TProcess;
import org.savara.bpel.util.BPELModelUtil;
+import org.savara.common.model.annotation.Annotation;
+import org.savara.common.model.annotation.AnnotationDefinitions;
import org.savara.common.model.generator.ModelGenerator;
-import org.savara.protocol.model.util.PropertyName;
import org.scribble.common.logging.CachedJournal;
import org.scribble.protocol.model.Role;
import org.savara.pi4soa.cdm.parser.CDMProtocolParser;
@@ -39,10 +40,10 @@
suite.addTest(new ChoreographyToBPELTester("ESBBroker",
"Broker"));
suite.addTest(new ChoreographyToBPELTester("ESBBroker",
"Buyer"));
- suite.addTest(new ChoreographyToBPELTester("ESBBroker",
"SupplierTxnProcessor"));
suite.addTest(new ChoreographyToBPELTester("ESBBroker",
"CreditAgency"));
suite.addTest(new ChoreographyToBPELTester("ESBBroker",
"SupplierQuoteEngine"));
-
+ suite.addTest(new ChoreographyToBPELTester("ESBBroker",
"SupplierTxnProcessor"));
+
suite.addTest(new ChoreographyToBPELTester("PurchaseGoods",
"Buyer"));
suite.addTest(new ChoreographyToBPELTester("PurchaseGoods",
"CreditAgency"));
suite.addTest(new ChoreographyToBPELTester("PurchaseGoods",
"Store"));
@@ -149,6 +150,15 @@
}
*/
+ // TODO: SAVARA-167 - issue when projection is based on a sub-protocol
+ if
(AnnotationDefinitions.getAnnotation(projected.getProtocol().getProperties(),
+ AnnotationDefinitions.TYPE) == null &&
+ AnnotationDefinitions.getAnnotation(model.getProtocol().getProperties(),
+ AnnotationDefinitions.TYPE) != null) {
+ AnnotationDefinitions.copyAnnotations(model.getProtocol().getProperties(),
+ projected.getProtocol().getProperties(), AnnotationDefinitions.TYPE);
+ }
+
java.util.List<Role> projectedRoles=projected.getRoles();
ModelGenerator generator=new ProtocolToBPELModelGenerator();
@@ -175,9 +185,20 @@
if (target instanceof TProcess) {
// Obtain any namespace prefix map
java.util.Map<String, String> prefixes=
- (java.util.Map<String, String>)
- projected.getProperties().get(PropertyName.NAMESPACE_PREFIXES);
+ new java.util.HashMap<String, String>();
+ java.util.List<Annotation> list=
+
AnnotationDefinitions.getAnnotations(projected.getProtocol().getProperties(),
+ AnnotationDefinitions.TYPE);
+
+ for (Annotation annotation : list) {
+ if
(annotation.getProperties().containsKey(AnnotationDefinitions.NAMESPACE_PROPERTY)
&&
+
annotation.getProperties().containsKey(AnnotationDefinitions.PREFIX_PROPERTY))
{
+
prefixes.put((String)annotation.getProperties().get(AnnotationDefinitions.NAMESPACE_PROPERTY),
+
(String)annotation.getProperties().get(AnnotationDefinitions.PREFIX_PROPERTY));
+ }
+ }
+
try {
java.io.ByteArrayOutputStream baos=new java.io.ByteArrayOutputStream();
@@ -267,8 +288,10 @@
// to obtain reference back to source version
java.io.File f=null;
- if (url.getFile().indexOf("classes") != -1) {
- f = new
java.io.File(url.getFile().replaceFirst("classes","src/test/resources"));
+ if (url.getFile().indexOf("target/test-classes") != -1) {
+ f = new
java.io.File(url.getFile().replaceFirst("target/test-classes","src/test/resources"));
+ } else if (url.getFile().indexOf("classes") != -1) {
+ f = new
java.io.File(url.getFile().replaceFirst("classes","src/test/resources"));
} else if (url.getFile().indexOf("bin") != -1) {
f = new
java.io.File(url.getFile().replaceFirst("bin","src/test/resources"));
} else {
@@ -276,9 +299,9 @@
}
if (f != null && f.exists()) {
- f = f.getParentFile().getParentFile();
+ f = f.getParentFile().getParentFile().getParentFile();
- java.io.File resultsDir=new java.io.File(f, "results");
+ java.io.File resultsDir=new java.io.File(f,
"bpel/generator/results");
if (resultsDir.exists() == false) {
resultsDir.mkdirs();
Deleted:
branches/experimental/2.0.x/bundles/org.savara.bundles.tests/src/test/resources/bpel/generator/results/ESBBroker(a)Supplier.bpel
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.bundles.tests/src/test/resources/bpel/generator/results/ESBBroker(a)Supplier.bpel 2011-01-24
13:49:12 UTC (rev 614)
+++
branches/experimental/2.0.x/bundles/org.savara.bundles.tests/src/test/resources/bpel/generator/results/ESBBroker(a)Supplier.bpel 2011-01-24
15:50:17 UTC (rev 615)
@@ -1,3 +0,0 @@
-<process name="ESBBrokerProcess_Supplier"
xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"...
- <sequence/>
-</process>
Copied:
branches/experimental/2.0.x/bundles/org.savara.common/src/main/java/org/savara/common/model/annotation/Annotation.java
(from rev 603,
branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/model/annotation/Annotation.java)
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.common/src/main/java/org/savara/common/model/annotation/Annotation.java
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.common/src/main/java/org/savara/common/model/annotation/Annotation.java 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008-11, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.savara.common.model.annotation;
+
+/**
+ * This class represents a named annotation with a set of named
+ * properties.
+ *
+ */
+public class Annotation {
+
+ private String m_name=null;
+ private java.util.Map<String,Object> m_properties=
+ new java.util.HashMap<String, Object>();
+
+ /**
+ * The constructor initialized with the annotation name.
+ *
+ * @param name The name
+ */
+ protected Annotation(String name) {
+ m_name = name;
+ }
+
+ /**
+ * This method returns the name.
+ *
+ * @return The name
+ */
+ public String getName() {
+ return(m_name);
+ }
+
+ /**
+ * This method sets the name.
+ *
+ * @param name The name
+ */
+ protected void setName(String name) {
+ m_name = name;
+ }
+
+ /**
+ * This method returns the properties associated
+ * with this annotation.
+ *
+ * @return The properties
+ */
+ public java.util.Map<String,Object> getProperties() {
+ return(m_properties);
+ }
+
+}
Copied:
branches/experimental/2.0.x/bundles/org.savara.common/src/main/java/org/savara/common/model/annotation/AnnotationDefinitions.java
(from rev 612,
branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/model/util/AnnotationDefinitions.java)
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.common/src/main/java/org/savara/common/model/annotation/AnnotationDefinitions.java
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.common/src/main/java/org/savara/common/model/annotation/AnnotationDefinitions.java 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,162 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.savara.common.model.annotation;
+
+/**
+ * This class provides annotation definitions and helper functions.
+ *
+ */
+public class AnnotationDefinitions {
+
+ // Annotations
+ public static final String INTERFACE = "Interface";
+
+ public static final String FAULT = "Fault";
+
+ public static final String TYPE="Type";
+
+ // XSD sub types
+ public static final String XSD_ELEMENT = "XSDElement";
+ public static final String XSD_TYPE = "XSDType";
+
+ public static final String CORRELATION = "Correlation";
+
+ public static final String NAMESPACE = "Namespace";
+
+ // Annotation property names
+ public static final String NAME_PROPERTY="name";
+
+ public static final String REQUEST_PROPERTY = "request";
+ public static final String REPLY_TO_PROPERTY = "replyTo";
+
+ public static final String PREFIX_PROPERTY="prefix";
+ public static final String NAMESPACE_PROPERTY="namespace";
+ public static final String LOCATION_PROPERTY="location";
+
+
+ // Annotation access methods
+ private static final String ANNOTATIONS = "Annotations";
+
+ /**
+ * This method returns the list of annotations associated with the supplied model
+ * object. If a list does not exist, one will be created if requested.
+ *
+ * @param modelObjProps The model object properties
+ * @param create Whether a list should be create if one does not exist
+ * @return The list of annotations, or null if not found and create flag is false
+ */
+ public static java.util.List<Annotation>
getAnnotations(java.util.Map<String,Object> modelObjProps, boolean create) {
+ java.util.List<Annotation> ret=(java.util.List<Annotation>)
+ modelObjProps.get(ANNOTATIONS);
+
+ if (ret == null && create) {
+ ret = new java.util.Vector<Annotation>();
+ modelObjProps.put(ANNOTATIONS, ret);
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method creates a new named annotation and adds it to the supplied
+ * model object.
+ *
+ * @param modelObjProps The model object properties
+ * @param name The name of the annotation to be created
+ * @return The created annotation
+ */
+ public static Annotation createAnnotation(java.util.Map<String,Object>
modelObjProps, String name) {
+ Annotation ret=new Annotation(name);
+
+ getAnnotations(modelObjProps, true).add(ret);
+
+ return(ret);
+ }
+
+ /**
+ * This method returns the list of annotations associated with the supplied model
+ * object with the specified name.
+ *
+ * @param modelObjProps The model object properties
+ * @param name The annotation name
+ * @return The list of annotations with the supplied name
+ */
+ public static java.util.List<Annotation>
getAnnotations(java.util.Map<String,Object> modelObjProps, String name) {
+ java.util.List<Annotation> ret=new java.util.Vector<Annotation>();
+
+ java.util.List<Annotation> list=(java.util.List<Annotation>)
+ modelObjProps.get(ANNOTATIONS);
+
+ if (list != null) {
+ for (Annotation annotation : list) {
+ if (annotation.getName().equals(name)) {
+ ret.add(annotation);
+ }
+ }
+ }
+
+ return(ret);
+ }
+
+ /**
+ * This method returns the first annotation associated with the supplied model
+ * object with the specified name.
+ *
+ * @param modelObjProps The model object properties
+ * @param name The annotation name
+ * @return The first annotation with the supplied name, or null if not found
+ */
+ public static Annotation getAnnotation(java.util.Map<String,Object> modelObjProps,
String name) {
+ java.util.List<Annotation> ret=new java.util.Vector<Annotation>();
+
+ java.util.List<Annotation> list=(java.util.List<Annotation>)
+ modelObjProps.get(ANNOTATIONS);
+
+ if (list != null) {
+ for (Annotation annotation : list) {
+ if (annotation.getName().equals(name)) {
+ ret.add(annotation);
+ }
+ }
+ }
+
+ if (ret.size() > 0) {
+ return(ret.get(0));
+ } else {
+ return(null);
+ }
+ }
+
+ /**
+ * This method copies the named annotation from the 'from' properties to the
+ * 'to' properties.
+ *
+ * @param fromProps The source model object properties
+ * @param toProps The target model object properties
+ * @param name The annotation name
+ */
+ public static void copyAnnotations(java.util.Map<String,Object> fromProps,
+ java.util.Map<String,Object> toProps, String name) {
+ java.util.List<Annotation> fromAnnotations=getAnnotations(fromProps, name);
+
+ for (Annotation annotation : fromAnnotations) {
+ Annotation toAnnotation=createAnnotation(toProps, name);
+ toAnnotation.getProperties().putAll(annotation.getProperties());
+ }
+ }
+}
Deleted:
branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/generator/Messages.properties
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/generator/Messages.properties 2011-01-24
13:49:12 UTC (rev 614)
+++
branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/generator/Messages.properties 2011-01-24
15:50:17 UTC (rev 615)
@@ -1,20 +0,0 @@
-#/*
-# * JBoss, Home of Professional Open Source
-# * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
-# * by the @authors tag. All rights reserved.
-# * See the copyright.txt in the distribution for a
-# * full listing of individual contributors.
-# * This copyrighted material is made available to anyone wishing to use,
-# * modify, copy, or redistribute it subject to the terms and conditions
-# * of the GNU Lesser General Public License, v. 2.1.
-# * This program is distributed in the hope that it will be useful, but WITHOUT A
-# * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
-# * You should have received a copy of the GNU Lesser General Public License,
-# * v.2.1 along with this distribution; if not, write to the Free Software
-# * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
-# * MA 02110-1301, USA.
-# */
-
-SAVARAPC-00001=Protocol must be supplied
-SAVARAPC-00002=Contract generation requires a protocol that represents the local
behaviour associated with a particular role
Modified:
branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/generator/impl/ContractIntrospector.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/generator/impl/ContractIntrospector.java 2011-01-24
13:49:12 UTC (rev 614)
+++
branches/experimental/2.0.x/bundles/org.savara.contract/src/main/java/org/savara/contract/generator/impl/ContractIntrospector.java 2011-01-24
15:50:17 UTC (rev 615)
@@ -26,6 +26,8 @@
import org.savara.protocol.model.util.InteractionUtil;
import org.savara.protocol.model.util.PropertyName;
+import org.savara.common.model.annotation.Annotation;
+import org.savara.common.model.annotation.AnnotationDefinitions;
import org.savara.contract.model.Contract;
import org.savara.contract.model.FaultDetails;
import org.savara.contract.model.Interface;
@@ -91,12 +93,16 @@
m_contract = new Contract();
m_contract.setName(m_role.getName());
-
- String namespace=(String)m_role.getProperties().get(PropertyName.NAMESPACE);
-
- if (namespace != null) {
- m_contract.setNamespace(namespace);
- }
+
+ Annotation annotation=AnnotationDefinitions.getAnnotation(m_role.getProperties(),
+ AnnotationDefinitions.NAMESPACE);
+ if (annotation != null) {
+ String
namespace=(String)annotation.getProperties().get(AnnotationDefinitions.NAME_PROPERTY);
+
+ if (namespace != null) {
+ m_contract.setNamespace(namespace);
+ }
+ }
}
if (processed != null) {
@@ -145,10 +151,14 @@
// could determine the interface - and if not defined default
// to using an interface named after the role
- String namespace=(String)m_role.getProperties().get(PropertyName.NAMESPACE);
-
- if (namespace != null) {
- ret.setNamespace(namespace);
+ Annotation annotation=AnnotationDefinitions.getAnnotation(m_role.getProperties(),
+ AnnotationDefinitions.NAMESPACE);
+ if (annotation != null) {
+ String
namespace=(String)annotation.getProperties().get(AnnotationDefinitions.NAME_PROPERTY);
+
+ if (namespace != null) {
+ ret.setNamespace(namespace);
+ }
}
getContract().getInterfaces().add(ret);
@@ -178,7 +188,7 @@
if (m_protocol == null) {
throw new IllegalStateException(MessageFormat.format(
java.util.PropertyResourceBundle.getBundle(
- "org.savara.protocol.contract.Messages").
+ "org.savara.contract.Messages").
getString("SAVARAPC-00001"), (Object)null));
}
@@ -198,16 +208,20 @@
Protocol toProtocol=run.getProtocol();
- // Check if protocol already processed to avoid stack overflow
- if (m_processedProtocols.contains(toProtocol) == false) {
- m_processedProtocols.add(toProtocol);
-
- ContractIntrospector ci=new ContractIntrospector(toProtocol,
- getContract(), getProcessedProtocols(), getJournal());
-
- ci.process();
+ if (toProtocol != null) {
+ // Check if protocol already processed to avoid stack overflow
+ if (m_processedProtocols.contains(toProtocol) == false) {
+ m_processedProtocols.add(toProtocol);
+
+ ContractIntrospector ci=new ContractIntrospector(toProtocol,
+ getContract(), getProcessedProtocols(), getJournal());
+
+ ci.process();
+ } else {
+ logger.fine("Invoked definition not found for
"+run.getProtocolReference());
+ }
} else {
- logger.fine("Invoked definition not found for
"+run.getProtocolReference());
+ logger.fine("Run protocol not returned - possibly external");
}
} else if (obj.getClass() == Interaction.class) {
accept((Interaction)obj);
Modified:
branches/experimental/2.0.x/bundles/org.savara.contract/src/test/java/org/savara/contract/generator/impl/ContractIntrospectorTest.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.contract/src/test/java/org/savara/contract/generator/impl/ContractIntrospectorTest.java 2011-01-24
13:49:12 UTC (rev 614)
+++
branches/experimental/2.0.x/bundles/org.savara.contract/src/test/java/org/savara/contract/generator/impl/ContractIntrospectorTest.java 2011-01-24
15:50:17 UTC (rev 615)
@@ -21,9 +21,9 @@
*/
package org.savara.contract.generator.impl;
-import org.savara.protocol.model.annotation.Annotation;
-import org.savara.protocol.model.util.AnnotationDefinitions;
import org.savara.protocol.model.util.PropertyName;
+import org.savara.common.model.annotation.Annotation;
+import org.savara.common.model.annotation.AnnotationDefinitions;
import org.savara.contract.model.Contract;
import org.savara.contract.model.Interface;
import org.savara.contract.model.MessageExchangePattern;
@@ -263,9 +263,9 @@
interaction.setMessageSignature(msig);
interaction.setFromRole(new Role());
- Annotation annotation=new Annotation(AnnotationDefinitions.CORRELATION);
- annotation.getProperties().put(AnnotationDefinitions.REQUEST, "label");
- interaction.getProperties().put(annotation.getName(), annotation);
+ Annotation
annotation=AnnotationDefinitions.createAnnotation(interaction.getProperties(),
+ AnnotationDefinitions.CORRELATION);
+ annotation.getProperties().put(AnnotationDefinitions.REQUEST_PROPERTY,
"label");
introspector.accept(interaction);
Modified:
branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ChoiceConverterRuleImpl.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ChoiceConverterRuleImpl.java 2011-01-24
13:49:12 UTC (rev 614)
+++
branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ChoiceConverterRuleImpl.java 2011-01-24
15:50:17 UTC (rev 615)
@@ -25,8 +25,8 @@
import org.pi4soa.cdl.Parallel;
import org.pi4soa.cdl.util.CDLTypeUtil;
import org.pi4soa.cdl.util.InteractionUtil;
-import org.savara.protocol.model.annotation.Annotation;
-import org.savara.protocol.model.util.AnnotationDefinitions;
+import org.savara.common.model.annotation.Annotation;
+import org.savara.common.model.annotation.AnnotationDefinitions;
import org.savara.protocol.model.util.PropertyName;
import org.scribble.protocol.model.*;
import org.scribble.protocol.model.Choice;
@@ -116,7 +116,8 @@
if (ed != null) {
- MessageSignature ms=InteractionConverterRuleImpl.createMessageSignature(ed);
+ MessageSignature ms=InteractionConverterRuleImpl.createMessageSignature(ed,
+ block);
// TODO: Need to update/verify from/to roles on containing choice
@@ -132,20 +133,20 @@
}
if (ed.getAction() == ExchangeActionType.RESPOND) {
- Annotation annotation=new Annotation(AnnotationDefinitions.CORRELATION);
- annotation.getProperties().put(AnnotationDefinitions.REPLY_TO,
+ Annotation
annotation=AnnotationDefinitions.createAnnotation(block.getProperties(),
+ AnnotationDefinitions.CORRELATION);
+ annotation.getProperties().put(AnnotationDefinitions.REPLY_TO_PROPERTY,
ConverterUtil.getLabel(ed));
- block.getProperties().put(annotation.getName(), annotation);
} else {
// Check if request has response/fault exchanges
java.util.List<ExchangeDetails> resps=
InteractionUtil.getResponseExchangeDetails(ed);
if (resps != null && resps.size() > 0) {
- Annotation annotation=new Annotation(AnnotationDefinitions.CORRELATION);
- annotation.getProperties().put(AnnotationDefinitions.REQUEST,
+ Annotation
annotation=AnnotationDefinitions.createAnnotation(block.getProperties(),
+ AnnotationDefinitions.CORRELATION);
+ annotation.getProperties().put(AnnotationDefinitions.REQUEST_PROPERTY,
ConverterUtil.getLabel(ed));
- block.getProperties().put(annotation.getName(), annotation);
}
}
}
Modified:
branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ConditionalConverterRuleImpl.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ConditionalConverterRuleImpl.java 2011-01-24
13:49:12 UTC (rev 614)
+++
branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ConditionalConverterRuleImpl.java 2011-01-24
15:50:17 UTC (rev 615)
@@ -22,8 +22,8 @@
import org.pi4soa.cdl.*;
import org.pi4soa.cdl.util.CDLTypeUtil;
import org.pi4soa.cdl.util.InteractionUtil;
-import org.savara.protocol.model.annotation.Annotation;
-import org.savara.protocol.model.util.AnnotationDefinitions;
+import org.savara.common.model.annotation.Annotation;
+import org.savara.common.model.annotation.AnnotationDefinitions;
import org.savara.protocol.model.util.PropertyName;
import org.savara.pi4soa.cdm.parser.rules.ChoiceConverterRuleImpl.InteractionLocator;
import org.scribble.protocol.model.*;
@@ -88,7 +88,8 @@
if (ed != null) {
- MessageSignature ms=InteractionConverterRuleImpl.createMessageSignature(ed);
+ MessageSignature ms=InteractionConverterRuleImpl.createMessageSignature(ed,
+ block);
// TODO: Need to update/verify from/to roles on containing choice
@@ -101,20 +102,20 @@
ed)));
if (ed.getAction() == ExchangeActionType.RESPOND) {
- Annotation annotation=new Annotation(AnnotationDefinitions.CORRELATION);
- annotation.getProperties().put(AnnotationDefinitions.REPLY_TO,
+ Annotation annotation=AnnotationDefinitions.createAnnotation(block.getProperties(),
+ AnnotationDefinitions.CORRELATION);
+ annotation.getProperties().put(AnnotationDefinitions.REPLY_TO_PROPERTY,
ConverterUtil.getLabel(ed));
- block.getProperties().put(annotation.getName(), annotation);
} else {
// Check if request has response/fault exchanges
java.util.List<ExchangeDetails> resps=
InteractionUtil.getResponseExchangeDetails(ed);
if (resps != null && resps.size() > 0) {
- Annotation annotation=new Annotation(AnnotationDefinitions.CORRELATION);
- annotation.getProperties().put(AnnotationDefinitions.REQUEST,
+ Annotation
annotation=AnnotationDefinitions.createAnnotation(block.getProperties(),
+ AnnotationDefinitions.CORRELATION);
+ annotation.getProperties().put(AnnotationDefinitions.REQUEST_PROPERTY,
ConverterUtil.getLabel(ed));
- block.getProperties().put(annotation.getName(), annotation);
}
}
}
Modified:
branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ConverterUtil.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ConverterUtil.java 2011-01-24
13:49:12 UTC (rev 614)
+++
branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ConverterUtil.java 2011-01-24
15:50:17 UTC (rev 615)
@@ -29,10 +29,10 @@
import org.pi4soa.cdl.ParticipantType;
import org.pi4soa.cdl.util.CDLTypeUtil;
import org.pi4soa.common.xml.XMLUtils;
-import org.savara.protocol.model.util.AnnotationDefinitions;
+import org.savara.common.model.annotation.Annotation;
+import org.savara.common.model.annotation.AnnotationDefinitions;
import org.savara.protocol.model.util.PropertyName;
import org.savara.protocol.model.util.TypeSystem;
-import org.savara.protocol.model.annotation.Annotation;
import org.scribble.protocol.model.*;
/**
@@ -63,12 +63,12 @@
if (org.pi4soa.common.util.NamesUtil.isSet(infoType.getTypeName())) {
typeName = infoType.getTypeName();
- ret.getProperties().put(AnnotationDefinitions.XSD_TYPE,
- new Annotation(AnnotationDefinitions.XSD_TYPE));
+ AnnotationDefinitions.createAnnotation(ret.getProperties(),
+ AnnotationDefinitions.XSD_TYPE);
} else if (org.pi4soa.common.util.NamesUtil.isSet(infoType.getElementName())) {
typeName = infoType.getElementName();
- ret.getProperties().put(AnnotationDefinitions.XSD_ELEMENT,
- new Annotation(AnnotationDefinitions.XSD_ELEMENT));
+ AnnotationDefinitions.createAnnotation(ret.getProperties(),
+ AnnotationDefinitions.XSD_ELEMENT);
}
if (typeName != null) {
@@ -169,7 +169,9 @@
Role role=new Role();
role.setName(XMLUtils.getLocalname(ptype.getName()));
- role.getProperties().put(PropertyName.NAMESPACE,
+
+ Annotation annotation=AnnotationDefinitions.createAnnotation(role.getProperties(),
AnnotationDefinitions.NAMESPACE);
+ annotation.getProperties().put(AnnotationDefinitions.NAME_PROPERTY,
CDLTypeUtil.getNamespace(ptype.getName(), ptype, true));
ret.add(role);
@@ -185,7 +187,9 @@
if (pinst.getFree() == Boolean.TRUE) {
Role role=new Role();
role.setName(XMLUtils.getLocalname(pinst.getName()));
- role.getProperties().put(PropertyName.NAMESPACE,
+
+ Annotation annotation=AnnotationDefinitions.createAnnotation(role.getProperties(),
AnnotationDefinitions.NAMESPACE);
+ annotation.getProperties().put(AnnotationDefinitions.NAME_PROPERTY,
CDLTypeUtil.getNamespace(pinst.getName(), pinst, true));
ret.add(role);
@@ -254,7 +258,9 @@
Role role=new Role();
role.setName(XMLUtils.getLocalname(ptype.getName()));
- role.getProperties().put(PropertyName.NAMESPACE,
+
+ Annotation annotation=AnnotationDefinitions.createAnnotation(role.getProperties(),
AnnotationDefinitions.NAMESPACE);
+ annotation.getProperties().put(AnnotationDefinitions.NAME_PROPERTY,
CDLTypeUtil.getNamespace(ptype.getName(), ptype, true));
ret.add(role);
@@ -271,7 +277,9 @@
if (pinst.getFree() == Boolean.FALSE) {
Role role=new Role();
role.setName(XMLUtils.getLocalname(pinst.getName()));
- role.getProperties().put(PropertyName.NAMESPACE,
+
+ Annotation annotation=AnnotationDefinitions.createAnnotation(role.getProperties(),
AnnotationDefinitions.NAMESPACE);
+ annotation.getProperties().put(AnnotationDefinitions.NAME_PROPERTY,
CDLTypeUtil.getNamespace(pinst.getName(), pinst, true));
ret.add(role);
Modified:
branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/InteractionConverterRuleImpl.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/InteractionConverterRuleImpl.java 2011-01-24
13:49:12 UTC (rev 614)
+++
branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/InteractionConverterRuleImpl.java 2011-01-24
15:50:17 UTC (rev 615)
@@ -23,9 +23,9 @@
import org.pi4soa.cdl.*;
import org.pi4soa.cdl.Interaction;
-import org.savara.protocol.model.util.AnnotationDefinitions;
+import org.savara.common.model.annotation.Annotation;
+import org.savara.common.model.annotation.AnnotationDefinitions;
import org.savara.protocol.model.util.PropertyName;
-import org.savara.protocol.model.annotation.Annotation;
import org.scribble.protocol.model.*;
import org.scribble.protocol.model.Choice;
import org.scribble.protocol.model.When;
@@ -289,7 +289,7 @@
*/
// Define message signature
- MessageSignature ms=createMessageSignature(details);
+ MessageSignature ms=createMessageSignature(details, interaction);
/*
MessageSignature ms=new MessageSignature();
@@ -339,15 +339,15 @@
*/
interaction.setMessageSignature(ms);
-
+
cb.getBlock().add(interaction);
// Set interface name
if (cdl.getToRoleType() != null) {
// TODO: Deal with interfaces that have multiple behaviours
- Annotation annotation=new Annotation(AnnotationDefinitions.INTERFACE);
- annotation.getProperties().put(AnnotationDefinitions.NAME, getInterfaceName(cdl));
- interaction.getProperties().put(annotation.getName(), annotation);
+ Annotation
annotation=AnnotationDefinitions.createAnnotation(interaction.getProperties(),
+ AnnotationDefinitions.INTERFACE);
+ annotation.getProperties().put(AnnotationDefinitions.NAME_PROPERTY,
getInterfaceName(cdl));
}
interaction.setFromRole(new Role(getFromRole(context, details)));
@@ -379,10 +379,10 @@
InteractionUtil.getResponseExchangeDetails(details);
if (resps != null && resps.size() > 0) {
- Annotation annotation=new Annotation(AnnotationDefinitions.CORRELATION);
- annotation.getProperties().put(AnnotationDefinitions.REQUEST,
+ Annotation
annotation=AnnotationDefinitions.createAnnotation(interaction.getProperties(),
+ AnnotationDefinitions.CORRELATION);
+ annotation.getProperties().put(AnnotationDefinitions.REQUEST_PROPERTY,
ConverterUtil.getLabel(details));
- interaction.getProperties().put(annotation.getName(), annotation);
}
// Check if fault thrown
@@ -438,10 +438,10 @@
}
if (details.getAction() == ExchangeActionType.RESPOND) {
- Annotation annotation=new Annotation(AnnotationDefinitions.CORRELATION);
- annotation.getProperties().put(AnnotationDefinitions.REPLY_TO,
+ Annotation
annotation=AnnotationDefinitions.createAnnotation(interaction.getProperties(),
+ AnnotationDefinitions.CORRELATION);
+ annotation.getProperties().put(AnnotationDefinitions.REPLY_TO_PROPERTY,
ConverterUtil.getLabel(details));
- interaction.getProperties().put(annotation.getName(), annotation);
}
// Check if fault thrown
@@ -725,7 +725,14 @@
return(toRole);
}
- public static MessageSignature createMessageSignature(ExchangeDetails details) {
+ /**
+ * This method creates a message signature.
+ *
+ * @param details The CDL exchange details
+ * @param parent The parent model object, upon which any annotations would be recorded
+ * @return The message signature
+ */
+ public static MessageSignature createMessageSignature(ExchangeDetails details,
ModelObject parent) {
org.pi4soa.cdl.Interaction cdl=details.getInteraction();
// Define message signature
@@ -733,10 +740,9 @@
ms.setOperation(cdl.getOperation());
if (NamesUtil.isSet(details.getFaultName())) {
- Annotation annotation=new Annotation(AnnotationDefinitions.FAULT);
- annotation.getProperties().put(AnnotationDefinitions.NAME, details.getFaultName());
-
- ms.getProperties().put(annotation.getName(), annotation);
+ Annotation annotation=AnnotationDefinitions.createAnnotation(parent.getProperties(),
+ AnnotationDefinitions.FAULT);
+ annotation.getProperties().put(AnnotationDefinitions.NAME_PROPERTY,
details.getFaultName());
}
// Define interaction message type
@@ -826,7 +832,7 @@
* @param interaction The interaction
* @return The interface
*/
- public static String getInterface(Interaction interaction) {
+ protected String getInterface(Interaction interaction) {
String ret=null;
if (interaction != null &&
Modified:
branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ProtocolModelConverterRuleImpl.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ProtocolModelConverterRuleImpl.java 2011-01-24
13:49:12 UTC (rev 614)
+++
branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ProtocolModelConverterRuleImpl.java 2011-01-24
15:50:17 UTC (rev 615)
@@ -28,6 +28,8 @@
import org.pi4soa.common.xml.XMLUtils;
import org.savara.protocol.model.util.PropertyName;
import org.savara.protocol.model.util.TypeSystem;
+import org.savara.common.model.annotation.Annotation;
+import org.savara.common.model.annotation.AnnotationDefinitions;
import org.savara.contract.generator.ContractGenerator;
import org.savara.contract.generator.ContractGeneratorFactory;
import org.scribble.protocol.model.*;
@@ -68,28 +70,10 @@
ret.getProperties().put("CDLType",
CDLTypeUtil.getURIFragment(cdlpack));
- // Store namespace prefix info
- java.util.Iterator<NameSpace>
nss=cdlpack.getTypeDefinitions().getNameSpaces().iterator();
-
- java.util.Map<String,String> prefixes=new java.util.HashMap<String,
String>();
- java.util.Map<String,String> locations=new java.util.HashMap<String,
String>();
-
- while (nss.hasNext()) {
- NameSpace ns=nss.next();
-
- prefixes.put(ns.getURI(), ns.getPrefix());
-
- if (ns.getSchemaLocation() != null && ns.getSchemaLocation().trim().length()
> 0) {
- locations.put(ns.getURI(), ns.getSchemaLocation());
- }
- }
-
- ret.getProperties().put(PropertyName.NAMESPACE_PREFIXES, prefixes);
- ret.getProperties().put(PropertyName.SCHEMA_LOCATIONS, locations);
-
// Convert information types into type imports
for (org.pi4soa.cdl.InformationType itype :
cdlpack.getTypeDefinitions().getInformationTypes()) {
+ // TODO: Create type import for the info type
}
// Convert root choreography
@@ -111,6 +95,25 @@
if (rule != null) {
ret.setProtocol((Protocol)rule.convert(context,
Protocol.class, choreo));
+
+ if (ret.getProtocol() != null) {
+ // Store namespace prefix info
+ java.util.Iterator<NameSpace>
nss=cdlpack.getTypeDefinitions().getNameSpaces().iterator();
+
+ while (nss.hasNext()) {
+ NameSpace ns=nss.next();
+
+ Annotation
type=AnnotationDefinitions.createAnnotation(ret.getProtocol().getProperties(),
+ AnnotationDefinitions.TYPE);
+
+ type.getProperties().put(AnnotationDefinitions.NAMESPACE_PROPERTY, ns.getURI());
+ type.getProperties().put(AnnotationDefinitions.PREFIX_PROPERTY, ns.getPrefix());
+
+ if (ns.getSchemaLocation() != null && ns.getSchemaLocation().trim().length()
> 0) {
+ type.getProperties().put(AnnotationDefinitions.LOCATION_PROPERTY,
ns.getSchemaLocation());
+ }
+ }
+ }
} else {
logger.severe("Failed to find conversation conversion rule");
}
Modified:
branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/resources/results/protocol/ESBBroker.spr
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/resources/results/protocol/ESBBroker.spr 2011-01-24
13:49:12 UTC (rev 614)
+++
branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/resources/results/protocol/ESBBroker.spr 2011-01-24
15:50:17 UTC (rev 615)
@@ -1,3 +1,9 @@
+[[
Type(prefix=tns,namespace=http://www.pi4soa.org/ESBBroker) ]]
+[[
Type(prefix=xsd,namespace=http://www.w3.org/2001/XMLSchema) ]]
+[[
Type(prefix=brk,namespace=http://www.pi4soa.org/ESBBroker/Broker) ]]
+[[
Type(prefix=byr,namespace=http://www.pi4soa.org/ESBBroker/Buyer) ]]
+[[
Type(prefix=cay,namespace=http://www.pi4soa.org/ESBBroker/CreditAgency) ]]
+[[
Type(prefix=spr,namespace=http://www.pi4soa.org/ESBBroker/Supplier) ]]
protocol ESBBrokerProcess {
role Broker, Buyer, CreditAgency, Supplier;
[[
Interface(name={http://www.pi4soa.org/ESBBroker}BrokerBehavior) ]]
@@ -29,8 +35,10 @@
[[ Correlation(replyTo=buy) ]]
buy(BookingReference) from Broker to Buyer;
+ [[ Fault(name=invalidCredit) ]]
[[ Correlation(replyTo=checkCredit) ]]
checkCredit(CreditInvalid):
+ [[ Fault(name=rejected) ]]
[[
Interface(name={http://www.pi4soa.org/ESBBroker}BrokerBehavior) ]]
[[ Correlation(replyTo=buy) ]]
buy(OrderRejected) from Broker to Buyer;
@@ -40,7 +48,7 @@
cancel(Cancel):
}
- protocol CompleteTransaction {
+ protocol CompleteTransaction(role Buyer, role Broker, role CreditAgency) {
role SupplierTxnProcessor;
[[
Interface(name={http://www.pi4soa.org/ESBBroker}BrokerBehavior) ]]
[[ Correlation(request=buy) ]]
@@ -61,15 +69,17 @@
[[ Correlation(replyTo=buy) ]]
buy(BookingReference) from Broker to Buyer;
+ [[ Fault(name=invalidCredit) ]]
[[ Correlation(replyTo=checkCredit) ]]
checkCredit(CreditInvalid):
+ [[ Fault(name=rejected) ]]
[[
Interface(name={http://www.pi4soa.org/ESBBroker}BrokerBehavior) ]]
[[ Correlation(replyTo=buy) ]]
buy(OrderRejected) from Broker to Buyer;
}
}
- protocol RequestForQuote {
+ protocol RequestForQuote(role Broker) {
role SupplierQuoteEngine;
[[
Interface(name={http://www.pi4soa.org/ESBBroker}SupplierBehavior) ]]
[[ Correlation(request=getQuote) ]]
Modified:
branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/resources/results/protocol/PurchaseGoods.spr
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/resources/results/protocol/PurchaseGoods.spr 2011-01-24
13:49:12 UTC (rev 614)
+++
branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/resources/results/protocol/PurchaseGoods.spr 2011-01-24
15:50:17 UTC (rev 615)
@@ -1,3 +1,7 @@
+[[
Type(prefix=tns,namespace=http://www.jboss.org/savara/examples) ]]
+[[
Type(prefix=xsd,namespace=http://www.w3.org/2001/XMLSchema) ]]
+[[ Type(prefix=pur,namespace=java:org.jboss.savara.examples.purchasing) ]]
+[[
Type(prefix=sto,namespace=http://www.jboss.org/examples/store) ]]
protocol PurchaseGoodsProcess {
role Buyer, CreditAgency, Store;
[[
Interface(name={http://www.jboss.org/examples/store}StoreInterface) ]]
@@ -13,8 +17,10 @@
[[ Correlation(replyTo=buy) ]]
buy(BuyConfirmed) from Store to Buyer;
+ [[ Fault(name=CreditCheckFailed) ]]
[[ Correlation(replyTo=checkCredit) ]]
checkCredit(CreditCheckInvalid):
+ [[ Fault(name=BuyFailed) ]]
[[
Interface(name={http://www.jboss.org/examples/store}StoreInterface) ]]
[[ Correlation(replyTo=buy) ]]
buy(BuyFailed) from Store to Buyer;
Modified:
branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/resources/results/protocol/ReqRespFault.spr
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/resources/results/protocol/ReqRespFault.spr 2011-01-24
13:49:12 UTC (rev 614)
+++
branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/resources/results/protocol/ReqRespFault.spr 2011-01-24
15:50:17 UTC (rev 615)
@@ -1,3 +1,7 @@
+[[
Type(prefix=tns,namespace=http://www.pi4soa.org/ReqRespFault) ]]
+[[
Type(prefix=xsd,namespace=http://www.w3.org/2001/XMLSchema) ]]
+[[
Type(prefix=byr,namespace=http://www.pi4soa.org/ReqRespFault/Buyer) ]]
+[[
Type(prefix=slr,namespace=http://www.pi4soa.org/ReqRespFault/Seller) ]]
protocol ReqRespFaultProcess {
role Buyer, Seller;
[[
Interface(name={http://www.pi4soa.org/ReqRespFault}SellerBehavior) ]]
@@ -7,6 +11,7 @@
[[ Correlation(replyTo=checkCredit) ]]
checkCredit(CreditValid):
+ [[ Fault(name=insufficientCredit) ]]
[[ Correlation(replyTo=checkCredit) ]]
checkCredit(CreditInvalid):
Modified:
branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/export/text/TextProtocolExporter.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/export/text/TextProtocolExporter.java 2011-01-24
13:49:12 UTC (rev 614)
+++
branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/export/text/TextProtocolExporter.java 2011-01-24
15:50:17 UTC (rev 615)
@@ -17,7 +17,8 @@
*/
package org.savara.protocol.export.text;
-import org.savara.protocol.model.annotation.Annotation;
+import org.savara.common.model.annotation.Annotation;
+import org.savara.common.model.annotation.AnnotationDefinitions;
import org.scribble.common.logging.Journal;
import org.scribble.protocol.export.text.TextProtocolExporterVisitor;
import org.scribble.protocol.model.Catch;
@@ -64,12 +65,12 @@
@Override
public void accept(Interaction elem) {
- if ((elem.getParent() instanceof Catch) == false) {
+ if ((elem.getParent() instanceof Catch) == false) {
+ java.util.List<Annotation>
list=AnnotationDefinitions.getAnnotations(elem.getProperties(), false);
- for (Object prop : elem.getProperties().values()) {
-
- if (prop instanceof Annotation) {
- outputAnnotation((Annotation)prop);
+ if (list != null) {
+ for (Annotation annotation : list) {
+ outputAnnotation(annotation);
}
}
}
@@ -79,10 +80,11 @@
@Override
public void accept(TypeImportList elem) {
- for (Object prop : elem.getProperties().values()) {
-
- if (prop instanceof Annotation) {
- outputAnnotation((Annotation)prop);
+ java.util.List<Annotation>
list=AnnotationDefinitions.getAnnotations(elem.getProperties(), false);
+
+ if (list != null) {
+ for (Annotation annotation : list) {
+ outputAnnotation(annotation);
}
}
@@ -91,10 +93,11 @@
@Override
public void accept(ProtocolImportList elem) {
- for (Object prop : elem.getProperties().values()) {
-
- if (prop instanceof Annotation) {
- outputAnnotation((Annotation)prop);
+ java.util.List<Annotation>
list=AnnotationDefinitions.getAnnotations(elem.getProperties(), false);
+
+ if (list != null) {
+ for (Annotation annotation : list) {
+ outputAnnotation(annotation);
}
}
@@ -103,10 +106,11 @@
@Override
public void accept(Include elem) {
- for (Object prop : elem.getProperties().values()) {
-
- if (prop instanceof Annotation) {
- outputAnnotation((Annotation)prop);
+ java.util.List<Annotation>
list=AnnotationDefinitions.getAnnotations(elem.getProperties(), false);
+
+ if (list != null) {
+ for (Annotation annotation : list) {
+ outputAnnotation(annotation);
}
}
@@ -119,10 +123,11 @@
* @param elem The recursion
*/
public void accept(Recursion elem) {
- for (Object prop : elem.getProperties().values()) {
-
- if (prop instanceof Annotation) {
- outputAnnotation((Annotation)prop);
+ java.util.List<Annotation>
list=AnnotationDefinitions.getAnnotations(elem.getProperties(), false);
+
+ if (list != null) {
+ for (Annotation annotation : list) {
+ outputAnnotation(annotation);
}
}
@@ -131,10 +136,11 @@
@Override
public void accept(RoleList elem) {
- for (Object prop : elem.getProperties().values()) {
-
- if (prop instanceof Annotation) {
- outputAnnotation((Annotation)prop);
+ java.util.List<Annotation>
list=AnnotationDefinitions.getAnnotations(elem.getProperties(), false);
+
+ if (list != null) {
+ for (Annotation annotation : list) {
+ outputAnnotation(annotation);
}
}
@@ -143,10 +149,11 @@
@Override
public void accept(TypeImport elem) {
- for (Object prop : elem.getProperties().values()) {
-
- if (prop instanceof Annotation) {
- outputAnnotation((Annotation)prop);
+ java.util.List<Annotation>
list=AnnotationDefinitions.getAnnotations(elem.getProperties(), false);
+
+ if (list != null) {
+ for (Annotation annotation : list) {
+ outputAnnotation(annotation);
}
}
@@ -155,10 +162,11 @@
@Override
public void accept(ProtocolImport elem) {
- for (Object prop : elem.getProperties().values()) {
-
- if (prop instanceof Annotation) {
- outputAnnotation((Annotation)prop);
+ java.util.List<Annotation>
list=AnnotationDefinitions.getAnnotations(elem.getProperties(), false);
+
+ if (list != null) {
+ for (Annotation annotation : list) {
+ outputAnnotation(annotation);
}
}
@@ -167,10 +175,11 @@
@Override
public boolean start(Protocol elem) {
- for (Object prop : elem.getProperties().values()) {
-
- if (prop instanceof Annotation) {
- outputAnnotation((Annotation)prop);
+ java.util.List<Annotation>
list=AnnotationDefinitions.getAnnotations(elem.getProperties(), false);
+
+ if (list != null) {
+ for (Annotation annotation : list) {
+ outputAnnotation(annotation);
}
}
@@ -179,10 +188,11 @@
@Override
public boolean start(Choice elem) {
- for (Object prop : elem.getProperties().values()) {
-
- if (prop instanceof Annotation) {
- outputAnnotation((Annotation)prop);
+ java.util.List<Annotation>
list=AnnotationDefinitions.getAnnotations(elem.getProperties(), false);
+
+ if (list != null) {
+ for (Annotation annotation : list) {
+ outputAnnotation(annotation);
}
}
@@ -191,10 +201,11 @@
@Override
public boolean start(When elem) {
- for (Object prop : elem.getProperties().values()) {
-
- if (prop instanceof Annotation) {
- outputAnnotation((Annotation)prop);
+ java.util.List<Annotation>
list=AnnotationDefinitions.getAnnotations(elem.getProperties(), false);
+
+ if (list != null) {
+ for (Annotation annotation : list) {
+ outputAnnotation(annotation);
}
}
@@ -203,10 +214,11 @@
@Override
public boolean start(Parallel elem) {
- for (Object prop : elem.getProperties().values()) {
-
- if (prop instanceof Annotation) {
- outputAnnotation((Annotation)prop);
+ java.util.List<Annotation>
list=AnnotationDefinitions.getAnnotations(elem.getProperties(), false);
+
+ if (list != null) {
+ for (Annotation annotation : list) {
+ outputAnnotation(annotation);
}
}
@@ -215,10 +227,11 @@
@Override
public boolean start(Repeat elem) {
- for (Object prop : elem.getProperties().values()) {
-
- if (prop instanceof Annotation) {
- outputAnnotation((Annotation)prop);
+ java.util.List<Annotation>
list=AnnotationDefinitions.getAnnotations(elem.getProperties(), false);
+
+ if (list != null) {
+ for (Annotation annotation : list) {
+ outputAnnotation(annotation);
}
}
@@ -227,22 +240,24 @@
@Override
public boolean start(RecBlock elem) {
- for (Object prop : elem.getProperties().values()) {
-
- if (prop instanceof Annotation) {
- outputAnnotation((Annotation)prop);
+ java.util.List<Annotation>
list=AnnotationDefinitions.getAnnotations(elem.getProperties(), false);
+
+ if (list != null) {
+ for (Annotation annotation : list) {
+ outputAnnotation(annotation);
}
}
-
+
return(super.start(elem));
}
@Override
public boolean start(Optional elem) {
- for (Object prop : elem.getProperties().values()) {
-
- if (prop instanceof Annotation) {
- outputAnnotation((Annotation)prop);
+ java.util.List<Annotation>
list=AnnotationDefinitions.getAnnotations(elem.getProperties(), false);
+
+ if (list != null) {
+ for (Annotation annotation : list) {
+ outputAnnotation(annotation);
}
}
@@ -251,10 +266,11 @@
@Override
public boolean start(Unordered elem) {
- for (Object prop : elem.getProperties().values()) {
-
- if (prop instanceof Annotation) {
- outputAnnotation((Annotation)prop);
+ java.util.List<Annotation>
list=AnnotationDefinitions.getAnnotations(elem.getProperties(), false);
+
+ if (list != null) {
+ for (Annotation annotation : list) {
+ outputAnnotation(annotation);
}
}
@@ -263,10 +279,11 @@
@Override
public boolean start(Try elem) {
- for (Object prop : elem.getProperties().values()) {
-
- if (prop instanceof Annotation) {
- outputAnnotation((Annotation)prop);
+ java.util.List<Annotation>
list=AnnotationDefinitions.getAnnotations(elem.getProperties(), false);
+
+ if (list != null) {
+ for (Annotation annotation : list) {
+ outputAnnotation(annotation);
}
}
@@ -275,10 +292,11 @@
@Override
public boolean start(Catch elem) {
- for (Object prop : elem.getProperties().values()) {
-
- if (prop instanceof Annotation) {
- outputAnnotation((Annotation)prop);
+ java.util.List<Annotation>
list=AnnotationDefinitions.getAnnotations(elem.getProperties(), false);
+
+ if (list != null) {
+ for (Annotation annotation : list) {
+ outputAnnotation(annotation);
}
}
@@ -287,10 +305,11 @@
@Override
public boolean start(Run elem) {
- for (Object prop : elem.getProperties().values()) {
-
- if (prop instanceof Annotation) {
- outputAnnotation((Annotation)prop);
+ java.util.List<Annotation>
list=AnnotationDefinitions.getAnnotations(elem.getProperties(), false);
+
+ if (list != null) {
+ for (Annotation annotation : list) {
+ outputAnnotation(annotation);
}
}
Deleted:
branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/model/annotation/Annotation.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/model/annotation/Annotation.java 2011-01-24
13:49:12 UTC (rev 614)
+++
branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/model/annotation/Annotation.java 2011-01-24
15:50:17 UTC (rev 615)
@@ -1,68 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008-11, Red Hat Middleware LLC, and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-package org.savara.protocol.model.annotation;
-
-/**
- * This class represents a named annotation with a set of named
- * properties.
- *
- */
-public class Annotation {
-
- private String m_name=null;
- private java.util.Map<String,Object> m_properties=
- new java.util.HashMap<String, Object>();
-
- /**
- * The constructor initialized with the annotation name.
- *
- * @param name The name
- */
- public Annotation(String name) {
- m_name = name;
- }
-
- /**
- * This method returns the name.
- *
- * @return The name
- */
- public String getName() {
- return(m_name);
- }
-
- /**
- * This method sets the name.
- *
- * @param name The name
- */
- public void setName(String name) {
- m_name = name;
- }
-
- /**
- * This method returns the properties associated
- * with this annotation.
- *
- * @return The properties
- */
- public java.util.Map<String,Object> getProperties() {
- return(m_properties);
- }
-
-}
Deleted:
branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/model/util/AnnotationDefinitions.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/model/util/AnnotationDefinitions.java 2011-01-24
13:49:12 UTC (rev 614)
+++
branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/model/util/AnnotationDefinitions.java 2011-01-24
15:50:17 UTC (rev 615)
@@ -1,40 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-package org.savara.protocol.model.util;
-
-public class AnnotationDefinitions {
-
- // Annotations
- public static final String INTERFACE = "Interface";
-
- public static final String FAULT = "Fault";
-
- // XSD sub types
- public static final String XSD_ELEMENT = "XSDElement";
- public static final String XSD_TYPE = "XSDType";
-
- public static final String CORRELATION = "Correlation";
-
-
- // Annotation property names
- public static final String NAME="name";
-
- public static final String REQUEST = "request";
- public static final String REPLY_TO = "replyTo";
-
-}
Modified:
branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/model/util/InteractionUtil.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/model/util/InteractionUtil.java 2011-01-24
13:49:12 UTC (rev 614)
+++
branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/model/util/InteractionUtil.java 2011-01-24
15:50:17 UTC (rev 615)
@@ -17,7 +17,8 @@
*/
package org.savara.protocol.model.util;
-import org.savara.protocol.model.annotation.Annotation;
+import org.savara.common.model.annotation.Annotation;
+import org.savara.common.model.annotation.AnnotationDefinitions;
import org.scribble.protocol.model.*;
/**
@@ -125,36 +126,40 @@
public static String getRequestLabel(Interaction interaction) {
String ret=null;
- Annotation
annotation=(Annotation)interaction.getProperties().get(AnnotationDefinitions.CORRELATION);
+ Annotation annotation=AnnotationDefinitions.getAnnotation(interaction.getProperties(),
+ AnnotationDefinitions.CORRELATION);
if (annotation != null) {
- ret = (String)annotation.getProperties().get(AnnotationDefinitions.REQUEST);
+ ret = (String)annotation.getProperties().get(AnnotationDefinitions.REQUEST_PROPERTY);
}
return(ret);
}
public static String getReplyToLabel(Interaction interaction) {
String ret=null;
- Annotation
annotation=(Annotation)interaction.getProperties().get(AnnotationDefinitions.CORRELATION);
+ Annotation annotation=AnnotationDefinitions.getAnnotation(interaction.getProperties(),
+ AnnotationDefinitions.CORRELATION);
if (annotation != null) {
- ret = (String)annotation.getProperties().get(AnnotationDefinitions.REPLY_TO);
+ ret =
(String)annotation.getProperties().get(AnnotationDefinitions.REPLY_TO_PROPERTY);
}
return(ret);
}
public static String getRequestLabel(When interaction) {
String ret=null;
- Annotation
annotation=(Annotation)interaction.getProperties().get(AnnotationDefinitions.CORRELATION);
+ Annotation annotation=AnnotationDefinitions.getAnnotation(interaction.getProperties(),
+ AnnotationDefinitions.CORRELATION);
if (annotation != null) {
- ret = (String)annotation.getProperties().get(AnnotationDefinitions.REQUEST);
+ ret = (String)annotation.getProperties().get(AnnotationDefinitions.REQUEST_PROPERTY);
}
return(ret);
}
public static String getReplyToLabel(When interaction) {
String ret=null;
- Annotation
annotation=(Annotation)interaction.getProperties().get(AnnotationDefinitions.CORRELATION);
+ Annotation annotation=AnnotationDefinitions.getAnnotation(interaction.getProperties(),
+ AnnotationDefinitions.CORRELATION);
if (annotation != null) {
- ret = (String)annotation.getProperties().get(AnnotationDefinitions.REPLY_TO);
+ ret =
(String)annotation.getProperties().get(AnnotationDefinitions.REPLY_TO_PROPERTY);
}
return(ret);
}
@@ -240,8 +245,8 @@
boolean ret=false;
if (isResponse(interaction) &&
- interaction.getMessageSignature().getProperties().
- keySet().contains(AnnotationDefinitions.FAULT)) {
+ AnnotationDefinitions.getAnnotation(interaction.getProperties(),
+ AnnotationDefinitions.FAULT) != null) {
ret = true;
}
@@ -259,8 +264,8 @@
boolean ret=false;
if (InteractionUtil.isResponse(interaction) &&
- interaction.getMessageSignature().getProperties().
- keySet().contains(AnnotationDefinitions.FAULT)) {
+ AnnotationDefinitions.getAnnotation(interaction.getProperties(),
+ AnnotationDefinitions.FAULT) != null) {
ret = true;
}
@@ -276,11 +281,11 @@
*/
public static String getFaultName(Interaction interaction) {
String ret=null;
- Annotation annotation=(Annotation)interaction.
- getMessageSignature().getProperties().get(AnnotationDefinitions.FAULT);
+ Annotation annotation=AnnotationDefinitions.getAnnotation(interaction.getProperties(),
+ AnnotationDefinitions.FAULT);
if (annotation != null) {
- ret = (String)annotation.getProperties().get(AnnotationDefinitions.NAME);
+ ret = (String)annotation.getProperties().get(AnnotationDefinitions.NAME_PROPERTY);
}
return(ret);
@@ -295,11 +300,11 @@
*/
public static String getFaultName(When interaction) {
String ret=null;
- Annotation annotation=(Annotation)interaction.
- getMessageSignature().getProperties().get(AnnotationDefinitions.FAULT);
+ Annotation annotation=AnnotationDefinitions.getAnnotation(interaction.getProperties(),
+ AnnotationDefinitions.FAULT);
if (annotation != null) {
- ret = (String)annotation.getProperties().get(AnnotationDefinitions.NAME);
+ ret = (String)annotation.getProperties().get(AnnotationDefinitions.NAME_PROPERTY);
}
return(ret);
Modified:
branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/model/util/PropertyName.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/model/util/PropertyName.java 2011-01-24
13:49:12 UTC (rev 614)
+++
branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/model/util/PropertyName.java 2011-01-24
15:50:17 UTC (rev 615)
@@ -18,11 +18,5 @@
package org.savara.protocol.model.util;
public class PropertyName {
-
- public static final String NAMESPACE_PREFIXES="NamespacePrefixes";
- public static final String SCHEMA_LOCATIONS="SchemaLocations";
-
- public static final String NAMESPACE = "Namespace";
-
}
Modified:
branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/parser/AnnotationProcessor.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/parser/AnnotationProcessor.java 2011-01-24
13:49:12 UTC (rev 614)
+++
branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/parser/AnnotationProcessor.java 2011-01-24
15:50:17 UTC (rev 615)
@@ -17,6 +17,8 @@
*/
package org.savara.protocol.parser;
+import org.savara.common.model.annotation.Annotation;
+import org.savara.common.model.annotation.AnnotationDefinitions;
import org.scribble.common.logging.Journal;
import org.scribble.protocol.model.ModelObject;
@@ -24,7 +26,42 @@
public void process(String annotation, ModelObject modelObject,
Journal journal) {
- System.out.println("ANNOTATION="+annotation+" MO="+modelObject);
+ java.util.StringTokenizer st=new java.util.StringTokenizer(annotation); //,
"(),=");
+
+ String name=st.nextToken("(");
+
+ Annotation an=AnnotationDefinitions.createAnnotation(modelObject.getProperties(),
name);
+
+ if (st.hasMoreTokens()) {
+ String token=st.nextToken("()");
+
+ if (token != null) {
+ String[] props=token.split(",");
+
+ for (int i=0; i < props.length; i++) {
+ String[] vals=props[i].split("=");
+
+ if (vals.length != 2) {
+ journal.error("Name/Value of annotation could not be derived",
modelObject.getProperties());
+ } else {
+ an.getProperties().put(vals[0], vals[1]);
+ }
+ }
+
+ // Find position following annotation parameters
+ int index=annotation.indexOf(token);
+
+ if (index != -1) {
+ index = annotation.indexOf(')', index+token.length());
+
+ if (index == -1) {
+ journal.error("')' not found in annotation",
modelObject.getProperties());
+ }
+ }
+ } else {
+ journal.error("'(' not found in annotation",
modelObject.getProperties());
+ }
+ }
}
}
Added:
branches/experimental/2.0.x/bundles/org.savara.protocol/src/test/java/org/savara/protocol/parser/AnnotationProcessorTest.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.protocol/src/test/java/org/savara/protocol/parser/AnnotationProcessorTest.java
(rev 0)
+++
branches/experimental/2.0.x/bundles/org.savara.protocol/src/test/java/org/savara/protocol/parser/AnnotationProcessorTest.java 2011-01-24
15:50:17 UTC (rev 615)
@@ -0,0 +1,173 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008-11, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.savara.protocol.parser;
+
+import org.junit.Test;
+import org.savara.common.model.annotation.Annotation;
+import org.savara.common.model.annotation.AnnotationDefinitions;
+import org.scribble.common.logging.CachedJournal;
+import org.scribble.protocol.model.Interaction;
+
+import static org.junit.Assert.*;
+
+public class AnnotationProcessorTest {
+
+ @Test
+ public void testProcessAnnotationWithoutParameters() {
+ AnnotationProcessor processor=new AnnotationProcessor();
+
+ String name="Interface";
+
+ Interaction mobj=new Interaction();
+
+ String annotationText=name;
+
+ CachedJournal journal=new CachedJournal();
+
+ processor.process(annotationText, mobj, journal);
+
+ if (journal.hasErrors()) {
+ fail("Error reported");
+ }
+
+ Annotation annotation=AnnotationDefinitions.getAnnotation(mobj.getProperties(), name);
+
+ if (annotation == null) {
+ fail("Annotation not associated with object");
+ }
+
+ if (annotation.getName().equals(name) == false) {
+ fail("Annotation name is incorrect");
+ }
+
+ if (annotation.getProperties().size() != 0) {
+ fail("No properties expected");
+ }
+ }
+
+ @Test
+ public void testProcessAnnotationWithParameters() {
+ AnnotationProcessor processor=new AnnotationProcessor();
+
+ String name="Interface";
+ String p1value="{http://www.example.org}Intf";
+ String p2value="MyOtherValue";
+
+ Interaction mobj=new Interaction();
+
+ String
annotationText=name+"(p1="+p1value+",p2="+p2value+")";
+
+ CachedJournal journal=new CachedJournal();
+
+ processor.process(annotationText, mobj, journal);
+
+ if (journal.hasErrors()) {
+ fail("Error reported");
+ }
+
+ Annotation annotation=AnnotationDefinitions.getAnnotation(mobj.getProperties(), name);
+
+ if (annotation == null) {
+ fail("Annotation not associated with object");
+ }
+
+ if (annotation.getName().equals(name) == false) {
+ fail("Annotation name is incorrect");
+ }
+
+ if (annotation.getProperties().size() != 2) {
+ fail("Two properties expected");
+ }
+
+ if (annotation.getProperties().containsKey("p1") == false) {
+ fail("p1 property not found");
+ }
+
+ if (annotation.getProperties().get("p1").equals(p1value) == false) {
+ fail("p1 value not correct");
+ }
+
+ if (annotation.getProperties().containsKey("p2") == false) {
+ fail("p2 property not found");
+ }
+
+ if (annotation.getProperties().get("p2").equals(p2value) == false) {
+ fail("p2 value not correct");
+ }
+ }
+
+ @Test
+ public void testProcessAnnotationWithParametersMissingComma() {
+ AnnotationProcessor processor=new AnnotationProcessor();
+
+ String name="Interface";
+ String p1value="{http://www.example.org}Intf";
+ String p2value="MyOtherValue";
+
+ Interaction mobj=new Interaction();
+
+ String annotationText=name+"(p1="+p1value+"
p2="+p2value+")";
+
+ CachedJournal journal=new CachedJournal();
+
+ processor.process(annotationText, mobj, journal);
+
+ if (journal.hasErrors() == false) {
+ fail("Error expected");
+ }
+ }
+
+ @Test
+ public void testProcessAnnotationWithParametersMissingAssign() {
+ AnnotationProcessor processor=new AnnotationProcessor();
+
+ String name="Interface";
+
+ Interaction mobj=new Interaction();
+
+ String annotationText=name+"(p1)";
+
+ CachedJournal journal=new CachedJournal();
+
+ processor.process(annotationText, mobj, journal);
+
+ if (journal.hasErrors() == false) {
+ fail("Error expected");
+ }
+ }
+
+ @Test
+ public void testProcessAnnotationWithParametersMissingEndBracket() {
+ AnnotationProcessor processor=new AnnotationProcessor();
+
+ String name="Interface";
+ String p1value="{http://www.example.org}Intf";
+
+ Interaction mobj=new Interaction();
+
+ String annotationText=name+"(p1="+p1value;
+
+ CachedJournal journal=new CachedJournal();
+
+ processor.process(annotationText, mobj, journal);
+
+ if (journal.hasErrors() == false) {
+ fail("Error expected");
+ }
+ }
+}
Modified:
branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/impl/WSDLGeneratorImpl.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/impl/WSDLGeneratorImpl.java 2011-01-24
13:49:12 UTC (rev 614)
+++
branches/experimental/2.0.x/bundles/org.savara.wsdl/src/main/java/org/savara/wsdl/generator/impl/WSDLGeneratorImpl.java 2011-01-24
15:50:17 UTC (rev 615)
@@ -22,9 +22,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.savara.protocol.model.util.AnnotationDefinitions;
import org.savara.protocol.model.util.PropertyName;
import org.savara.protocol.model.util.TypeSystem;
+import org.savara.common.model.annotation.AnnotationDefinitions;
import org.savara.contract.model.FaultDetails;
import org.savara.contract.model.Interface;
import org.savara.contract.model.Namespace;
Modified:
branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/java/org/savara/wsdl/generator/WSDLGeneratorTest.java
===================================================================
---
branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/java/org/savara/wsdl/generator/WSDLGeneratorTest.java 2011-01-24
13:49:12 UTC (rev 614)
+++
branches/experimental/2.0.x/bundles/org.savara.wsdl/src/test/java/org/savara/wsdl/generator/WSDLGeneratorTest.java 2011-01-24
15:50:17 UTC (rev 615)
@@ -20,11 +20,11 @@
import javax.wsdl.Part;
import javax.xml.namespace.QName;
-import org.savara.protocol.model.util.AnnotationDefinitions;
import org.savara.protocol.model.util.PropertyName;
import org.savara.protocol.model.util.TypeSystem;
+import org.savara.common.model.annotation.Annotation;
+import org.savara.common.model.annotation.AnnotationDefinitions;
import org.savara.contract.model.*;
-import org.savara.protocol.model.annotation.Annotation;
import org.savara.wsdl.generator.WSDLGenerator;
import org.savara.wsdl.generator.WSDLGeneratorFactory;
import org.savara.wsdl.generator.impl.WSDLGeneratorImpl;
@@ -179,7 +179,9 @@
ref1.setName(TEST_TYPE_LP);
ref1.setDataType(new QName(TEST_NAME_SPACE,TEST_TYPE_LP).toString());
ref1.setTypeSystem(TypeSystem.XSD);
- ref1.getProperties().put(AnnotationDefinitions.XSD_TYPE, new
Annotation(AnnotationDefinitions.XSD_TYPE));
+
+ AnnotationDefinitions.createAnnotation(ref1.getProperties(),
AnnotationDefinitions.XSD_TYPE);
+
c.getTypeDefinitions().add(ref1);
i1.getMessageExchangePatterns().add(m1);
@@ -281,7 +283,7 @@
ref.setName(TEST_TYPE_LP);
ref.setDataType(new QName(TEST_TYPE_NS,TEST_TYPE_LP).toString());
ref.setTypeSystem(TypeSystem.XSD);
- ref.getProperties().put(AnnotationDefinitions.XSD_TYPE, new
Annotation(AnnotationDefinitions.XSD_TYPE));
+ AnnotationDefinitions.createAnnotation(ref.getProperties(),
AnnotationDefinitions.XSD_TYPE);
c.getTypeDefinitions().add(ref);
/*
@@ -351,7 +353,7 @@
ref1.setName(TEST_TYPE_LP);
ref1.setDataType(new QName(TEST_TYPE_NS,TEST_TYPE_LP).toString());
ref1.setTypeSystem(TypeSystem.XSD);
- ref1.getProperties().put(AnnotationDefinitions.XSD_TYPE, new
Annotation(AnnotationDefinitions.XSD_TYPE));
+ AnnotationDefinitions.createAnnotation(ref1.getProperties(),
AnnotationDefinitions.XSD_TYPE);
c.getTypeDefinitions().add(ref1);
/*
@@ -467,7 +469,8 @@
src.setName(TEST_TYPE_LP);
src.setDataType(new QName(TEST_TYPE_NS,TEST_TYPE_LP).toString());
src.setTypeSystem(TypeSystem.XSD);
- src.getProperties().put(AnnotationDefinitions.XSD_TYPE, new
Annotation(AnnotationDefinitions.XSD_TYPE));
+
+ AnnotationDefinitions.createAnnotation(src.getProperties(),
AnnotationDefinitions.XSD_TYPE);
c.getTypeDefinitions().add(src);
Type t=new Type();
@@ -553,7 +556,7 @@
ref1.setName(TEST_TYPE_LP);
ref1.setDataType(new QName(TEST_NAME_SPACE,TEST_TYPE_LP).toString());
ref1.setTypeSystem(TypeSystem.XSD);
- ref1.getProperties().put(AnnotationDefinitions.XSD_TYPE, new
Annotation(AnnotationDefinitions.XSD_TYPE));
+ AnnotationDefinitions.createAnnotation(ref1.getProperties(),
AnnotationDefinitions.XSD_TYPE);
c.getTypeDefinitions().add(ref1);
/*
@@ -582,7 +585,7 @@
ref2.setName(TEST_TYPE_LP2);
ref2.setDataType(new QName(TEST_NAME_SPACE2,TEST_TYPE_LP).toString());
ref2.setTypeSystem(TypeSystem.XSD);
- ref2.getProperties().put(AnnotationDefinitions.XSD_TYPE, new
Annotation(AnnotationDefinitions.XSD_TYPE));
+ AnnotationDefinitions.createAnnotation(ref2.getProperties(),
AnnotationDefinitions.XSD_TYPE);
c.getTypeDefinitions().add(ref2);
/*
@@ -610,7 +613,7 @@
ref3.setName(TEST_TYPE_LP3);
ref3.setDataType(new QName(TEST_NAME_SPACE3,TEST_TYPE_LP).toString());
ref3.setTypeSystem(TypeSystem.XSD);
- ref3.getProperties().put(AnnotationDefinitions.XSD_TYPE, new
Annotation(AnnotationDefinitions.XSD_TYPE));
+ AnnotationDefinitions.createAnnotation(ref3.getProperties(),
AnnotationDefinitions.XSD_TYPE);
c.getTypeDefinitions().add(ref3);
/*