processi

about processes and engines

evenly distributed operations

A while ago, I posted about distributing business processes with OpenWFE.

With OpenWFE 1.7.1, the following ‘code’ will be possible :

<process-definition name="test-distribution" revision="0.97">
    <description>Sending the bulk of the work on the 'shallowBlueEngine'</description>

    <sequence>
        <participant ref="jeff" />
        <set field="__definition__">
            <q>
                <process-definition name="embedded-definition" revision="0">
                    <sequence>
                        <participant ref="webservice-data-gathering" />
                        <participant ref="agent-pdf-generation" />
                    </sequence>
                </process-definition>
            </q>
        </set>
        <participant ref="shallowBlueEngine" />
        <participant ref="joe" />
    </sequence>

</process-definition>

The field ‘__definition__’ is set with some process definition, the workitem is then directly delivered to the engine ‘shallowBlueEngine’ (remember, engines are participants as well in OpenWFE business processes). The engine, configured for looking within that field __definition__, evaluates the code it finds in it.

After ‘shallowBlueEngine’ is done with this on-the-fly definition, the flow gets back to the initial engine (which hands the workitem to participant ‘joe’.

This example may seem a bit static, but if you’re familiar with OpenWFE, you’ll notice that this isn’t about simply launching a subprocess on a remote engine (you already know that OpenWFE does it), but it’s about directly feeding a definition for execution by a remote engine. It’s sending the data (the workitem) and the program (contained as the XML process definition within the field ‘__definition__’) to a remote engine for execution.

One could extend this example for sending specific work to specific engines, or to test for availability before sending to an engine or the other.

You have to tell the engine in which field of the incoming workitem it should look for potential embedded processes, this is done within the file etc/engine/engine-configuration.xml for the service ‘consumer’ :

    <service
        name="consumer"
        class="openwfe.org.engine.listen.EngineWorkItemConsumer"
    >
        <param>
            <param-name>processDefinitionInField</param-name>
            <param-value>__definition__</param-value>
        </param>
    </service>

This technique could prove extremely powerful in a business process network. Engines will be able to share segments of business processes among each other based on ‘skills’ and availability.
Business processes to execute could also be sent (outsourced) outside of the company to the supplier’s engine.

Of course, for security reasons, you might disable that (just comment out or remove the param ‘processDefinitionInField’). I haven’t yet decided if I should let it commented ‘in’ in out-of-the-box OpenWFE releases.

In fact, those workitems with an embedded process definition are just ‘worms’…

Written by John Mettraux

June 14, 2006 at 9:08 pm

%d bloggers like this: