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=//(a)choreographies.0) ]]
+[[
Namespace(name=http://www.pi4soa.org/PolicyQuote,role=Driver) ]]
+[[
Namespace(name=http://creditagency.com/creditCheckService,role=CreditChec... ]]
+[[
Namespace(name=http://dmv.com/drivingRecordService,role=DrivingRecordServ... ]]
+[[
Namespace(name=http://www.example.org/policyQuoteCalculationService,role=...
]]
+[[
Namespace(name=http://www.example.org/policyQuoteEntityService,role=Polic...
]]
+[[
Namespace(name=http://www.example.org/policyQuoteProcessService,role=Poli...
]]
+[[
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.exam...
]]
+[[
Type(location=schema/drivingRecord.xsd,prefix=drv,namespace=http://dmv.co...
]]
+[[
Type(location=schema/creditCheck.xsd,prefix=cred,namespace=http://credita...
]]
+[[
Type(prefix=pps,namespace=http://www.example.org/policyQuoteProcessService) ]]
+[[
Type(prefix=pcs,namespace=http://www.example.org/policyQuoteCalculationSe... ]]
+[[
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/(a)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/(a)exchangeDetails.0) ]]
+ [[
Interface(name={http://www.pi4soa.org/PolicyQuote}DrivingRecordService) ]]
+ checkDrivingRecord(DrivingRecordRequest) from PolicyQuoteProcessService to
DrivingRecordService;
+ [[ SourceComponent(id=//@choreographies.0/@activities.2/(a)exchangeDetails.0) ]]
+ [[
Interface(name={http://www.pi4soa.org/PolicyQuote}DrivingRecordCallbackSe... ]]
+ receiveDrivingRecord(DrivingRecordResponse) from DrivingRecordService to
PolicyQuoteProcessService;
+ [[ SourceComponent(id=//@choreographies.0/(a)activities.3) ]]
+ choice from PolicyQuoteProcessService to CreditCheckService {
+ [[ Correlation(request=checkCredit) ]]
+ checkCredit(CreditCheckRequest):
+ [[
SourceComponent(id=//@choreographies.0/@activities.3/@activities.0/@activities.0/@activities.0/(a)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/(a)exchangeDetails.0)
]]
+ [[
Interface(name={http://www.pi4soa.org/PolicyQuote}PolicyQuoteCalculationS...
]]
+ [[ Correlation(request=calculatePolicyQuote) ]]
+ calculatePolicyQuote(PolicyQuote) from PolicyQuoteProcessService to
PolicyQuoteCalculationService;
+ [[
SourceComponent(id=//@choreographies.0/@activities.3/@activities.0/@activities.0/@activities.1/(a)exchangeDetails.1)
]]
+ [[
Interface(name={http://www.pi4soa.org/PolicyQuote}PolicyQuoteCalculationS...
]]
+ [[ Correlation(replyTo=calculatePolicyQuote) ]]
+ calculatePolicyQuote(PolicyQuoteReply) from PolicyQuoteCalculationService to
PolicyQuoteProcessService;
+ [[
SourceComponent(id=//@choreographies.0/@activities.3/@activities.0/@activities.0/@activities.2/(a)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/(a)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/(a)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/(a)informationTypes.4"/>
+ <tokens description="This is the token URIToken"
name="URIToken"
informationType="//@typeDefinitions/(a)informationTypes.8"/>
+ <tokenLocators description="This is the token locator
CreditCheckRequestIDLocator" token="//@typeDefinitions/(a)tokens.0"
informationType="//@typeDefinitions/(a)informationTypes.0"
query="//cred:ssn/text()" name="CreditCheckRequestIDLocator"/>
+ <tokenLocators description="This is the token locator
CreditCheckResponseIDLocator" token="//@typeDefinitions/(a)tokens.0"
informationType="//@typeDefinitions/(a)informationTypes.1"
query="//cred:ssn/text()" name="CreditCheckResponseIDLocator"/>
+ <tokenLocators description="This is the token locator
DrivingRecordRequestIDLocator" token="//@typeDefinitions/(a)tokens.0"
informationType="//@typeDefinitions/(a)informationTypes.2"
query="//drv:ssn/text()" name="DrivingRecordRequestIDLocator"/>
+ <tokenLocators description="This is the token locator
DrivingRecordResponseIDLocator" token="//@typeDefinitions/(a)tokens.0"
informationType="//@typeDefinitions/(a)informationTypes.3"
query="//drv:ssn/text()" name="DrivingRecordResponseIDLocator"/>
+ <tokenLocators description="This is the token locator
PolicyQuoteFaultIDLocator" token="//@typeDefinitions/(a)tokens.0"
informationType="//@typeDefinitions/(a)informationTypes.6"
query="//pol:ssn/text()" name="PolicyQuoteFaultIDLocator"/>
+ <tokenLocators description="This is the token locator
PolicyQuoteIDLocator" token="//@typeDefinitions/(a)tokens.0"
informationType="//@typeDefinitions/(a)informationTypes.5"
query="//pol:ssn/text()" name="PolicyQuoteIDLocator"/>
+ <tokenLocators description="This is the token locator
PolicyQuoteReplyIDLocator" token="//@typeDefinitions/(a)tokens.0"
informationType="//@typeDefinitions/(a)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/(a)roleTypes.1"
secondRoleType="//@typeDefinitions/(a)roleTypes.6"/>
+ <relationshipTypes description="Relationship between DrivingRecordService and
DrivingRecordCallbackService" name="DrivingRecordDrivingRecordCallback"
firstRoleType="//@typeDefinitions/(a)roleTypes.3"
secondRoleType="//@typeDefinitions/(a)roleTypes.2"/>
+ <relationshipTypes description="Relationship between InsuranceAgency and
CreditAgency" name="PolicyQuoteCreditCheck"
firstRoleType="//@typeDefinitions/(a)roleTypes.6"
secondRoleType="//@typeDefinitions/(a)roleTypes.0"/>
+ <relationshipTypes description="Relationship between InsuranceAgency and
DMV" name="PolicyQuoteDrivingRecord"
firstRoleType="//@typeDefinitions/(a)roleTypes.6"
secondRoleType="//@typeDefinitions/(a)roleTypes.3"/>
+ <relationshipTypes description="Relationship between PolicyQuoteService and
calculatePolicyQuote" name="PolicyQuotePolicyQuoteCalculation"
firstRoleType="//@typeDefinitions/(a)roleTypes.6"
secondRoleType="//@typeDefinitions/(a)roleTypes.4"/>
+ <relationshipTypes description="Relationship between PolicyQuoteService and
PolicyQuoteEntityService" name="PolicyQuotePolicyQuoteEntity"
firstRoleType="//@typeDefinitions/(a)roleTypes.6"
secondRoleType="//@typeDefinitions/(a)roleTypes.5"/>
+ <participantTypes description="This is the participant type Driver"
name="Driver" roleTypes="//@typeDefinitions/(a)roleTypes.1"/>
+ <participantTypes description="This is the participant type
ca:CreditCheckService" name="ca:CreditCheckService"
roleTypes="//@typeDefinitions/(a)roleTypes.0"/>
+ <participantTypes description="This is the participant type
dmv:DrivingRecordService" name="dmv:DrivingRecordService"
roleTypes="//@typeDefinitions/(a)roleTypes.3"/>
+ <participantTypes description="This is the participant type
pcs:PolicyQuoteCalculationService" name="pcs:PolicyQuoteCalculationService"
roleTypes="//@typeDefinitions/(a)roleTypes.4"/>
+ <participantTypes description="This is the participant type
pes:PolicyQuoteEntityService" name="pes:PolicyQuoteEntityService"
roleTypes="//@typeDefinitions/(a)roleTypes.5"/>
+ <participantTypes description="This is the participant type
pps:PolicyQuoteProcessService" name="pps:PolicyQuoteProcessService"
roleTypes="//@typeDefinitions/(a)roleTypes.2
//@typeDefinitions/(a)roleTypes.6"/>
+ <channelTypes description="This is the channel type CreditCheckChannel"
name="CreditCheckChannel"
behavior="//@typeDefinitions/@roleTypes.0/(a)behaviors.0"
referenceToken="//@typeDefinitions/(a)tokens.1"
roleType="//@typeDefinitions/(a)roleTypes.0">
+ <identities description="IDSSN"
tokens="//@typeDefinitions/(a)tokens.0"/>
+ </channelTypes>
+ <channelTypes description="This is the channel type
DrivingRecordCallbackChannel" name="DrivingRecordCallbackChannel"
behavior="//@typeDefinitions/@roleTypes.2/(a)behaviors.0"
referenceToken="//@typeDefinitions/(a)tokens.1"
roleType="//@typeDefinitions/(a)roleTypes.2">
+ <identities description="IDSSN
"
tokens="//@typeDefinitions/(a)tokens.0"/>
+ </channelTypes>
+ <channelTypes description="This is the channel type
DrivingRecordChannel" name="DrivingRecordChannel"
behavior="//@typeDefinitions/@roleTypes.3/(a)behaviors.0"
referenceToken="//@typeDefinitions/(a)tokens.1"
roleType="//@typeDefinitions/(a)roleTypes.3">
+ <identities description="IDSSN"
tokens="//@typeDefinitions/(a)tokens.0"/>
+ </channelTypes>
+ <channelTypes description="This is the channel type
PolicyQuoteCalculationChannel" name="PolicyQuoteCalculationChannel"
behavior="//@typeDefinitions/@roleTypes.4/(a)behaviors.0"
referenceToken="//@typeDefinitions/(a)tokens.1"
roleType="//@typeDefinitions/(a)roleTypes.4">
+ <identities description="IDSSN"
tokens="//@typeDefinitions/(a)tokens.0"/>
+ </channelTypes>
+ <channelTypes description="This is the channel type
PolicyQuoteEntityChannel" name="PolicyQuoteEntityChannel"
behavior="//@typeDefinitions/@roleTypes.5/(a)behaviors.0"
referenceToken="//@typeDefinitions/(a)tokens.1"
roleType="//@typeDefinitions/(a)roleTypes.5">
+ <identities description="IDSSN"
tokens="//@typeDefinitions/(a)tokens.0"/>
+ </channelTypes>
+ <channelTypes description="This is the channel type
PolicyQuoteProcessChannel" name="PolicyQuoteProcessChannel"
behavior="//@typeDefinitions/@roleTypes.6/(a)behaviors.0"
referenceToken="//@typeDefinitions/(a)tokens.1"
roleType="//@typeDefinitions/(a)roleTypes.6">
+ <identities description="IDSSN"
tokens="//@typeDefinitions/(a)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/(a)channelTypes.0"/>
+ <variableDefinitions name="CreditCheckVar"
type="//@typeDefinitions/(a)informationTypes.0"/>
+ <variableDefinitions description="Channel to facilitate interaction to
DrivingRecordCallbackService" name="DrivingRecordCallbackServiceChannel"
type="//@typeDefinitions/(a)channelTypes.1"/>
+ <variableDefinitions description="This is the variable
DrivingRecordResponseVar" name="DrivingRecordResponseVar"
type="//@typeDefinitions/(a)informationTypes.3"/>
+ <variableDefinitions description="Channel to facilitate interaction to
DrivingRecordService" name="DrivingRecordServiceChannel"
type="//@typeDefinitions/(a)channelTypes.2"/>
+ <variableDefinitions description="This is the variable
PolicyQuoteCalculationResponseVar" name="PolicyQuoteCalculationResponseVar"
type="//@typeDefinitions/(a)informationTypes.7"/>
+ <variableDefinitions description="Channel to facilitate interaction to
PolicyQuoteCalculationService"
name="PolicyQuoteCalculationServiceChannelChannel"
type="//@typeDefinitions/(a)channelTypes.3"/>
+ <variableDefinitions name="PolicyQuoteCalculationVar"
type="//@typeDefinitions/(a)informationTypes.5"/>
+ <variableDefinitions description="Channel to facilitate interaction to
PolicyQuoteEntityService" name="PolicyQuoteEntityChannelChannel"
type="//@typeDefinitions/(a)channelTypes.4"/>
+ <variableDefinitions description="This is the variable
PolicyQuoteEntityResponseVar" name="PolicyQuoteEntityResponseVar"
type="//@typeDefinitions/(a)informationTypes.7"/>
+ <variableDefinitions name="PolicyQuoteEntityVar"
type="//@typeDefinitions/(a)informationTypes.5"/>
+ <variableDefinitions description="Channel to facilitate interaction to
PolicyQuoteService" name="PolicyQuoteProcessServiceChannel"
type="//@typeDefinitions/(a)channelTypes.5"/>
+ <variableDefinitions name="PolicyQuoteRequestVar"
type="//@typeDefinitions/(a)informationTypes.5"/>
+ <variableDefinitions name="PolicyQuoteResponseVar"
type="//@typeDefinitions/(a)informationTypes.7"/>
+ <activities xsi:type="org.pi4soa.cdl:Interaction"
name="PolicyQuoteRequest" operation="receivePolicyQuote"
channelVariable="//@choreographies.0/(a)variableDefinitions.11"
relationship="//@typeDefinitions/(a)relationshipTypes.0">
+ <exchangeDetails description="This is the exchange details for the request
exchange associated with interaction PolicyQuoteRequest"
name="PolicyQuoteRequest"
type="//@typeDefinitions/(a)informationTypes.5"
sendVariable="//@choreographies.0/(a)variableDefinitions.12">
+ <semanticAnnotations
annotation="<validator>
	<destination
name="{{Destination;The URI for the
destination;string;;{http://www.example.org/policyQuoteProcessService}Pol...
type of destination;enum;endpoint address,service name;service name}}"
/>
		dynamicReplyTo="{{Dynamic
ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}"
/>
</validator>
"
name="validator"/>
+ </exchangeDetails>
+ </activities>
+ <activities xsi:type="org.pi4soa.cdl:Interaction"
name="DrivingRecordRequest" operation="checkDrivingRecord"
channelVariable="//@choreographies.0/(a)variableDefinitions.4"
relationship="//@typeDefinitions/(a)relationshipTypes.3">
+ <exchangeDetails description="This is the exchange details for the request
exchange associated with interaction DrivingRecordRequest"
name="DrivingRecordRequest"
type="//@typeDefinitions/(a)informationTypes.2">
+ <semanticAnnotations
annotation="<validator>
	<destination
name="{{Destination;The URI for the
destination;string;;{http://dmv.com/drivingRecordService}DrivingRecordSer...
type of destination;enum;endpoint address,service name;service name}}"
/>
		dynamicReplyTo="{{Dynamic
ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}"
/>
</validator>
"
name="validator"/>
+ </exchangeDetails>
+ </activities>
+ <activities xsi:type="org.pi4soa.cdl:Interaction"
name="DrivingRecordResponse" operation="receiveDrivingRecord"
channelVariable="//@choreographies.0/(a)variableDefinitions.2"
relationship="//@typeDefinitions/(a)relationshipTypes.1">
+ <exchangeDetails description="This is the exchange details for the request
exchange associated with interaction DrivingRecordResponse"
name="DrivingRecordResponse"
type="//@typeDefinitions/(a)informationTypes.3"
receiveVariable="//@choreographies.0/(a)variableDefinitions.3">
+ <semanticAnnotations
annotation="<validator>
	<destination
name="{{Destination;The URI for the
destination;string;;{http://www.example.org/policyQuoteProcessService}Pol...
type of destination;enum;endpoint address,service name;endpoint address}}"
/>
		dynamicReplyTo="{{Dynamic
ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}"
/>
</validator>
"
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') <=
4">
+ <activities xsi:type="org.pi4soa.cdl:Sequence">
+ <activities xsi:type="org.pi4soa.cdl:Interaction"
name="CreditCheck" operation="checkCredit"
channelVariable="//@choreographies.0/(a)variableDefinitions.0"
relationship="//@typeDefinitions/(a)relationshipTypes.2">
+ <exchangeDetails description="This is the exchange details for the
request exchange associated with interaction CreditCheck"
name="CreditCheckRequest"
type="//@typeDefinitions/(a)informationTypes.0">
+ <semanticAnnotations
annotation="<validator>
	<destination
name="{{Destination;The URI for the
destination;string;;{http://creditagency.com/creditCheckService}CreditChe...
type of destination;enum;endpoint address,service name;service name}}"
/>
		dynamicReplyTo="{{Dynamic
ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}"
/>
</validator>
"
name="validator"/>
+ </exchangeDetails>
+ <exchangeDetails description="This is the exchange details for the
respond exchange associated with interaction CreditCheck"
name="CreditCheckResponse"
type="//@typeDefinitions/(a)informationTypes.1" action="Respond">
+ <semanticAnnotations
annotation="<validator>
	<destination
name="{{Destination;The URI for the
destination;string;;{http://creditagency.com/creditCheckService}CreditChe...
type of destination;enum;endpoint address,service name;service name}}"
/>
		dynamicReplyTo="{{Dynamic
ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}"
/>
</validator>
"
name="validator"/>
+ </exchangeDetails>
+ </activities>
+ <activities xsi:type="org.pi4soa.cdl:Interaction"
name="PolicyQuoteCalculation" operation="calculatePolicyQuote"
channelVariable="//@choreographies.0/(a)variableDefinitions.6"
relationship="//@typeDefinitions/(a)relationshipTypes.4">
+ <exchangeDetails description="This is the exchange details for the
request exchange associated with interaction PolicyQuoteCalculation"
name="PolicyQuoteCalculation"
type="//@typeDefinitions/(a)informationTypes.5"
sendVariable="//@choreographies.0/(a)variableDefinitions.7">
+ <semanticAnnotations
annotation="<validator>
	<destination
name="{{Destination;The URI for the
destination;string;;jms:queue/PolicyQuoteCalculation_ESB}}"
		type="{{Type;The
type of destination;enum;endpoint address,service name;endpoint address}}"
/>
		dynamicReplyTo="{{Dynamic
ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}"
/>
</validator>
"
name="validator"/>
+ </exchangeDetails>
+ <exchangeDetails description="This is the exchange details for the
respond exchange associated with interaction PolicyQuoteCalculation"
name="PolicyQuoteCalculationReply"
type="//@typeDefinitions/(a)informationTypes.7" action="Respond"
receiveVariable="//@choreographies.0/(a)variableDefinitions.5">
+ <semanticAnnotations
annotation="<validator>
	<destination
name="{{Destination;The URI for the
destination;string;;jms:queue/PolicyQuoteCalculation_ESB_reply}}"
		type="{{Type;The
type of destination;enum;endpoint address,service name;endpoint address}}"
/>
		dynamicReplyTo="{{Dynamic
ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}"
/>
</validator>
"
name="validator"/>
+ </exchangeDetails>
+ </activities>
+ <activities xsi:type="org.pi4soa.cdl:Interaction"
name="PolicyQuoteEntity" operation="createPolicyQuote"
channelVariable="//@choreographies.0/(a)variableDefinitions.8"
relationship="//@typeDefinitions/(a)relationshipTypes.5">
+ <exchangeDetails description="This is the exchange details for the
request exchange associated with interaction PolicyQuoteEntity"
name="PolicyQuoteEntity" type="//@typeDefinitions/(a)informationTypes.5"
sendVariable="//@choreographies.0/(a)variableDefinitions.10">
+ <semanticAnnotations
annotation="<validator>
	<destination
name="{{Destination;The URI for the
destination;string;;jms:queue/PolicyQuoteEntity_ESB}}"
		type="{{Type;The
type of destination;enum;endpoint address,service name;endpoint address}}"
/>
		dynamicReplyTo="{{Dynamic
ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}"
/>
</validator>
"
name="validator"/>
+ </exchangeDetails>
+ <exchangeDetails description="This is the exchange details for the
respond exchange associated with interaction PolicyQuoteEntity"
name="PolicyQuoteEntityReply"
type="//@typeDefinitions/(a)informationTypes.7" action="Respond"
receiveVariable="//@choreographies.0/(a)variableDefinitions.9">
+ <semanticAnnotations
annotation="<validator>
	<destination
name="{{Destination;The URI for the
destination;string;;jms:queue/PolicyQuoteEntity_ESB_reply}}"
		type="{{Type;The
type of destination;enum;endpoint address,service name;endpoint address}}"
/>
		dynamicReplyTo="{{Dynamic
ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}"
/>
</validator>
"
name="validator"/>
+ </exchangeDetails>
+ </activities>
+ <activities xsi:type="org.pi4soa.cdl:Interaction"
name="PolicyQuoteResponse" operation="receivePolicyQuote"
channelVariable="//@choreographies.0/(a)variableDefinitions.11"
relationship="//@typeDefinitions/(a)relationshipTypes.0">
+ <exchangeDetails description="This is the exchange details for the
respond exchange associated with interaction PolicyQuoteResponse"
name="PolicyQuoteResponse"
type="//@typeDefinitions/(a)informationTypes.7" action="Respond"
sendVariable="//@choreographies.0/(a)variableDefinitions.13"
receiveVariable="//@choreographies.0/(a)variableDefinitions.13">
+ <semanticAnnotations
annotation="<validator>
	<destination
name="{{Destination;The URI for the
destination;string;;{http://www.example.org/policyQuoteProcessService}Pol...
type of destination;enum;endpoint address,service name;service name}}"
/>
		dynamicReplyTo="{{Dynamic
ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}"
/>
</validator>
"
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/(a)variableDefinitions.11"
relationship="//@typeDefinitions/(a)relationshipTypes.0">
+ <exchangeDetails description="This is the exchange details for the
respond exchange associated with interaction PolicyQuoteInelligible"
name="PolicyQuoteInelligible"
type="//@typeDefinitions/(a)informationTypes.6" action="Respond"
faultName="policyQuoteFault">
+ <semanticAnnotations
annotation="<validator>
	<destination
name="{{Destination;The URI for the
destination;string;;{http://www.example.org/policyQuoteProcessService}Pol...
type of destination;enum;endpoint address,service name;service name}}"
/>
		dynamicReplyTo="{{Dynamic
ReplyTo;Whether the replyTo destination is dynamic;boolean;;false}}"
/>
</validator>
"
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();
+ }
}
/*