[savara-commits] savara SVN: r640 - in branches/experimental/2.0.x: bundles/org.savara.pi4soa.cdm/src/test/java/org/savara/pi4soa/cdm/parser and 3 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Mon Feb 7 15:17:45 EST 2011


Author: objectiser
Date: 2011-02-07 15:17:44 -0500 (Mon, 07 Feb 2011)
New Revision: 640

Added:
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/resources/results/protocol/PolicyQuote.spr
   branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/resources/testmodels/cdm/PolicyQuote.cdm
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/test/java/org/savara/pi4soa/cdm/parser/ParserTest.java
   branches/experimental/2.0.x/tools/plugins/org.savara.tools.core/src/java/org/savara/tools/core/osgi/Activator.java
Log:
Add policy quote choreo to testcases, and fix npe when fromRole not determined.

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-02-05 16:52:54 UTC (rev 639)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/main/java/org/savara/pi4soa/cdm/parser/rules/ChoiceConverterRuleImpl.java	2011-02-07 20:17:44 UTC (rev 640)
@@ -103,6 +103,16 @@
 					 */
 					if (activity instanceof Choice) {
 						blocks.addAll(((Choice)activity).getWhens());
+						
+						// TODO: If fromRole not set, use choice one? If fromRole set,
+						// then may need to compare? Same for two roles?
+						if (fromRole == null) {
+							fromRole = ((Choice)activity).getFromRole();
+							
+							if (toRoles.contains(((Choice)activity).getToRole()) == false) {
+								toRoles.add(((Choice)activity).getToRole());
+							}
+						}
 					} else {
 
 						When block=new When();

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-05 16:52:54 UTC (rev 639)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/java/org/savara/pi4soa/cdm/parser/ParserTest.java	2011-02-07 20:17:44 UTC (rev 640)
@@ -32,6 +32,7 @@
         TestSuite suite = new TestSuite("Choreography->Protocol Parser Tests");
 
         suite.addTest(new ChoreographyToProtocolTester("ESBBroker"));
+        suite.addTest(new ChoreographyToProtocolTester("PolicyQuote"));
         suite.addTest(new ChoreographyToProtocolTester("PurchaseGoods"));
         suite.addTest(new ChoreographyToProtocolTester("ReqRespFault"));
         

Added: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/resources/results/protocol/PolicyQuote.spr
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/resources/results/protocol/PolicyQuote.spr	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/resources/results/protocol/PolicyQuote.spr	2011-02-07 20:17:44 UTC (rev 640)
@@ -0,0 +1,68 @@
+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 from PolicyQuoteProcessService to CreditCheckService {
+		[[ Correlation(request=checkCredit) ]]
+		checkCredit(CreditCheckRequest):
+			[[ 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;
+
+		[[ Fault(name=policyQuoteFault) ]]
+		[[ Correlation(replyTo=receivePolicyQuote) ]]
+		receivePolicyQuote(PolicyQuoteFault):
+
+	}
+}

Added: branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/resources/testmodels/cdm/PolicyQuote.cdm
===================================================================
--- branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/resources/testmodels/cdm/PolicyQuote.cdm	                        (rev 0)
+++ branches/experimental/2.0.x/bundles/org.savara.pi4soa.cdm/src/test/resources/testmodels/cdm/PolicyQuote.cdm	2011-02-07 20:17:44 UTC (rev 640)
@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="MacRoman"?>
+<org.pi4soa.cdl:Package xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:org.pi4soa.cdl="http:///org/pi4soa/cdl.ecore" description="The choreography description for PolicyQuote global process" name="PolicyQuote" author="jdelong" version="2" targetNamespace="http://www.pi4soa.org/PolicyQuote">
+  <typeDefinitions>
+    <nameSpaces description="Target Namespace for PolicyQuote" prefix="tns" uRI="http://www.pi4soa.org/PolicyQuote"/>
+    <nameSpaces description="XML Schema Namespace" prefix="xsd" uRI="http://www.w3.org/2001/XMLSchema"/>
+    <nameSpaces prefix="pol" uRI="http://www.example.org/policyQuote" schemaLocation="schema/policyQuote.xsd"/>
+    <nameSpaces prefix="drv" uRI="http://dmv.com/drivingRecord" schemaLocation="schema/drivingRecord.xsd"/>
+    <nameSpaces prefix="cred" uRI="http://creditagency.com/creditCheck" schemaLocation="schema/creditCheck.xsd"/>
+    <nameSpaces prefix="pps" uRI="http://www.example.org/policyQuoteProcessService" schemaLocation=""/>
+    <nameSpaces prefix="pcs" uRI="http://www.example.org/policyQuoteCalculationService" schemaLocation=""/>
+    <nameSpaces prefix="pes" uRI="http://www.example.org/policyQuoteEntityService" schemaLocation=""/>
+    <nameSpaces prefix="dmv" uRI="http://dmv.com/drivingRecordService"/>
+    <nameSpaces prefix="ca" uRI="http://creditagency.com/creditCheckService"/>
+    <informationTypes description="This is the information type CreditCheckRequest" name="CreditCheckRequest" elementName="cred:creditCheckRequest"/>
+    <informationTypes description="This is the information type CreditCheckResponse" name="CreditCheckResponse" elementName="cred:creditCheckResponse"/>
+    <informationTypes description="This is the information type DrivingRecordRequest" name="DrivingRecordRequest" elementName="drv:drivingRecordRequest"/>
+    <informationTypes description="This is the information type DrivingRecordResponse" name="DrivingRecordResponse" typeName="" elementName="drv:drivingRecordResponse"/>
+    <informationTypes description="This is the information type IDSSNType" name="IDSSNType" typeName="xsd:string"/>
+    <informationTypes description="This is the information type PolicyQuote" name="PolicyQuote" typeName="" elementName="pol:policyQuote"/>
+    <informationTypes description="This is the information type PolicyQuoteFault" name="PolicyQuoteFault" typeName="" elementName="pol:policyQuoteFault"/>
+    <informationTypes description="This is the information type PolicyQuoteReply" name="PolicyQuoteReply" typeName="" elementName="pol:policyQuoteReply"/>
+    <informationTypes description="This is the information type URITokenType" name="URITokenType" elementName="xsd:anyURI"/>
+    <tokens description="This is the token IDSSN" name="IDSSN" informationType="//@typeDefinitions/@informationTypes.4"/>
+    <tokens description="This is the token URIToken" name="URIToken" informationType="//@typeDefinitions/@informationTypes.8"/>
+    <tokenLocators description="This is the token locator CreditCheckRequestIDLocator" token="//@typeDefinitions/@tokens.0" informationType="//@typeDefinitions/@informationTypes.0" query="//cred:ssn/text()" name="CreditCheckRequestIDLocator"/>
+    <tokenLocators description="This is the token locator CreditCheckResponseIDLocator" token="//@typeDefinitions/@tokens.0" informationType="//@typeDefinitions/@informationTypes.1" query="//cred:ssn/text()" name="CreditCheckResponseIDLocator"/>
+    <tokenLocators description="This is the token locator DrivingRecordRequestIDLocator" token="//@typeDefinitions/@tokens.0" informationType="//@typeDefinitions/@informationTypes.2" query="//drv:ssn/text()" name="DrivingRecordRequestIDLocator"/>
+    <tokenLocators description="This is the token locator DrivingRecordResponseIDLocator" token="//@typeDefinitions/@tokens.0" informationType="//@typeDefinitions/@informationTypes.3" query="//drv:ssn/text()" name="DrivingRecordResponseIDLocator"/>
+    <tokenLocators description="This is the token locator PolicyQuoteFaultIDLocator" token="//@typeDefinitions/@tokens.0" informationType="//@typeDefinitions/@informationTypes.6" query="//pol:ssn/text()" name="PolicyQuoteFaultIDLocator"/>
+    <tokenLocators description="This is the token locator PolicyQuoteIDLocator" token="//@typeDefinitions/@tokens.0" informationType="//@typeDefinitions/@informationTypes.5" query="//pol:ssn/text()" name="PolicyQuoteIDLocator"/>
+    <tokenLocators description="This is the token locator PolicyQuoteReplyIDLocator" token="//@typeDefinitions/@tokens.0" informationType="//@typeDefinitions/@informationTypes.7" query="//pol:ssn/text()" name="PolicyQuoteResponseIDLocator"/>
+    <roleTypes description="This is the role type CreditCheckService" name="CreditCheckService">
+      <behaviors description="This is the behavior CreditCheckService" name="CreditCheckService"/>
+    </roleTypes>
+    <roleTypes description="This is the role type Driver" name="Driver">
+      <behaviors description="This is the behavior Driver" name="Driver"/>
+    </roleTypes>
+    <roleTypes description="This is the role type DrivingRecordCallbackService" name="DrivingRecordCallbackService">
+      <behaviors description="This is the behavior DrivingRecordCallbackService" name="DrivingRecordCallbackService"/>
+    </roleTypes>
+    <roleTypes description="This is the role type DrivingRecordService" name="DrivingRecordService">
+      <behaviors description="This is the behavior DrivingRecordService" name="DrivingRecordService" interface=""/>
+    </roleTypes>
+    <roleTypes description="This is the role type PolicyQuoteCalculationService" name="PolicyQuoteCalculationService">
+      <behaviors description="This is the behavior PolicyQuoteCalculationService" name="PolicyQuoteCalculationService"/>
+    </roleTypes>
+    <roleTypes description="This is the role type PolicyQuoteEntityService" name="PolicyQuoteEntityService">
+      <behaviors description="This is the behavior PolicyQuoteEntityService" name="PolicyQuoteEntityService"/>
+    </roleTypes>
+    <roleTypes description="This is the role type PolicyQuoteProcessService" name="PolicyQuoteProcessService">
+      <behaviors description="This is the behavior PolicyQuoteProcessService" name="PolicyQuoteProcessService"/>
+    </roleTypes>
+    <relationshipTypes description="Relationship between Customer and InsuranceAgency" name="DriverPolicyQuote" firstRoleType="//@typeDefinitions/@roleTypes.1" secondRoleType="//@typeDefinitions/@roleTypes.6"/>
+    <relationshipTypes description="Relationship between DrivingRecordService and DrivingRecordCallbackService" name="DrivingRecordDrivingRecordCallback" firstRoleType="//@typeDefinitions/@roleTypes.3" secondRoleType="//@typeDefinitions/@roleTypes.2"/>
+    <relationshipTypes description="Relationship between InsuranceAgency and CreditAgency" name="PolicyQuoteCreditCheck" firstRoleType="//@typeDefinitions/@roleTypes.6" secondRoleType="//@typeDefinitions/@roleTypes.0"/>
+    <relationshipTypes description="Relationship between InsuranceAgency and DMV" name="PolicyQuoteDrivingRecord" firstRoleType="//@typeDefinitions/@roleTypes.6" secondRoleType="//@typeDefinitions/@roleTypes.3"/>
+    <relationshipTypes description="Relationship between PolicyQuoteService and calculatePolicyQuote" name="PolicyQuotePolicyQuoteCalculation" firstRoleType="//@typeDefinitions/@roleTypes.6" secondRoleType="//@typeDefinitions/@roleTypes.4"/>
+    <relationshipTypes description="Relationship between PolicyQuoteService and PolicyQuoteEntityService" name="PolicyQuotePolicyQuoteEntity" firstRoleType="//@typeDefinitions/@roleTypes.6" secondRoleType="//@typeDefinitions/@roleTypes.5"/>
+    <participantTypes description="This is the participant type Driver" name="Driver" roleTypes="//@typeDefinitions/@roleTypes.1"/>
+    <participantTypes description="This is the participant type ca:CreditCheckService" name="ca:CreditCheckService" roleTypes="//@typeDefinitions/@roleTypes.0"/>
+    <participantTypes description="This is the participant type dmv:DrivingRecordService" name="dmv:DrivingRecordService" roleTypes="//@typeDefinitions/@roleTypes.3"/>
+    <participantTypes description="This is the participant type pcs:PolicyQuoteCalculationService" name="pcs:PolicyQuoteCalculationService" roleTypes="//@typeDefinitions/@roleTypes.4"/>
+    <participantTypes description="This is the participant type pes:PolicyQuoteEntityService" name="pes:PolicyQuoteEntityService" roleTypes="//@typeDefinitions/@roleTypes.5"/>
+    <participantTypes description="This is the participant type pps:PolicyQuoteProcessService" name="pps:PolicyQuoteProcessService" roleTypes="//@typeDefinitions/@roleTypes.2 //@typeDefinitions/@roleTypes.6"/>
+    <channelTypes description="This is the channel type CreditCheckChannel" name="CreditCheckChannel" behavior="//@typeDefinitions/@roleTypes.0/@behaviors.0" referenceToken="//@typeDefinitions/@tokens.1" roleType="//@typeDefinitions/@roleTypes.0">
+      <identities description="IDSSN" tokens="//@typeDefinitions/@tokens.0"/>
+    </channelTypes>
+    <channelTypes description="This is the channel type DrivingRecordCallbackChannel" name="DrivingRecordCallbackChannel" behavior="//@typeDefinitions/@roleTypes.2/@behaviors.0" referenceToken="//@typeDefinitions/@tokens.1" roleType="//@typeDefinitions/@roleTypes.2">
+      <identities description="IDSSN&#xA;" tokens="//@typeDefinitions/@tokens.0"/>
+    </channelTypes>
+    <channelTypes description="This is the channel type DrivingRecordChannel" name="DrivingRecordChannel" behavior="//@typeDefinitions/@roleTypes.3/@behaviors.0" referenceToken="//@typeDefinitions/@tokens.1" roleType="//@typeDefinitions/@roleTypes.3">
+      <identities description="IDSSN" tokens="//@typeDefinitions/@tokens.0"/>
+    </channelTypes>
+    <channelTypes description="This is the channel type PolicyQuoteCalculationChannel" name="PolicyQuoteCalculationChannel" behavior="//@typeDefinitions/@roleTypes.4/@behaviors.0" referenceToken="//@typeDefinitions/@tokens.1" roleType="//@typeDefinitions/@roleTypes.4">
+      <identities description="IDSSN" tokens="//@typeDefinitions/@tokens.0"/>
+    </channelTypes>
+    <channelTypes description="This is the channel type PolicyQuoteEntityChannel" name="PolicyQuoteEntityChannel" behavior="//@typeDefinitions/@roleTypes.5/@behaviors.0" referenceToken="//@typeDefinitions/@tokens.1" roleType="//@typeDefinitions/@roleTypes.5">
+      <identities description="IDSSN" tokens="//@typeDefinitions/@tokens.0"/>
+    </channelTypes>
+    <channelTypes description="This is the channel type PolicyQuoteProcessChannel" name="PolicyQuoteProcessChannel" behavior="//@typeDefinitions/@roleTypes.6/@behaviors.0" referenceToken="//@typeDefinitions/@tokens.1" roleType="//@typeDefinitions/@roleTypes.6">
+      <identities description="IDSSN" tokens="//@typeDefinitions/@tokens.0"/>
+    </channelTypes>
+  </typeDefinitions>
+  <choreographies description="Choreography flow for the PolicyQuote process" name="PolicyQuoteProcess" root="true">
+    <variableDefinitions description="Channel to facilitate interaction to CreditScoringService" name="CreditCheckServiceChannel" type="//@typeDefinitions/@channelTypes.0"/>
+    <variableDefinitions name="CreditCheckVar" type="//@typeDefinitions/@informationTypes.0"/>
+    <variableDefinitions description="Channel to facilitate interaction to DrivingRecordCallbackService" name="DrivingRecordCallbackServiceChannel" type="//@typeDefinitions/@channelTypes.1"/>
+    <variableDefinitions description="This is the variable DrivingRecordResponseVar" name="DrivingRecordResponseVar" type="//@typeDefinitions/@informationTypes.3"/>
+    <variableDefinitions description="Channel to facilitate interaction to DrivingRecordService" name="DrivingRecordServiceChannel" type="//@typeDefinitions/@channelTypes.2"/>
+    <variableDefinitions description="This is the variable PolicyQuoteCalculationResponseVar" name="PolicyQuoteCalculationResponseVar" type="//@typeDefinitions/@informationTypes.7"/>
+    <variableDefinitions description="Channel to facilitate interaction to PolicyQuoteCalculationService" name="PolicyQuoteCalculationServiceChannelChannel" type="//@typeDefinitions/@channelTypes.3"/>
+    <variableDefinitions name="PolicyQuoteCalculationVar" type="//@typeDefinitions/@informationTypes.5"/>
+    <variableDefinitions description="Channel to facilitate interaction to PolicyQuoteEntityService" name="PolicyQuoteEntityChannelChannel" type="//@typeDefinitions/@channelTypes.4"/>
+    <variableDefinitions description="This is the variable PolicyQuoteEntityResponseVar" name="PolicyQuoteEntityResponseVar" type="//@typeDefinitions/@informationTypes.7"/>
+    <variableDefinitions name="PolicyQuoteEntityVar" type="//@typeDefinitions/@informationTypes.5"/>
+    <variableDefinitions description="Channel to facilitate interaction to PolicyQuoteService" name="PolicyQuoteProcessServiceChannel" type="//@typeDefinitions/@channelTypes.5"/>
+    <variableDefinitions name="PolicyQuoteRequestVar" type="//@typeDefinitions/@informationTypes.5"/>
+    <variableDefinitions name="PolicyQuoteResponseVar" type="//@typeDefinitions/@informationTypes.7"/>
+    <activities xsi:type="org.pi4soa.cdl:Interaction" name="PolicyQuoteRequest" operation="receivePolicyQuote" channelVariable="//@choreographies.0/@variableDefinitions.11" relationship="//@typeDefinitions/@relationshipTypes.0">
+      <exchangeDetails description="This is the exchange details for the request exchange associated with interaction PolicyQuoteRequest" name="PolicyQuoteRequest" type="//@typeDefinitions/@informationTypes.5" sendVariable="//@choreographies.0/@variableDefinitions.12">
+        <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the destination;string;;{http://www.example.org/policyQuoteProcessService}PolicyQuoteProcessServiceService}}&quot;&#xD;&#xA;&#x9;&#x9;type=&quot;{{Type;The type of destination;enum;endpoint address,service name;service name}}&quot; />&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+      </exchangeDetails>
+    </activities>
+    <activities xsi:type="org.pi4soa.cdl:Interaction" name="DrivingRecordRequest" operation="checkDrivingRecord" channelVariable="//@choreographies.0/@variableDefinitions.4" relationship="//@typeDefinitions/@relationshipTypes.3">
+      <exchangeDetails description="This is the exchange details for the request exchange associated with interaction DrivingRecordRequest" name="DrivingRecordRequest" type="//@typeDefinitions/@informationTypes.2">
+        <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the destination;string;;{http://dmv.com/drivingRecordService}DrivingRecordServiceService}}&quot;&#xD;&#xA;&#x9;&#x9;type=&quot;{{Type;The type of destination;enum;endpoint address,service name;service name}}&quot; />&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+      </exchangeDetails>
+    </activities>
+    <activities xsi:type="org.pi4soa.cdl:Interaction" name="DrivingRecordResponse" operation="receiveDrivingRecord" channelVariable="//@choreographies.0/@variableDefinitions.2" relationship="//@typeDefinitions/@relationshipTypes.1">
+      <exchangeDetails description="This is the exchange details for the request exchange associated with interaction DrivingRecordResponse" name="DrivingRecordResponse" type="//@typeDefinitions/@informationTypes.3" receiveVariable="//@choreographies.0/@variableDefinitions.3">
+        <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the destination;string;;{http://www.example.org/policyQuoteProcessService}PolicyQuoteProcessServiceService}}&quot;&#xD;&#xA;&#x9;&#x9;type=&quot;{{Type;The type of destination;enum;endpoint address,service name;endpoint address}}&quot; />&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+      </exchangeDetails>
+    </activities>
+    <activities xsi:type="org.pi4soa.cdl:Choice" description="NumberOfTickets">
+      <activities xsi:type="org.pi4soa.cdl:Conditional" description="LessThanOrEqualTo4" name="LessThanOrEqualTo4" expression="cdl:getVariable('DrivingRecordResponseVar', ' ' , '//drv:numberOfTickets/text()', 'DrivingRecordCallbackService') &lt;= 4">
+        <activities xsi:type="org.pi4soa.cdl:Sequence">
+          <activities xsi:type="org.pi4soa.cdl:Interaction" name="CreditCheck" operation="checkCredit" channelVariable="//@choreographies.0/@variableDefinitions.0" relationship="//@typeDefinitions/@relationshipTypes.2">
+            <exchangeDetails description="This is the exchange details for the request exchange associated with interaction CreditCheck" name="CreditCheckRequest" type="//@typeDefinitions/@informationTypes.0">
+              <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the destination;string;;{http://creditagency.com/creditCheckService}CreditCheckServiceService}}&quot;&#xD;&#xA;&#x9;&#x9;type=&quot;{{Type;The type of destination;enum;endpoint address,service name;service name}}&quot; />&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+            </exchangeDetails>
+            <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction CreditCheck" name="CreditCheckResponse" type="//@typeDefinitions/@informationTypes.1" action="Respond">
+              <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the destination;string;;{http://creditagency.com/creditCheckService}CreditCheckServiceService}}&quot;&#xD;&#xA;&#x9;&#x9;type=&quot;{{Type;The type of destination;enum;endpoint address,service name;service name}}&quot; />&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+            </exchangeDetails>
+          </activities>
+          <activities xsi:type="org.pi4soa.cdl:Interaction" name="PolicyQuoteCalculation" operation="calculatePolicyQuote" channelVariable="//@choreographies.0/@variableDefinitions.6" relationship="//@typeDefinitions/@relationshipTypes.4">
+            <exchangeDetails description="This is the exchange details for the request exchange associated with interaction PolicyQuoteCalculation" name="PolicyQuoteCalculation" type="//@typeDefinitions/@informationTypes.5" sendVariable="//@choreographies.0/@variableDefinitions.7">
+              <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the destination;string;;jms:queue/PolicyQuoteCalculation_ESB}}&quot;&#xD;&#xA;&#x9;&#x9;type=&quot;{{Type;The type of destination;enum;endpoint address,service name;endpoint address}}&quot; />&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+            </exchangeDetails>
+            <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction PolicyQuoteCalculation" name="PolicyQuoteCalculationReply" type="//@typeDefinitions/@informationTypes.7" action="Respond" receiveVariable="//@choreographies.0/@variableDefinitions.5">
+              <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the destination;string;;jms:queue/PolicyQuoteCalculation_ESB_reply}}&quot;&#xD;&#xA;&#x9;&#x9;type=&quot;{{Type;The type of destination;enum;endpoint address,service name;endpoint address}}&quot; />&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+            </exchangeDetails>
+          </activities>
+          <activities xsi:type="org.pi4soa.cdl:Interaction" name="PolicyQuoteEntity" operation="createPolicyQuote" channelVariable="//@choreographies.0/@variableDefinitions.8" relationship="//@typeDefinitions/@relationshipTypes.5">
+            <exchangeDetails description="This is the exchange details for the request exchange associated with interaction PolicyQuoteEntity" name="PolicyQuoteEntity" type="//@typeDefinitions/@informationTypes.5" sendVariable="//@choreographies.0/@variableDefinitions.10">
+              <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the destination;string;;jms:queue/PolicyQuoteEntity_ESB}}&quot;&#xD;&#xA;&#x9;&#x9;type=&quot;{{Type;The type of destination;enum;endpoint address,service name;endpoint address}}&quot; />&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+            </exchangeDetails>
+            <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction PolicyQuoteEntity" name="PolicyQuoteEntityReply" type="//@typeDefinitions/@informationTypes.7" action="Respond" receiveVariable="//@choreographies.0/@variableDefinitions.9">
+              <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the destination;string;;jms:queue/PolicyQuoteEntity_ESB_reply}}&quot;&#xD;&#xA;&#x9;&#x9;type=&quot;{{Type;The type of destination;enum;endpoint address,service name;endpoint address}}&quot; />&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+            </exchangeDetails>
+          </activities>
+          <activities xsi:type="org.pi4soa.cdl:Interaction" name="PolicyQuoteResponse" operation="receivePolicyQuote" channelVariable="//@choreographies.0/@variableDefinitions.11" relationship="//@typeDefinitions/@relationshipTypes.0">
+            <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction PolicyQuoteResponse" name="PolicyQuoteResponse" type="//@typeDefinitions/@informationTypes.7" action="Respond" sendVariable="//@choreographies.0/@variableDefinitions.13" receiveVariable="//@choreographies.0/@variableDefinitions.13">
+              <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the destination;string;;{http://www.example.org/policyQuoteProcessService}PolicyQuoteProcessServiceService}}&quot;&#xD;&#xA;&#x9;&#x9;type=&quot;{{Type;The type of destination;enum;endpoint address,service name;service name}}&quot; />&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+            </exchangeDetails>
+          </activities>
+        </activities>
+      </activities>
+      <activities xsi:type="org.pi4soa.cdl:Conditional" description="GreaterThan4" name="GreaterThan4" expression="cdl:getVariable('DrivingRecordResponseVar', ' ' , '//drv:numberOfTickets/text()', 'DrivingRecordCallbackService') > 4">
+        <activities xsi:type="org.pi4soa.cdl:Interaction" name="PolicyQuoteInelligible" operation="receivePolicyQuote" channelVariable="//@choreographies.0/@variableDefinitions.11" relationship="//@typeDefinitions/@relationshipTypes.0">
+          <exchangeDetails description="This is the exchange details for the respond exchange associated with interaction PolicyQuoteInelligible" name="PolicyQuoteInelligible" type="//@typeDefinitions/@informationTypes.6" action="Respond" faultName="policyQuoteFault">
+            <semanticAnnotations annotation="&lt;validator>&#xD;&#xA;&#x9;&lt;destination name=&quot;{{Destination;The URI for the destination;string;;{http://www.example.org/policyQuoteProcessService}PolicyQuoteProcessServiceService}}&quot;&#xD;&#xA;&#x9;&#x9;type=&quot;{{Type;The type of destination;enum;endpoint address,service name;service name}}&quot; />&#xD;&#xA;&#x9;&#x9;dynamicReplyTo=&quot;{{Dynamic ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}&quot; />&#xD;&#xA;&lt;/validator>&#xD;&#xA;" name="validator"/>
+          </exchangeDetails>
+        </activities>
+      </activities>
+    </activities>
+  </choreographies>
+</org.pi4soa.cdl:Package>

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-05 16:52:54 UTC (rev 639)
+++ branches/experimental/2.0.x/tools/plugins/org.savara.tools.core/src/java/org/savara/tools/core/osgi/Activator.java	2011-02-07 20:17:44 UTC (rev 640)
@@ -20,6 +20,7 @@
 import org.eclipse.ui.plugin.AbstractUIPlugin;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceReference;
+import org.osgi.util.tracker.ServiceTracker;
 import org.savara.tools.core.ScribbleServices;
 import org.scribble.protocol.parser.ProtocolParserManager;
 import org.scribble.protocol.projection.ProtocolProjector;
@@ -42,6 +43,8 @@
 	// The shared instance
 	private static Activator plugin;
 	
+	private org.osgi.util.tracker.ServiceTracker m_protocolProjectorTracker=null;
+
 	/**
 	 * The constructor
 	 */
@@ -66,9 +69,27 @@
 		// Initialize the protocol projector
 		sref=context.getServiceReference(ProtocolProjector.class.getName());
 		
-		ProtocolProjector pp=(ProtocolProjector)context.getService(sref);
-		
-		ScribbleServices.setProtocolProjector(pp);
+		if (sref != null) {
+			ProtocolProjector pp=(ProtocolProjector)context.getService(sref);
+			ScribbleServices.setProtocolProjector(pp);
+		} else {
+			// Create service tracker
+	        m_protocolProjectorTracker = new ServiceTracker(context,
+	        		ProtocolProjector.class.getName(), null) {
+	        	
+				public Object addingService(ServiceReference ref) {
+					Object ret=super.addingService(ref);
+					
+					logger.fine("Projector being set: "+ret);
+					
+					ScribbleServices.setProtocolProjector((ProtocolProjector)ret);
+					
+					return(ret);
+				}
+	        };
+	        
+	        m_protocolProjectorTracker.open();
+		}
 	}
 	
 	/*



More information about the savara-commits mailing list