[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Fixing up extensiblity syntax in BPEL by using <annotation> pattern
Hi, all, I would like to discuss the following issue in upcoming BPEL F2F: either as a standalone issue or as a sub-issue Issue 111 or Issue 11. ============================================= Fixing up extensiblity syntax in BPEL by using <annotation> patternIssue Description: Currently, we have a number of places which make uses of <xsd:any> (aka extensibility or xml-data placeholder) in our BPEL language:
Mix and matching all these extension points and xsd:any produces a bunch of syntax and semantic ambiguities. Given our current extension syntax, we find it very difficult to come-up a very clear and easy-to-use syntax grammar. Since not all the people on this email list are XSD experts here, I am going to illustrate those ambiguities by some samples and EBNF:
These ambiguities are definitely undesirable. They are sometimes even illegal or creates misleading syntax. The illegal case is known as: ambiguous grammar problem. As long as we are using context-free grammar (e.g. EBNF) to construct parse tree, it seems to us that we cannot escape this clasical ambiguous grammar problem with our current extension syntax. In the XSD world, this ambigous grammar problem is known as "indeterministic content model", which is illegal in XSD. Submitter's Proposal: Some of us have banged our heads to the table to try to resolve this problem while keeping the same level of BPEL extensibility. Finally, we think we find the solution: to apply a syntax pattern similar to <xsd:annotation> to BPEL. We suggest to have a <annotation> wrapper element to clearly separate the element-based extension to any Extensible BPEL Construct (bpws:tExtensible). After applying <annotation> pattern, the previously ambigous examples would become like the following: <from> <annotation> <foo:extensionToFromSpec /> </annotation> <literal> <bar:literalFromData /> </literal> </from> (We also add <literal> as a separator per Paul Brown's suggestion and that will allow use to use any namespace inside the <literal> element.) <assign> <annotation> <foo:transactionEnabled /> </annotation> <foo:xmlDataOp /> <copy> <from>...</from> <to>...</to> </copy> </assign> Now those ambigous extension entries are nicely seperated. Informal EBNF for assign will become: annotation ::= <annotation> <documentation>* any* <annotation> assign ::= <assign> <annotation>? <targets>? <sources>? ( any | <copy> )+ </assign> This will solve Issue 111 grammar as well. E.g.: <sequence> <annotation> <foo:extensionToSeq /> </annotation> <foo:barExtendedActivity /> <invoke ... /> ... </sequence> Please note that this <bpel:annotation> is VERY similarly to <xsd:annotation> design pattern. Existing XSD users should have no problem in learning this pattern. Details XSD Changes: ----------------------------- <element name="annotation"> <complexType> <sequence> <element ref="bpws:documentation" minOccurs="0" maxOccurs="unbounded" /> <any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/> </sequence> </complexType> </element> <complexType name="tExtensibleElements"> <annotation> <documentation> This type is extended by other component types to allow elements and attributes from other namespaces to be added. </documentation> </annotation> <sequence> <element ref="bpws:annotation" minOccurs="0"/> </sequence> <anyAttribute namespace="##other" processContents="lax"/> </complexType> ----------------------------- ----------------------------- <group name="activity"> ... <choice> <element name="empty" type="bpws:tEmpty"/> <element name="invoke" type="bpws:tInvoke"/> <element name="receive" type="bpws:tReceive"/> <element name="reply" type="bpws:tReply"/> <element name="assign" type="bpws:tAssign"/> <element name="wait" type="bpws:tWait"/> <element name="throw" type="bpws:tThrow"/> <element name="rethrow" type="bpws:tRethrow"/> <element name="exit" type="bpws:tTerminate"/> <element name="flow" type="bpws:tFlow"/> <element name="switch" type="bpws:tSwitch"/> <element name="while" type="bpws:tWhile"/> <element name="sequence" type="bpws:tSequence"/> <element name="pick" type="bpws:tPick"/> <element name="scope" type="bpws:tScope"/> <element name="compensate" type="bpws:tCompensate"/> <!-- this xsd:any is for Issue 111, if we pass it --> <any namespace="##other" processContents="lax" /> </choice> </group> ----------------------------- ----------------------------- <complexType name="tAssign"> <complexContent> <extension base="bpws:tActivity"> <!-- for Issue 11.1 --> <choice maxOccurs="unbounded"> <element name="copy" type="bpws:tCopy" /> <any namespace="##other" processContents="lax" /> </choice> </extension> </complexContent> </complexType> <element name="literal"> <complexType mixed="true"> <sequence> <any processContents="lax" minOccurs="0" maxOccurs="unbounded"/> </sequence> </complexType> </element> ----------------------------- ----------------------------- <!-- pre 103 --> <complexType name="tFrom"> <complexContent> <extension base="bpws:tExtensibleElements"> <sequence> <choice minOccurs="0"> <any namespace="##other" processContents="lax" /> <element ref="bpws:query"/> <element ref="bpws:expression"/> <element ref="bpws:service-ref"/> <element ref="bpws:literal" /> </choice> </sequence> <attribute name="variable" type="NCName"/> <attribute name="part" type="NCName"/> <attribute name="property" type="QName"/> <attribute name="partnerLink" type="NCName"/> <attribute name="endpointReference" type="bpws:tRoles"/> <attribute name="opaque" type="bpws:tBoolean"/> </extension> </complexContent> </complexType> <element name="to"> <complexType> <complexContent> <restriction base="bpws:tFrom"> <sequence> <element ref="bpws:annotation" minOccurs="0"/> <choice minOccurs="0"> <element ref="bpws:query"/> </choice> </sequence> <attribute name="opaque" type="bpws:tBoolean" use="prohibited"/> <attribute name="endpointReference" type="bpws:tRoles" use="prohibited"/> </restriction> </complexContent> </complexType> </element> ----------------------------- ----------------------------- <!-- post 103 --> <complexType name="tFrom" mixed="true"> <sequence> <element ref="bpws:annotation" minOccurs="0"/> <choice minOccurs="0"> <any namespace="##other" processContents="lax" /> <element ref="bpws:literal" /> <element ref="bpws:service-ref"/> </choice> </sequence> <attribute name="expressionLanguage" type="anyURI"/> <attribute name="variable" type="NCName"/> <attribute name="property" type="QName"/> <attribute name="partnerLink" type="NCName"/> <attribute name="endpointReference" type="bpws:tRoles"/> <attribute name="opaque" type="bpws:tBoolean"/> <anyAttribute namespace="##other" processContents="lax"/> </complexType> <element name="to"> <complexType mixed="true"> <sequence> <element ref="bpws:annotation" minOccurs="0"/> <any namespace="##other" processContents="lax" minOccurs="0" /> </sequence> <attribute name="queryLanguage" type="anyURI"/> <attribute name="variable" type="NCName"/> <attribute name="property" type="QName"/> <attribute name="partnerLink" type="NCName"/> <anyAttribute namespace="##other" processContents="lax"/> </complexType> </element> ----------------------------- ============================================= Thanks! Regards, Alex Yiu |
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]