That's a tidy solution. Worked a charm. Thanks, Andy -----Original Message----- From: Rahul Akolkar [mailto:rahul.akolkar@gmail.com] Sent: 19 April 2010 22:26 To: Commons Users List Subject: Re: [Commons SCXML] - Parallel states and external invocation. Best practice. On Mon, Apr 19, 2010 at 7:33 AM, Andrew Mansfield wrote: > Hi, > > I am attempting to build a state machine that essentially models my > applications workflow. > > To do this I have built a simple custom component invoker that can be > executed from the tag to execute Java code. The > 'id.invoke.done' event simply transitions to the next state in the > workflow. The flexibility is required as components will be plugged in > for different configurations to change default behaviour often. > > e.g. > > > > target="s2" /> > > > > > > > > > > > > > What I want to do is allow for parallel execution of states which > themselves have the abilty to invoke external code. I.e. > > > > target="s2" /> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > What I can;t seem to work out is how to exit my component invocations > from the substates correctly. Is it event possible to achieve what I > am trying to do or is there a better way to do this ? > Sure, it is possible. When the orthogonal regions have no substructure, any of the transitions such as those gating on events "sub1.invoke.done" or "sub2.invoke.done" cause the entire parallel to be exited. If you want join-like behavior where the parallel waits for both invokes (or more, if more than two regions) to be finished before transitioning out, then its best to model it as such using final children of regions and waiting for all regions to transition to their respective finals. So, reworking the example above, along these lines: ... -Rahul > Any help would be much appreciated. > > Regards, > Andy > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org -------------------------------------------------------------------------- This email with all information contained herein or attached hereto may contain confidential and/or privileged information intended for the addressee(s) only. If you have received this email in error, please contact the sender and immediately delete this email in its entirety and any attachments thereto. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org