commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james_strac...@yahoo.co.uk>
Subject Re: [Workflow] Is this project still active?
Date Wed, 22 May 2002 10:40:36 GMT
Hi Colin

From: "Colin Sharples" <sharples@nz1.ibm.com>
>
> I've been meaning for some time to have a look at integrating workflow and
> messenger, but haven't had much spare time. It's still on my list of
things
> to do, though.

FWIW I've had similar thoughts to Craig that maybe JSTL should be the core
for looping/scripting/XPath/SQL etc in the workflow project. I had a similar
thought for the Messenger project also. The Messagelet Engine can consume
JMS messages and delegate them to a Servlet for processing (by spoofing a
HTTP request) so that right now JSP and JSTL can be used to process JMS
messages.

So I could add this to the subscription.xml in the messagelet engine...

<subscriptions>
    <subscription connection="queue" subject="incoming.order">
        <servlet>/processOrder.jsp</servlet>
    </subscription>
</subscriptions>

Then the processOrder.jsp could contain any  JSP code, including the use of
JSTL and the EL, XPath, XSLT, SQL tags etc.


One of the reasons I started Jelly was to have a lightweight, non-servlet
dependent engine for running JSTL tags and Ant tasks that could also double
up as an XML processing engine for pipelining XML into and out of messages,
SOAP calls, databases, HTTP requests, XSLT etc. To cut a long story short,
I'd like to support Jelly scripts in the Messagelet engine to avoid the HTTP
spoofing thats required in the above example; so I can fire a Jelly script
directly from a JMS MessageListener without going through unnecessary
Servlet plumbing.

I'm fairly close to having this all working; I've been temporarily diverted
lately with using Jelly to do unit testing of JMS / XML / SQL based
applications, but fairly soon we should be able to do things like this...


<subscriptions>
    <subscription connection="queue" subject="incoming.order">
        <jelly>/processOrder.jelly</servlet>
    </subscription>
</subscriptions>

Then the Jelly script for processing a JMS message could be something
like...

<?xml version="1.0"?>
<j:jelly xmlns:j="jelly:core" xmlns:x="jelly:xml" xmlns:sql="jelly:sql">

    <!-- use the EL for looping -->
    <j:if test='${message.getHeader("myHeader") == "foo"}'>

        <!-- lets parse the incoming XML message -->
        <x:parse var="doc">
            <j:out value="${message.text}"/>
        </x:parse>

        <!-- do some XML based processing with the XML tags -->
        <x:forEach select="$doc/foo/bar">
            <x:set var="x" select="number(@something)"/>

            <!-- here's the SQL tags in action -->
            <sql:update>
                insert into foo (x) values (?)
                <sql:param value="${x}"/>
            </sql:update>
        </x:forEach>
    </j:if>

</j:jelly>

James


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message