---------- Forwarded message ----------
From: Balazs E. Pataki <[EMAIL PROTECTED]>
Date: Jun 29, 2006 10:52 AM
Subject: Re: Attribute coders question
To: [EMAIL PROTECTED]


Hi,

For the concatenation question I think I found a solution (see below),
although there might be a more elegant way to do it. I also noticed that
the $ evaluation works very nice and can be nested very well like in
"${v:${v:ix_name}}", which is equivalent with "${v:ix}" in my example,
but anyway, it is cool that I can do it. Thanks for this! :-)

   <sequence>

     <set field="votes">
       <a>
         <raw-xml>
           <votes>
             <vote>
               <user id="111">John Smith</user>
               <selection>3</selection>
             </vote>
             <vote>
               <user id="222">Dick Foo</user>
               <selection>1</selection>
             </vote>
             <vote>
               <user id="3333">Criss Cross</user>
               <selection>2</selection>
             </vote>
           </votes>
         </raw-xml>
       </a>
     </set>

     <!-- Concatenate name elements
       ** Loop with the number of vote elements and concat the
       ** ${f:votes.e${v:ix}.user.} values and store in the "concat" field.
       -->
     <set variable="size">
       <size><f>votes</f></size>
         </set>
     <set variable="ix" value="0" />
     <!-- Extra, unnecessary hacking. -->
     <set variable="ix_name" value="ix" />

     <loop>
       <if>
         <greater-than variable-value="size" other-value="${v:ix}" />
         <sequence>
           <!-- Simple ${v:ix} access
           <set field="concat" value="${f:concat}
${f:votes.e${v:ix}.user.}" />
           -->
           <!-- ${v:ix} access with an extra reference -->
              <set field="concat" value="${f:concat}
${f:votes.e${v:${v:ix_name}}.user.}" />
           <inc variable="ix" value="1" />
           <set field="__cursor_command__" value="continue" />
         </sequence>
         <set field="__cursor_command__" value="break" />
       </if>
     </loop>
     <participant ref="dcm-step-xeme-result" />
   </sequence>

Regards,
---
balazs

Balazs E. Pataki wrote:
> Hi John,
>
> Sorry for bothering you via email, but SourcForge logins are disabled
> today and I couldn't post my question to the support forum.
>
> I'm learning OWFE these days (I now understand how the REST interface
> works :-), and I found a feature I couldn't find documentation or
> support forum references for.
>
> I try to understand Xeme expression and how to work with workitem payloads:
>
>    http://www.openwfe.org/docbook/build/ch06s06.html
>
> As far a I figured out I can work with straight XML or special XML based
> structures like <smap> ... and <list>... My problem is that I couldn't
> find explanation how these actually work, what are their syntax,
> semantics, etc. I only found "smap" "raw-xml" mentioned in
> coder-configuration.xml.
>
> The other related problem I have is how to work with these structures
> ones stored in a workitem field or variable. I understand the basics
> (the Xeme expression), but have problems with the "dollar notation"
>
>     http://www.openwfe.org/docbook/build/ch06s10.html
>
> In the "using fields with the dollar notation" section there's an
> example for acessing XML elements and attributes. Where can I find a
> desccription of the supported syntax? Or only the operators in the
> example (".", "eX", "@attrib") exist? Is there, for example, a syntax to
> select more than one element with this dotted $ syntax? For example, if
> I have <name> elements and I want to concatenate all the names. If
> there's nwo such $ notation to help select all names, I guess there's a
> xeme way I can handle it.
>
> I would appreciate any hints!
>
> Best regards,
> ---
> balazs
>


-- 
John Mettraux   -///-   http://jmettraux.openwfe.org

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
OpenWFE - Open source WorkFlow Engine
OpenWFE-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openwfe-users

Reply via email to