[savara-commits] savara SVN: r644 - in branches/experimental/2.0.x: bundles/org.savara.bpel/src/test/java/org/savara/bpel/generator and 6 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Feb 8 18:26:51 EST 2011


Author: objectiser
Date: 2011-02-08 18:26:51 -0500 (Tue, 08 Feb 2011)
New Revision: 644

Added:
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/PolicyQuote at PolicyQuoteProcessService.bpel
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/protocol/PolicyQuote.spr
Modified:
   branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/ChoiceModelChangeRule.java
   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.pi4soa.cdm/src/test/java/org/savara/pi4soa/cdm/parser/CDMProtocolParserTest.java
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/java/org/savara/pi4soa/cdm/parser/ParserTest.java
   branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/osgi/Activator.java
   branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/util/ProtocolServices.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.core/src/java/org/savara/tools/core/osgi/Activator.java
Log:
Updated so if choice roles across paths are not consistent, then only a label is used.

Modified: branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/ChoiceModelChangeRule.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/ChoiceModelChangeRule.java	2011-02-08 22:16:03 UTC (rev 643)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/main/java/org/savara/bpel/model/change/ChoiceModelChangeRule.java	2011-02-08 23:26:51 UTC (rev 644)
@@ -437,173 +437,175 @@
 				
 				TSequence seq=new TSequence();
 				
-				Contract contract=null;
-				
-				if ((InteractionUtil.isRequest(path) && !InteractionUtil.isSend(path)) ||
-						(InteractionUtil.isResponse(path) && InteractionUtil.isSend(path))) {
-					contract = ModelChangeUtils.getContract(context, role);
-				} else if (InteractionUtil.isRequest(path)) {
-					contract = ModelChangeUtils.getContract(context, elem.getToRole());
-				} else {
-					contract = ModelChangeUtils.getContract(context, elem.getFromRole());
-				}
-				
-				// Handle when message signature
-				if (InteractionUtil.isResponse(path)) {
-					QName qname=null;
-					if (InteractionUtil.isRequest(path)) {
-						qname = WSDLGeneratorUtil.getRequestMessageType(contract.getNamespace(),
-								path.getMessageSignature().getOperation());
-					} else if (InteractionUtil.isFaultResponse(path)) {
-						qname = WSDLGeneratorUtil.getFaultMessageType(contract.getNamespace(),
-								InteractionUtil.getFaultName(path));
+				if (path.getMessageSignature().getTypeReferences().size() > 0) {
+					Contract contract=null;
+					
+					if ((InteractionUtil.isRequest(path) && !InteractionUtil.isSend(path)) ||
+							(InteractionUtil.isResponse(path) && InteractionUtil.isSend(path))) {
+						contract = ModelChangeUtils.getContract(context, role);
+					} else if (InteractionUtil.isRequest(path)) {
+						contract = ModelChangeUtils.getContract(context, elem.getToRole());
 					} else {
-						qname = WSDLGeneratorUtil.getResponseMessageType(contract.getNamespace(),
-								path.getMessageSignature().getOperation());
+						contract = ModelChangeUtils.getContract(context, elem.getFromRole());
 					}
 					
-					String varName = qname.getLocalPart()+"Var";
-
-					TVariable var=VariableUtil.getVariable(bpelModel, varName);
-
-					if (var == null) {
-						var = new TVariable();
-						var.setName(varName);
+					// Handle when message signature
+					if (InteractionUtil.isResponse(path)) {
+						QName qname=null;
+						if (InteractionUtil.isRequest(path)) {
+							qname = WSDLGeneratorUtil.getRequestMessageType(contract.getNamespace(),
+									path.getMessageSignature().getOperation());
+						} else if (InteractionUtil.isFaultResponse(path)) {
+							qname = WSDLGeneratorUtil.getFaultMessageType(contract.getNamespace(),
+									InteractionUtil.getFaultName(path));
+						} else {
+							qname = WSDLGeneratorUtil.getResponseMessageType(contract.getNamespace(),
+									path.getMessageSignature().getOperation());
+						}
 						
-						var.setMessageType(qname);
+						String varName = qname.getLocalPart()+"Var";
+	
+						TVariable var=VariableUtil.getVariable(bpelModel, varName);
+	
+						if (var == null) {
+							var = new TVariable();
+							var.setName(varName);
+							
+							var.setMessageType(qname);
+							
+							bpelModel.getVariables().getVariable().add(var);
+						}
+	
+						TReply reply = new TReply();
+						seq.getActivity().add(reply);
 						
-						bpelModel.getVariables().getVariable().add(var);
-					}
-
-					TReply reply = new TReply();
-					seq.getActivity().add(reply);
-					
-					// TODO: What about if multiple 'to' roles
-					TPartnerLink pl=new TPartnerLink();
-
-					pl.setMyRole(role.getName()+"Service");
-					pl.setName(elem.getToRole().getName()+"To"+role.getName());
-					
-					String plt=elem.getToRole().getName()+"To"+role.getName()+"Service"+"LT";
-					
-					pl.setPartnerLinkType(new QName(contract.getNamespace(), plt)); //roleNamespace, plt));
+						// TODO: What about if multiple 'to' roles
+						TPartnerLink pl=new TPartnerLink();
 	
-					//portType = role.getName()+"PT";
-					
-					if (InteractionUtil.isFaultResponse(path)) {
-						String faultName=InteractionUtil.getFaultName(path);
+						pl.setMyRole(role.getName()+"Service");
+						pl.setName(elem.getToRole().getName()+"To"+role.getName());
 						
-						// TODO: Not sure what to do about namespace here?
-						reply.setFaultName(new QName(contract.getNamespace(), faultName));
-					}
-					
-					if (varName != null) {
-						reply.setVariable(varName);
-					}
-
-					// Create partner link
-					TPartnerLink other=
-							PartnerLinkUtil.getPartnerLink(bpelModel, pl.getName());
-					if (other == null) {
-						bpelModel.getPartnerLinks().getPartnerLink().add(pl);
-					} else {
-						if (other.getPartnerRole() == null &&
-								pl.getPartnerRole() != null) {
-							other.setPartnerRole(pl.getPartnerRole());
+						String plt=elem.getToRole().getName()+"To"+role.getName()+"Service"+"LT";
+						
+						pl.setPartnerLinkType(new QName(contract.getNamespace(), plt)); //roleNamespace, plt));
+		
+						//portType = role.getName()+"PT";
+						
+						if (InteractionUtil.isFaultResponse(path)) {
+							String faultName=InteractionUtil.getFaultName(path);
+							
+							// TODO: Not sure what to do about namespace here?
+							reply.setFaultName(new QName(contract.getNamespace(), faultName));
 						}
-						if (other.getMyRole() == null &&
-								pl.getMyRole() != null) {
-							other.setMyRole(pl.getMyRole());
+						
+						if (varName != null) {
+							reply.setVariable(varName);
 						}
-					}
-
-					String portType=null;
-					
-					if (contract.getInterfaces().size() > 0) {
-						portType = contract.getInterfaces().iterator().next().getName();
-					}
-
-					reply.setPartnerLink(pl.getName());			
-					reply.setPortType(new QName(contract.getNamespace(),portType));	
-					if (path.getMessageSignature() != null) {
-						reply.setOperation(path.getMessageSignature().getOperation());
-					}
-
-					reply.setName(InteractionUtil.getName(path));
-				} else {
-					QName qname=null;
-					if (InteractionUtil.isRequest(path)) {
-						qname = WSDLGeneratorUtil.getRequestMessageType(contract.getNamespace(),
-								path.getMessageSignature().getOperation());
-					} else if (InteractionUtil.isFaultResponse(path)) {
-						qname = WSDLGeneratorUtil.getFaultMessageType(contract.getNamespace(),
-								InteractionUtil.getFaultName(path));
+	
+						// Create partner link
+						TPartnerLink other=
+								PartnerLinkUtil.getPartnerLink(bpelModel, pl.getName());
+						if (other == null) {
+							bpelModel.getPartnerLinks().getPartnerLink().add(pl);
+						} else {
+							if (other.getPartnerRole() == null &&
+									pl.getPartnerRole() != null) {
+								other.setPartnerRole(pl.getPartnerRole());
+							}
+							if (other.getMyRole() == null &&
+									pl.getMyRole() != null) {
+								other.setMyRole(pl.getMyRole());
+							}
+						}
+	
+						String portType=null;
+						
+						if (contract.getInterfaces().size() > 0) {
+							portType = contract.getInterfaces().iterator().next().getName();
+						}
+	
+						reply.setPartnerLink(pl.getName());			
+						reply.setPortType(new QName(contract.getNamespace(),portType));	
+						if (path.getMessageSignature() != null) {
+							reply.setOperation(path.getMessageSignature().getOperation());
+						}
+	
+						reply.setName(InteractionUtil.getName(path));
 					} else {
-						qname = WSDLGeneratorUtil.getResponseMessageType(contract.getNamespace(),
-								path.getMessageSignature().getOperation());
-					}
-					
-					String varName = qname.getLocalPart()+"Var";
-
-					TVariable var=VariableUtil.getVariable(bpelModel, varName);
-
-					if (var == null) {
-						var = new TVariable();
-						var.setName(varName);
+						QName qname=null;
+						if (InteractionUtil.isRequest(path)) {
+							qname = WSDLGeneratorUtil.getRequestMessageType(contract.getNamespace(),
+									path.getMessageSignature().getOperation());
+						} else if (InteractionUtil.isFaultResponse(path)) {
+							qname = WSDLGeneratorUtil.getFaultMessageType(contract.getNamespace(),
+									InteractionUtil.getFaultName(path));
+						} else {
+							qname = WSDLGeneratorUtil.getResponseMessageType(contract.getNamespace(),
+									path.getMessageSignature().getOperation());
+						}
 						
-						var.setMessageType(qname);
+						String varName = qname.getLocalPart()+"Var";
+	
+						TVariable var=VariableUtil.getVariable(bpelModel, varName);
+	
+						if (var == null) {
+							var = new TVariable();
+							var.setName(varName);
+							
+							var.setMessageType(qname);
+							
+							bpelModel.getVariables().getVariable().add(var);
+						}
+	
+						TInvoke invoke=new TInvoke();
+						seq.getActivity().add(invoke);
+											
+						if (varName != null) {
+							invoke.setInputVariable(varName);
+						}
 						
-						bpelModel.getVariables().getVariable().add(var);
-					}
-
-					TInvoke invoke=new TInvoke();
-					seq.getActivity().add(invoke);
-					
-					// TODO: What about if multiple 'to' roles
-					TPartnerLink pl=new TPartnerLink();
-
-					pl.setPartnerRole(elem.getToRole().getName()+"Requester");
-					pl.setName(role.getName()+"To"+elem.getToRole().getName());
-					
-					String plt=role.getName()+"To"+elem.getToRole().getName()+"LT";
-					
-					pl.setPartnerLinkType(new QName(contract.getNamespace(), plt)); //roleNamespace, plt));
-
-					//portType = interaction.getToRole().getName()+"PT";
-					
-					if (varName != null) {
-						invoke.setInputVariable(varName);
-					}
-					
-					// Create partner link
-					TPartnerLink other=
-							PartnerLinkUtil.getPartnerLink(bpelModel, pl.getName());
-					if (other == null) {
-						bpelModel.getPartnerLinks().getPartnerLink().add(pl);
-					} else {
-						if (other.getPartnerRole() == null &&
-								pl.getPartnerRole() != null) {
-							other.setPartnerRole(pl.getPartnerRole());
+						// TODO: What about if multiple 'to' roles
+						TPartnerLink pl=new TPartnerLink();
+	
+						if (role != null && elem.getToRole() != null) {
+							pl.setPartnerRole(elem.getToRole().getName()+"Requester");
+							pl.setName(role.getName()+"To"+elem.getToRole().getName());
+							
+							String plt=role.getName()+"To"+elem.getToRole().getName()+"LT";
+							
+							pl.setPartnerLinkType(new QName(contract.getNamespace(), plt)); //roleNamespace, plt));
+	
+							// Create partner link
+							TPartnerLink other=
+									PartnerLinkUtil.getPartnerLink(bpelModel, pl.getName());
+							if (other == null) {
+								bpelModel.getPartnerLinks().getPartnerLink().add(pl);
+							} else {
+								if (other.getPartnerRole() == null &&
+										pl.getPartnerRole() != null) {
+									other.setPartnerRole(pl.getPartnerRole());
+								}
+								if (other.getMyRole() == null &&
+										pl.getMyRole() != null) {
+									other.setMyRole(pl.getMyRole());
+								}
+							}
 						}
-						if (other.getMyRole() == null &&
-								pl.getMyRole() != null) {
-							other.setMyRole(pl.getMyRole());
+						
+						String portType=null;
+						
+						if (contract.getInterfaces().size() > 0) {
+							portType = contract.getInterfaces().iterator().next().getName();
 						}
+	
+						invoke.setPartnerLink(pl.getName());			
+						invoke.setPortType(new QName(contract.getNamespace(),portType));	
+						if (path.getMessageSignature() != null) {
+							invoke.setOperation(path.getMessageSignature().getOperation());
+						}
+	
+						invoke.setName(InteractionUtil.getName(path));
 					}
-
-					String portType=null;
-					
-					if (contract.getInterfaces().size() > 0) {
-						portType = contract.getInterfaces().iterator().next().getName();
-					}
-
-					invoke.setPartnerLink(pl.getName());			
-					invoke.setPortType(new QName(contract.getNamespace(),portType));	
-					if (path.getMessageSignature() != null) {
-						invoke.setOperation(path.getMessageSignature().getOperation());
-					}
-
-					invoke.setName(InteractionUtil.getName(path));
 				}
 				
 				// Process the activities within the conversation

Modified: 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	2011-02-08 22:16:03 UTC (rev 643)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/java/org/savara/bpel/generator/GeneratorTest.java	2011-02-08 23:26:51 UTC (rev 644)
@@ -51,6 +51,8 @@
         suite.addTest(new ProtocolToBPELTester("ReqRespFault", "Buyer"));
         suite.addTest(new ProtocolToBPELTester("ReqRespFault", "Seller"));
         
+        suite.addTest(new ProtocolToBPELTester("PolicyQuote", "PolicyQuoteProcessService"));
+
         return suite;
     }
     
@@ -77,8 +79,8 @@
     	 */
     	public void run(TestResult result) {
     		// Setup scribble services
-    		ProtocolServices.setProtocolProjector(
-    				new org.scribble.protocol.projection.impl.ProtocolProjectorImpl());
+    		//ProtocolServices.setProtocolProjector(
+    		//		new org.scribble.protocol.projection.impl.ProtocolProjectorImpl());
     		
     		// Run test
     		result.startTest(this);

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/PolicyQuote at PolicyQuoteProcessService.bpel
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/PolicyQuote at PolicyQuoteProcessService.bpel	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/results/bpel/PolicyQuote at PolicyQuoteProcessService.bpel	2011-02-08 23:26:51 UTC (rev 644)
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<process xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:pcs="http://www.example.org/policyQuoteCalculationService" xmlns:pes="http://www.example.org/policyQuoteEntityService" xmlns:drv="http://dmv.com/drivingRecord" xmlns:tns="http://www.pi4soa.org/PolicyQuote" xmlns:cred="http://creditagency.com/creditCheck" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pol="http://www.example.org/policyQuote" xmlns:pps="http://www.example.org/policyQuoteProcessService" xmlns:ca="http://creditagency.com/creditCheckService" xmlns:dmv="http://dmv.com/drivingRecordService" targetNamespace="http://www.example.org/policyQuoteProcessService" name="PolicyQuoteProcess_PolicyQuoteProcessService">
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PolicyQuoteProcess_PolicyQuoteProcessService.wsdl" namespace="http://www.example.org/policyQuoteProcessService"/>
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PolicyQuoteProcess_Driver.wsdl" namespace="http://www.pi4soa.org/PolicyQuote"/>
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PolicyQuoteProcess_CreditCheckService.wsdl" namespace="http://creditagency.com/creditCheckService"/>
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PolicyQuoteProcess_DrivingRecordService.wsdl" namespace="http://dmv.com/drivingRecordService"/>
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PolicyQuoteProcess_PolicyQuoteCalculationService.wsdl" namespace="http://www.example.org/policyQuoteCalculationService"/>
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PolicyQuoteProcess_PolicyQuoteEntityService.wsdl" namespace="http://www.example.org/policyQuoteEntityService"/>
+    <import importType="http://schemas.xmlsoap.org/wsdl/" location="PolicyQuoteProcess_PolicyQuoteProcessServiceArtifacts.wsdl" namespace="http://www.example.org/policyQuoteProcessService"/>
+    <partnerLinks>
+        <partnerLink myRole="PolicyQuoteProcessService" partnerLinkType="pps:DriverToPolicyQuoteProcessServiceServiceLT" name="DriverToPolicyQuoteProcessService"/>
+        <partnerLink partnerRole="DrivingRecordServiceRequester" partnerLinkType="pps:PolicyQuoteProcessServiceToDrivingRecordServiceLT" name="PolicyQuoteProcessServiceToDrivingRecordService"/>
+        <partnerLink myRole="PolicyQuoteProcessService" partnerLinkType="pps:DrivingRecordServiceToPolicyQuoteProcessServiceServiceLT" name="DrivingRecordServiceToPolicyQuoteProcessService"/>
+        <partnerLink partnerRole="CreditCheckServiceRequester" partnerLinkType="pps:PolicyQuoteProcessServiceToCreditCheckServiceLT" name="PolicyQuoteProcessServiceToCreditCheckService"/>
+        <partnerLink partnerRole="PolicyQuoteCalculationServiceRequester" partnerLinkType="pps:PolicyQuoteProcessServiceToPolicyQuoteCalculationServiceLT" name="PolicyQuoteProcessServiceToPolicyQuoteCalculationService"/>
+        <partnerLink partnerRole="PolicyQuoteEntityServiceRequester" partnerLinkType="pps:PolicyQuoteProcessServiceToPolicyQuoteEntityServiceLT" name="PolicyQuoteProcessServiceToPolicyQuoteEntityService"/>
+    </partnerLinks>
+    <variables>
+        <variable messageType="pps:receivePolicyQuoteRequest" name="receivePolicyQuoteRequestVar"/>
+        <variable messageType="dmv:checkDrivingRecordRequest" name="checkDrivingRecordRequestVar"/>
+        <variable messageType="pps:receiveDrivingRecordRequest" name="receiveDrivingRecordRequestVar"/>
+        <variable messageType="ca:checkCreditRequest" name="checkCreditRequestVar"/>
+        <variable messageType="ca:checkCreditResponse" name="checkCreditResponseVar"/>
+        <variable messageType="pcs:calculatePolicyQuoteRequest" name="calculatePolicyQuoteRequestVar"/>
+        <variable messageType="pcs:calculatePolicyQuoteResponse" name="calculatePolicyQuoteResponseVar"/>
+        <variable messageType="pes:createPolicyQuoteRequest" name="createPolicyQuoteRequestVar"/>
+        <variable messageType="pes:createPolicyQuoteResponse" name="createPolicyQuoteResponseVar"/>
+        <variable messageType="pps:receivePolicyQuoteResponse" name="receivePolicyQuoteResponseVar"/>
+        <variable messageType="pps:policyQuoteFaultFault" name="policyQuoteFaultFaultVar"/>
+    </variables>
+    <sequence>
+        <receive createInstance="yes" variable="receivePolicyQuoteRequestVar" operation="receivePolicyQuote" portType="pps:PolicyQuoteProcessService" partnerLink="DriverToPolicyQuoteProcessService" name="Receive_PolicyQuote"/>
+        <invoke inputVariable="checkDrivingRecordRequestVar" operation="checkDrivingRecord" portType="dmv:DrivingRecordService" partnerLink="PolicyQuoteProcessServiceToDrivingRecordService" name="Send_DrivingRecordRequest"/>
+        <receive variable="receiveDrivingRecordRequestVar" operation="receiveDrivingRecord" portType="pps:PolicyQuoteProcessService" partnerLink="DrivingRecordServiceToPolicyQuoteProcessService" name="Receive_DrivingRecordResponse"/>
+        <if>
+            <sequence>
+                <invoke outputVariable="checkCreditResponseVar" inputVariable="checkCreditRequestVar" operation="checkCredit" portType="ca:CreditCheckService" partnerLink="PolicyQuoteProcessServiceToCreditCheckService" name="Send_CreditCheckRequest"/>
+                <invoke outputVariable="calculatePolicyQuoteResponseVar" inputVariable="calculatePolicyQuoteRequestVar" operation="calculatePolicyQuote" portType="pcs:PolicyQuoteCalculationService" partnerLink="PolicyQuoteProcessServiceToPolicyQuoteCalculationService" name="Send_PolicyQuote"/>
+                <invoke outputVariable="createPolicyQuoteResponseVar" inputVariable="createPolicyQuoteRequestVar" operation="createPolicyQuote" portType="pes:PolicyQuoteEntityService" partnerLink="PolicyQuoteProcessServiceToPolicyQuoteEntityService" name="Send_PolicyQuote"/>
+                <reply variable="receivePolicyQuoteResponseVar" operation="receivePolicyQuote" portType="pps:PolicyQuoteProcessService" partnerLink="DriverToPolicyQuoteProcessService" name="Send_PolicyQuoteReply"/>
+            </sequence>
+            <else>
+                <sequence>
+                    <reply faultName="pps:policyQuoteFault" variable="policyQuoteFaultFaultVar" operation="receivePolicyQuote" portType="pps:PolicyQuoteProcessService" partnerLink="DriverToPolicyQuoteProcessService" name="Send_PolicyQuoteFault"/>
+                </sequence>
+            </else>
+        </if>
+    </sequence>
+</process>

Added: branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/protocol/PolicyQuote.spr
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/protocol/PolicyQuote.spr	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.bpel/src/test/resources/testmodels/protocol/PolicyQuote.spr	2011-02-08 23:26:51 UTC (rev 644)
@@ -0,0 +1,70 @@
+import xsd "{http://creditagency.com/creditCheck}creditCheckRequest" as CreditCheckRequest, "{http://creditagency.com/creditCheck}creditCheckResponse" as CreditCheckResponse from "http://creditagency.com/creditCheck";
+import xsd "{http://dmv.com/drivingRecord}drivingRecordRequest" as DrivingRecordRequest, "{http://dmv.com/drivingRecord}drivingRecordResponse" as DrivingRecordResponse from "http://dmv.com/drivingRecord";
+import xsd "{http://www.w3.org/2001/XMLSchema}string" as IDSSNType, "{http://www.w3.org/2001/XMLSchema}anyURI" as URITokenType from "http://www.w3.org/2001/XMLSchema";
+import xsd "{http://www.example.org/policyQuote}policyQuote" as PolicyQuote, "{http://www.example.org/policyQuote}policyQuoteFault" as PolicyQuoteFault, "{http://www.example.org/policyQuote}policyQuoteReply" as PolicyQuoteReply from "http://www.example.org/policyQuote";
+[[ SourceComponent(id=//@choreographies.0) ]]
+[[ Namespace(name=http://www.pi4soa.org/PolicyQuote,role=Driver) ]]
+[[ Namespace(name=http://creditagency.com/creditCheckService,role=CreditCheckService) ]]
+[[ Namespace(name=http://dmv.com/drivingRecordService,role=DrivingRecordService) ]]
+[[ Namespace(name=http://www.example.org/policyQuoteCalculationService,role=PolicyQuoteCalculationService) ]]
+[[ Namespace(name=http://www.example.org/policyQuoteEntityService,role=PolicyQuoteEntityService) ]]
+[[ Namespace(name=http://www.example.org/policyQuoteProcessService,role=PolicyQuoteProcessService) ]]
+[[ Type(prefix=tns,namespace=http://www.pi4soa.org/PolicyQuote) ]]
+[[ Type(prefix=xsd,namespace=http://www.w3.org/2001/XMLSchema) ]]
+[[ Type(location=schema/policyQuote.xsd,prefix=pol,namespace=http://www.example.org/policyQuote) ]]
+[[ Type(location=schema/drivingRecord.xsd,prefix=drv,namespace=http://dmv.com/drivingRecord) ]]
+[[ Type(location=schema/creditCheck.xsd,prefix=cred,namespace=http://creditagency.com/creditCheck) ]]
+[[ Type(prefix=pps,namespace=http://www.example.org/policyQuoteProcessService) ]]
+[[ Type(prefix=pcs,namespace=http://www.example.org/policyQuoteCalculationService) ]]
+[[ Type(prefix=pes,namespace=http://www.example.org/policyQuoteEntityService) ]]
+[[ Type(prefix=dmv,namespace=http://dmv.com/drivingRecordService) ]]
+[[ Type(prefix=ca,namespace=http://creditagency.com/creditCheckService) ]]
+protocol PolicyQuoteProcess {
+	role Driver, CreditCheckService, DrivingRecordService, PolicyQuoteCalculationService, PolicyQuoteEntityService, PolicyQuoteProcessService;
+	[[ SourceComponent(id=//@choreographies.0/@activities.0/@exchangeDetails.0) ]]
+	[[ Interface(name={http://www.pi4soa.org/PolicyQuote}PolicyQuoteProcessService) ]]
+	[[ Correlation(request=receivePolicyQuote) ]]
+	receivePolicyQuote(PolicyQuote) from Driver to PolicyQuoteProcessService;
+	[[ SourceComponent(id=//@choreographies.0/@activities.1/@exchangeDetails.0) ]]
+	[[ Interface(name={http://www.pi4soa.org/PolicyQuote}DrivingRecordService) ]]
+	checkDrivingRecord(DrivingRecordRequest) from PolicyQuoteProcessService to DrivingRecordService;
+	[[ SourceComponent(id=//@choreographies.0/@activities.2/@exchangeDetails.0) ]]
+	[[ Interface(name={http://www.pi4soa.org/PolicyQuote}DrivingRecordCallbackService) ]]
+	receiveDrivingRecord(DrivingRecordResponse) from DrivingRecordService to PolicyQuoteProcessService;
+	[[ SourceComponent(id=//@choreographies.0/@activities.3) ]]
+	choice {
+		label0():
+			[[ Correlation(request=checkCredit) ]]
+			checkCredit(CreditCheckRequest) from PolicyQuoteProcessService to CreditCheckService;
+			[[ SourceComponent(id=//@choreographies.0/@activities.3/@activities.0/@activities.0/@activities.0/@exchangeDetails.1) ]]
+			[[ Interface(name={http://www.pi4soa.org/PolicyQuote}CreditCheckService) ]]
+			[[ Correlation(replyTo=checkCredit) ]]
+			checkCredit(CreditCheckResponse) from CreditCheckService to PolicyQuoteProcessService;
+			[[ SourceComponent(id=//@choreographies.0/@activities.3/@activities.0/@activities.0/@activities.1/@exchangeDetails.0) ]]
+			[[ Interface(name={http://www.pi4soa.org/PolicyQuote}PolicyQuoteCalculationService) ]]
+			[[ Correlation(request=calculatePolicyQuote) ]]
+			calculatePolicyQuote(PolicyQuote) from PolicyQuoteProcessService to PolicyQuoteCalculationService;
+			[[ SourceComponent(id=//@choreographies.0/@activities.3/@activities.0/@activities.0/@activities.1/@exchangeDetails.1) ]]
+			[[ Interface(name={http://www.pi4soa.org/PolicyQuote}PolicyQuoteCalculationService) ]]
+			[[ Correlation(replyTo=calculatePolicyQuote) ]]
+			calculatePolicyQuote(PolicyQuoteReply) from PolicyQuoteCalculationService to PolicyQuoteProcessService;
+			[[ SourceComponent(id=//@choreographies.0/@activities.3/@activities.0/@activities.0/@activities.2/@exchangeDetails.0) ]]
+			[[ Interface(name={http://www.pi4soa.org/PolicyQuote}PolicyQuoteEntityService) ]]
+			[[ Correlation(request=createPolicyQuote) ]]
+			createPolicyQuote(PolicyQuote) from PolicyQuoteProcessService to PolicyQuoteEntityService;
+			[[ SourceComponent(id=//@choreographies.0/@activities.3/@activities.0/@activities.0/@activities.2/@exchangeDetails.1) ]]
+			[[ Interface(name={http://www.pi4soa.org/PolicyQuote}PolicyQuoteEntityService) ]]
+			[[ Correlation(replyTo=createPolicyQuote) ]]
+			createPolicyQuote(PolicyQuoteReply) from PolicyQuoteEntityService to PolicyQuoteProcessService;
+			[[ SourceComponent(id=//@choreographies.0/@activities.3/@activities.0/@activities.0/@activities.3/@exchangeDetails.0) ]]
+			[[ Interface(name={http://www.pi4soa.org/PolicyQuote}PolicyQuoteProcessService) ]]
+			[[ Correlation(replyTo=receivePolicyQuote) ]]
+			receivePolicyQuote(PolicyQuoteReply) from PolicyQuoteProcessService to Driver;
+
+		label1():
+			[[ Fault(name=policyQuoteFault) ]]
+			[[ Correlation(replyTo=receivePolicyQuote) ]]
+			receivePolicyQuote(PolicyQuoteFault) from PolicyQuoteProcessService to Driver;
+
+	}
+}

Modified: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/java/org/savara/pi4soa/cdm/parser/CDMProtocolParserTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/java/org/savara/pi4soa/cdm/parser/CDMProtocolParserTest.java	2011-02-08 22:16:03 UTC (rev 643)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/java/org/savara/pi4soa/cdm/parser/CDMProtocolParserTest.java	2011-02-08 23:26:51 UTC (rev 644)
@@ -73,8 +73,8 @@
 	
 	@org.junit.Before
 	public void setup() {
-		ProtocolServices.setProtocolProjector(
-				new org.scribble.protocol.projection.impl.ProtocolProjectorImpl());
+		//ProtocolServices.setProtocolProjector(
+		//		new org.scribble.protocol.projection.impl.ProtocolProjectorImpl());
 	}
 
 	@org.junit.Test

Modified: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/java/org/savara/pi4soa/cdm/parser/ParserTest.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/java/org/savara/pi4soa/cdm/parser/ParserTest.java	2011-02-08 22:16:03 UTC (rev 643)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/java/org/savara/pi4soa/cdm/parser/ParserTest.java	2011-02-08 23:26:51 UTC (rev 644)
@@ -61,8 +61,8 @@
     	 */
     	public void run(TestResult result) {
     		// Setup scribble services
-    		ProtocolServices.setProtocolProjector(
-    				new org.scribble.protocol.projection.impl.ProtocolProjectorImpl());
+    		//ProtocolServices.setProtocolProjector(
+    		//		new org.scribble.protocol.projection.impl.ProtocolProjectorImpl());
     		
     		// Run test
     		result.startTest(this);

Modified: branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/osgi/Activator.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/osgi/Activator.java	2011-02-08 22:16:03 UTC (rev 643)
+++ branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/osgi/Activator.java	2011-02-08 23:26:51 UTC (rev 644)
@@ -29,11 +29,13 @@
 		org.savara.protocol.util.ProtocolServices.setParserManager(ppm);
 		
 		// Initialize the protocol projector
+		/*
 		sref=context.getServiceReference(ProtocolProjector.class.getName());
 		
 		ProtocolProjector pp=(ProtocolProjector)context.getService(sref);
 		
 		org.savara.protocol.util.ProtocolServices.setProtocolProjector(pp);
+		*/
 	}
 
 	/*

Modified: branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/util/ProtocolServices.java
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/util/ProtocolServices.java	2011-02-08 22:16:03 UTC (rev 643)
+++ branches/experimental/2.0.x/bundles/org.savara.protocol/src/main/java/org/savara/protocol/util/ProtocolServices.java	2011-02-08 23:26:51 UTC (rev 644)
@@ -60,13 +60,15 @@
 	}
 	*/
 	
+	/*
 	public static ProtocolProjector getProtocolProjector() {
 		return(m_protocolProjector);
 	}
 	
 	public static void setProtocolProjector(ProtocolProjector projector) {
 		m_protocolProjector = projector;
-	}	
+	}
+	*/	
 	
 	public static ProtocolExportManager getProtocolExportManager() {
 		return(m_protocolExportManager);

Modified: branches/experimental/2.0.x/tools/plugins/org.savara.tools.core/src/java/org/savara/tools/core/osgi/Activator.java
===================================================================
--- branches/experimental/2.0.x/tools/plugins/org.savara.tools.core/src/java/org/savara/tools/core/osgi/Activator.java	2011-02-08 22:16:03 UTC (rev 643)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.core/src/java/org/savara/tools/core/osgi/Activator.java	2011-02-08 23:26:51 UTC (rev 644)
@@ -18,6 +18,7 @@
 package org.savara.tools.core.osgi;
 
 import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
 import org.osgi.util.tracker.ServiceTracker;
@@ -59,6 +60,26 @@
 		super.start(context);
 		plugin = this;
 		
+		// Make sure any bundles, associated with scribble, are started (excluding
+		// the designer itself)
+		Bundle[] bundles=context.getBundles();
+
+		for (int i=0; i < bundles.length; i++) {
+			Bundle bundle=bundles[i];
+			
+			if (bundle != null) {
+				//Object val=bundle.getHeaders().get(SERVICE_COMPONENT);
+				if (bundle.getSymbolicName().startsWith("org.scribble.") &&
+						bundle.getSymbolicName().endsWith("designer") == false) {
+				
+					//if (bundle.getState() == Bundle.RESOLVED) {
+						logger.fine("Pre-empt bundle start: "+bundle);
+						bundle.start();
+					//}
+				}
+			}
+		}
+
 		// Initialize the protocol parser manager
 		ServiceReference sref=context.getServiceReference(ProtocolParserManager.class.getName());
 		



More information about the savara-commits mailing list