90 likes | 95 Views
This example showcases the use of packageBinding in WS CDL to redefine and complete parts of a package as defined in the current specification, without introducing new elements or attributes.
E N D
The Basic Idea • Keep the existing CDL – essentially unchanged. • No new elements or attributes • Define a new separate element - packageBinding, used to • Redefine selected parts of a package as defined in the current spec, • Complete parts of a package that were "missing" from the original definition, or • Some combination of both
Example Choreo – Section 2.5.2.4 1 <package name="ConsumerRetailerChoreo" version="1.0"> 2 <informationType name="purchaseOrderType" type="pons:PurchaseOrderMsg"/> 3 <informationType name="purchaseOrderAckType" type="pons:PurchaseOrderAckMsg"/> 4 <token name="purchaseOrderID" informationType="tns:intType"/> 5 <token name="retailerRef"/> 6 <tokenLocator tokenName="tns:purchaseOrderID“ informationType="tns:purchaseOrderType" query="/PO/orderId"/> 7 <tokenLocator tokenName="tns:purchaseOrderID“ informationType="tns:purchaseOrderAckType" query="/PO/orderId"/> 8 <role name="Consumer"> 9 <behavior name="consumerForRetailer" interface="cns:ConsumerRetailerPT"/> 10 <behavior name="consumerForWarehouse" interface="cns:ConsumerWarehousePT"/> 11 </role> 12 <role name="Retailer"> 13 <behavior name="retailerForConsumer" interface="rns:RetailerConsumerPT"/> 14 </role> 15 <relationship name="ConsumerRetailerRelationship"> 16 <role type="tns:Consumer" behavior="consumerForRetailer"/> 17 <role type="tns:Retailer" behavior="retailerForConsumer"/> 18 </relationship> 19 <channelType name="ConsumerChannel"> 20 <role type="tns:Consumer"/> 21 <reference> 22 <token type="tns:consumerRef"/> 23 </reference> 24 <identity> 25 <token type="tns:purchaseOrderID"/> 26 </identity> 27 </channelType>28 <channelType name="RetailerChannel"> 29 <passing channel=”ConsumerChannel” action=“request” /> 30 <role type="tns:Retailer" behavior="retailerForConsumer"/> 31 <reference> 32 <token type="tns:retailerRef"/> 33 </reference> 34 <identity> 35 <token type="tns:purchaseOrderID"/> 36 </identity> 37 </channelType>
Example Choreo – Section 2.5.2.4 (cont) 38 <choreography name="ConsumerRetailerChoreo" root="true"> 39 <relationship type="tns:ConsumerRetailerRelationship"/> 40 <variableDefinitions> 41 <variable name="purchaseOrder" informationType="tns:purchaseOrderType" silent-action="true" /> 42 <variable name="purchaseOrderAck" informationType="tns:purchaseOrderAckType" /> 43 <variable name="retailer-channel" channelType="tns:RetailerChannel"/> 44 <variable name="consumer-channel" channelType="tns:ConsumerChannel"/> 45 </variableDefinitions>46 <interaction name="sendOrder" channelVariable="tns:retailer-channel“ operation="handlePurchaseOrder" align="true" initiateChoreography="true"> 47 <participate relationship="tns:ConsumerRetailerRelationship“ fromRole="tns:Consumer" toRole="tns:Retailer"/> 48 <exchange messageContentType="tns:purchaseOrderType" action="request"> 49 <use variable="cdl:getVariable(tns:purchaseOrder, tns:Consumer)"/> 50 <populate variable="cdl:getVariable(tns:purchaseOrder, tns:Retailer)"/> 51 </exchange> 52 <exchange messageContentType="purchaseOrderAckType" action="respond"> 53 <use variable="cdl:getVariable(tns:purchaseOrderAck, tns:Retailer)"/> 54 <populate variable="cdl:getVariable(tns:purchaseOrderAck, tns:Consumer)"/> 55 </exchange> 56 <record role="tns:Retailer" action="request"> 57 <source variable="cdl:getVariable(tns:purchaseOrder, PO/CustomerRef, tns:Retailer)"/> 58 <target variable="cdl:getVariable(tns:consumer-channel, tns:Retailer)"/> 59 </record> 60 </interaction> 61 </choreography> 62 </package>
Referencing the Package <package name="ConsumerRetailerChoreo" version="1.0" ... ... </package> ... <packageBinding name="SampleBinding" ref= "ConsumerRetailerChoreo" version="1.0"> ; Note 1 ... ...</packageBinding> Name of the Package Binding References The name attribute on the packageBinding element references a package (or another packageBinding)
Replacing a value <package name="ConsumerRetailerChoreo" version="1.0" ... <informationType name="purchaseOrderType" type="pons:PurchaseOrderMsg"/> ... </package> ... <PackageBinding name="SampleBinding" ref= "ConsumerRetailerChoreo" version="1.0"> ; Note 1 ... <informationType name="purchaseOrderType" type="ordns:MyPurchaseOrder" /> ; Note 2 ... </PackageBinding> References Replacement value Elements within the packageBinding element (e.g. informationType)specifies either the replacement value for an element (or attribute) within the original package …
Adding in a missing value <package name="ConsumerRetailerChoreo" version="1.0" ... <token name="retailerRef"/> ... </package> ... <PackageBinding name="SampleBinding" ref= "ConsumerRetailerChoreo" version="1.0"> ; Note 1 ... <token name="retailerRef" informationType= "tns:string" /> ; Note 3 ... </PackageBinding> References Missing value … or the value of an element/attribute that was missing from the original definition, e.g. the informationType of the retailerReftoken.
Sample Package Binding 63 <PackageBinding name="SampleBinding" ref= "ConsumerRetailerChoreo" version="1.0"> ; Note 1 64 <informationType name="purchaseOrderType" type="ordns:MyPurchaseOrder" /> ; Note 2 65 <informationType name="purchaseOrderAckType" type="ordns:MyPurchaseOrderAck" /> ; Note 2 66 <token name="purchaseOrderID" informationType= "tns:string" /> ; Note 3 67 <token name="retailerRef" informationType= "tns:string" /> ; Note 3 68 <tokenLocator tokenName="tns:purchaseOrderID" query= "/PO/header/orderId" /> ; Note 4 69 <tokenLocator tokenName="tns:purchaseOrderID" query= "/PO/header/orderId" /> ; Note 4 70 <role name="Consumer"> ; Note 5 71 <behavior name="consumerForRetailer" interface= "cns:ConsumerRetailerPT1" /> ; Note 5 72 <behavior name="consumerForWarehouse" interface= "cns:ConsumerWarehousePT1" /> ; Note 5 73 </role> ; Note 5 74 <interaction name="sendOrder" operation= "acceptOrder" ; Note 6 75 ... ; Note 7 xx </PackageBinding> If we agree with the approach, we need to work out what can get replaced or over-ridden
Different Choreography levels Abstract No endpoint information defined Continuous Portable Some endpoint information defined Concrete All endpoint information fully defined