[jboss-jira] [JBoss JIRA] Commented: (BPEL-272) allow xpath expression/query to create more than one occurrence of an element
Felipe (JIRA)
jira-events at lists.jboss.org
Tue Aug 7 05:34:49 EDT 2007
[ http://jira.jboss.com/jira/browse/BPEL-272?page=comments#action_12371292 ]
Felipe commented on BPEL-272:
-----------------------------
WORKAROUND UNTIL THIS IS FIXED:
Following the oracle approach (cf. supra.), a web service can be used to provide an operation that returns an array of the right size. Operations to add items can be done too. Z.B. creating a lista of size four:
ESQUEMA:
<complexType name="ListaString">
<sequence>
<element name="item" type="xsd:string" minOccurs="1" maxOccurs="unbounded"></element>
</sequence>
</complexType>
WSDL:
<wsdl:message name="obtenerListaStringRequest">
<wsdl:part name="obtenerListaStringRequest" type="xsd:int"></wsdl:part>
</wsdl:message>
<wsdl:message name="obtenerListaStringResponse">
<wsdl:part name="obtenerListaStringReturn"
type="tns1:ListaString">
</wsdl:part>
</wsdl:message>
<wsdl:operation name="obtenerListaString">
<wsdl:documentation>Este método fue añadido para corregir las deficiencias del bpel en la creación de secuencias. Cf. http://jira.jboss.com/jira/browse/BPEL-272</wsdl:documentation>
<wsdl:input message="impl:obtenerListaStringRequest" name="listaStringPedir"></wsdl:input>
<wsdl:output message="impl:obtenerListaStringResponse" name="listaStringDevolver"></wsdl:output>
</wsdl:operation>
BPEL:
<variable name="listacadenas" messageType="BAncha:obtenerListaStringResponse" />
<variable name="entero" messageType="BAncha:obtenerListaStringRequest"/>
<assign>
<copy>
<from expression="4"/>
<to variable="entero" part="obtenerListaStringRequest"/>
</copy>
</assign>
<invoke partnerLink="BaPartnerLink" portType="BA:Bara"
operation="obtenerListaString" inputVariable="entero"
outputVariable="listacadenas"/>
Haleeee
> allow xpath expression/query to create more than one occurrence of an element
> -----------------------------------------------------------------------------
>
> Key: BPEL-272
> URL: http://jira.jboss.com/jira/browse/BPEL-272
> Project: JBoss jBPM BPEL
> Issue Type: Feature Request
> Security Level: Public(Everyone can see)
> Components: Engine
> Affects Versions: jBPM BPEL 1.1 beta 3
> Reporter: Alejandro Guizar
> Assigned To: Alejandro Guizar
> Priority: Critical
> Fix For: jBPM BPEL 1.1 GA
>
>
> PROBLEM The current XPath sublanguage implementation automatically creates nodes missing from location paths during assignment. This facility has a number of conceptual limitations. One of them is the inability to append a child element to an existing element if the latter already has a child element with the same name. There is no XPath syntax to express that a new element is required!
> It is tempting to think of a numeric XPath predicate as an array index, leading to the next snippet:
> <copy>
> <from><literal>haha</literal></from>
> <to variable='laughter' xmlns:ex='http://jbpm.org/bpel/examples'>
> <query>ex:laugh[last() + 1]</query>
> </to>
> </copy>
> However, such an interpretation of a predicate is wrong. Consider the following extract from XPath 1.0 specification on predicates:
> "A PredicateExpr is evaluated by evaluating the Expr and converting the result to a boolean. If the result is a number, the result will be converted to true if the number is equal to the context position and will be converted to false otherwise."
> The description of the last() function reads:
> "The last function returns a number equal to the context size from the expression evaluation context."
> Noticed the problem? The context position is never greater than the context size. Therefore the predicate [last() + 1] does not represent the position "one past the context size" but the boolean value false. Unfortunately, no other predicate seems appropriate.
> PROPOSAL Introduce a minor deviation from the XPath 1.0 specification. Interpret the result of a numeric predicate that equals the context size plus one as a request to create a new occurrence of the node.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list