On Thursday 21 Jun 2007, Peter Bell wrote:
> On 6/21/07 4:34 AM, "Tom Chiverton" <[EMAIL PROTECTED]> wrote:
> > 'Cause, for more complex workflows, you really need some sort of
> > uber-configurable abstract state manager.
> > :glances around and whistles innocently
>
> Well, if you're looking to build one, I'd be on for playing with a port of
> either Spring Web Flow or maybe even Seaside (you gotta love continuations)
> if you're in the mood to publish something!
Seaside looks over the top, Spring Web Flow's XML looks very similar to our
internal prototype that uses state definiation XML like:
<actions>
<action class="com.halliwells.CFCs.stateManager.actions.logAction"
id="logAction">
<argument name="textString"/>
</action>
<action class="com.halliwells.CFCs.stateManager.actions.emailAction"
id="emailAction">
<argument name="to"/>
<argument name="subject"/>
<argument name="body"/>
</action>
</actions>
<state id="CreationRequest">
<transitions>
<transition name="creationRejected" requireRole="adminUser">
<nextState>RejectedCreation</nextState>
</transition>
<transition name="creationApproved" requireRole="adminUser">
<nextState>awaitingCoverSheet</nextState>
</transition>
</transitions>
</state>
<state id="RejectedCreation">
<transitions>
<transition name="updatedCreation" requireRole="feeUser,otherUser">
<nextState>CreationRequest</nextState>
</transition>
</transitions>
</state>
<state id="awaitingCoverSheet">
<transitions>
<transition name="coverSheetPrinted" requireRole="feeUser,otherUser">
<nextState>awaitingCollectionByArchiving</nextState>
<actions>
<action name="emailAction">
<argument name="subject" value="Newly Created File $(file.id)-
$(file.ShortDesc) needs collecting by archiving"/>
<argument name="to" value="[EMAIL PROTECTED]"/>
<argument name="body" value="Please collect file $(file.id) -
$(file.ShortDesc) from user $(creatingUser.email)"/>
</action>
</actions>
</transition>
</transitions>
</state>
Only SWF uses a lot more introspection and general bean-injection goodness.
However, SWF (confusing acronym that !) seems like it is targeted at managing
UI transitions, bot back-end object states ?
Our current State bean allows calls like getAllowedTransitions(objId):Array
and perform(objId,transitionName):bool - it makes no attempt to define the
GUI, though we sort of hacked that in with an 'updates' tag (child
of 'transition' that lists variables that the GUI needs to pass into the 3rd
optional arg of perform(). We really should have some sort of 'controller'
class (for each?) transition/action. I'm watching your current blog series
closely :-)
--
Tom Chiverton
Helping to confidentially exploit essential systems
on: http://thefalken.livejournal.com
****************************************************
This email is sent for and on behalf of Halliwells LLP.
Halliwells LLP is a limited liability partnership registered in England and
Wales under registered number OC307980 whose registered office address is at St
James's Court Brown Street Manchester M2 2JF. A list of members is available
for inspection at the registered office. Any reference to a partner in relation
to Halliwells LLP means a member of Halliwells LLP. Regulated by the Law
Society.
CONFIDENTIALITY
This email is intended only for the use of the addressee named above and may be
confidential or legally privileged. If you are not the addressee you must not
read it and must not use any information contained in nor copy it nor inform
any person other than Halliwells LLP or the addressee of its existence or
contents. If you have received this email in error please delete it and notify
Halliwells LLP IT Department on 0870 365 8008.
For more information about Halliwells LLP visit www.halliwells.com.