OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

ebxml-bp message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: RE: [ebxml-bp] TWIST message set Design and BusinessDocument instances (was RE: CAM templates and TWIST documents)


Dale,
 
OK - but I'm not sure that schema can do what you want alone - in fact it looks strongly like it cannot - because you cannot point to just one schema here - its a pick-one-from-many based on context mechanism.
 
Also when you use alternates of: message type / namespace / xpath reference - this is going to get you into interoperability and versioning issues.
 
Clearly TWIST has recognized these limitations of those XML-based parameter mixes too.
 
Whereas introducing BPSS and CAM - it's much simpler to have a parameter $message_type that you can explicitly set from the BPSS at runtime - rather than hardcoding.  And so I agree with your analysis - that the xsi:Type is a nice coupling here - that the CAM template can directly action on.
 
The schema coupling is therefore done inside the CAM template - and those are linked then to the TWIST schemas - so they are there and referenciable - just not at the top level - because at the top level - you cannot insert all the possible permutations that trading partners will use at runtime (TWIST also notes this issue).
 
Notice a few other things - that inside the CAM template - you can also put in explicit parameter setting based on XPath expressions - so you can have a three way detection going on:
 
a) xsi:Type value check
b) messageType value check
c) explicit XPath expression check designed to detect message itself  - (this a pre-process scan)
 
This three way approach would give you confidence then - because if a) and b) are missing - then c) provides a sanity check - but if either a) or b) are provided - c) is skipped.
 
So what I'd offer in your example would be:
 
   <BusinessDocument nameID="TwistID2332" name="RequestPrice">
 
     <ConditionExpression expressionLanguage="XPath1" expression='/Twist/@xsi:type/'>
 
        <Specification nameID="TwistSpecification2006" name="http://www.twiststandards.org/3.1/WholesaleTrade"
 
            location=http://companyA.com/messages/TWIST3.1.WholesaleTrade.TwistMsgPricing.CAM type="CAM" targetNamespace=“http://www.twiststandards.org/3.1/WholesaleTrade“/>
 
    </BusinessDocument>

and the xsi:type then controls what structure validation and version is actioned.  Notice CAM will lookup the value of /Twist/@xsi:type at runtime from the message header actually sent. 
 
If this is missing or invalid - then b) and c) methods will kick in next to determine what is actually being received.
 
DW

"The way to be is to do" - Confucius (551-472 B.C.)


-------- Original Message --------
Subject: [ebxml-bp] TWIST message set Design and BusinessDocument
instances (was RE: CAM templates and TWIST documents)
From: "Dale Moberg" <dmoberg@us.axway.com>
Date: Tue, April 03, 2007 6:52 pm
To: "David RR Webber (XML)" <david@drrw.info>
Cc: <ebxml-bp@lists.oasis-open.org>

[snip omit CAM openers]
 
I think it is fine to have a CAM based way to set up the Specification content in a BusinessDocument, but I would like to also have one using schema, because the TWIST specifications use schema. So I am looking for something like:
 
   <BusinessDocument nameID="TwistID2332" name="RequestPrice">
     <ConditionExpression expressionLanguage="XPath1" expression="/Twist/@xsi:type='RequestPrice'"/>
        <Specification nameID="TwistSpecification2006" name="http://www.twiststandards.org/3.1/WholesaleTrade"
            location="http://unknown.org/unknown/TWIST3.1.WholesaleTrade.TwistMsgPricing.200609.xsd" type="schema" targetNamespace=“http://www.twiststandards.org/3.1/WholesaleTrade“/>
    </BusinessDocument>
 
Now actually the Twist Message Set adheres to a particular design philosophy, and the technical basis is explained (I just discovered) in
 
http://www.twiststandards.org/twiststandards/tiki-download_file.php?fileId=245
 
Twist uses a chameleon design, which is a way of approaching how to deal with namespaces when many schema files are involved. (I found a crisp discussion at  http://www.xfront.com/ZeroOneOrManyNamespaces.html#design )
 
When the topic of determining the purpose of a Twist message is developed, (all messages are in a container element “Twist”), three ways are indicated:
 
For effective communication, the receiver need to be able to readily determine
the nature or purpose of a given message. As part of the TWIST’s
harmonization effort with FpML The TWIST message framework is based on
type substitution as it gives the greatest control over validation while allowing
easy extension of the message elements. TWIST uses three methods to
identify a message’s purpose
Namespace
The receiver can look at the namespace from which the element definitions
have been drawn and determine the message function.
<Twist xmlns="http://www.twiststandards.org/3.0/ElectronicBilling"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<header> messageHeader</header>
Messge Data
</Twist>
Using namespaces it would be possible to create a highly extendable
framework for FpML but it could lead to documents having to have every
FpML element prefixed with a suitable namespace abbreviation although it
may be possible to mitigate this by having the 'core' sub-schemas use no
namespaces in their definition and take on the namespace of the one they are
including into. There may be further issues with related XML standards such
as XPath as the namespace of the same included elements may not be
consistent between documents.
 
messageType Element Value
The receiver can look at the name associated with an optional element
‘messageType’ within the message to determine the function requested.
<Twist xmlns="http://www.twiststandards.org/3.0/Payments"
xmlns:isth="urn:swift:xsd:$pain.001.001.01"
xmlns:isthdd="urn:swift:xsd:$pain.001.001.01.dd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<header>
<messageType>RemittanceAdvice</messageType>
</header>
Message Data
</Twist>
 
Element Type
The receiver can look at the xsi:type attribute associated with the root element within
the message
<Twist xmlns="TWIST3.0.FinancialSupplyChain.TWISTMsgSupplyChain.200606.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type=”Invoice”>
<header>
message header
</header>
Message Data
</Twist>
An XML schema based instance document may use type substitution to
replace the content model of any element with another providing that the
replacement is derived from the original. Given a framework that provides the
appropriate extension points any number of new types can be derived within
the name or different namespaces as necessary. In addition through
inheritance the message types can be associated with an appropriate
message header content model.
 
Now, since the namespace does not seem to me to really identify the message distinctively and since the MessageType element is optional, it seems best to make use of the xsi:type attribute’s value.
 
So I think that the xsi:type value check is probably the best identifier, and this mechanism aligns with CAM option below:
 
4) Alternatively you can make the linkage here dynamic - so either the XPath to a structure item can be checked to test which structure instance is being transacted ( therefore external parameters not needed) - or the CAM template can be directly associated by the XML instance.
 
That so?


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]