commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brule, Jon" <>
Subject RE: [SCXML] Conditional transitions into a composite state
Date Fri, 15 Sep 2006 19:49:33 GMT
OK, so after review the SCXML specification, I see a few errors in the
SCXML I had first sent.

1) An <initial> tag can only contain one condition-less transition. I
had included two transitions, and each contained an invalid condition.

2) I wasn't making good use of final states within the child states
under PerformReportTask_OUTBOUND state in conjunction with the "done"
event in their parent.

With this in mind, I re-factored the SCXML as follows:


-----Original Message-----
From: Jon Brule [] 
Sent: Thursday, September 14, 2006 7:19 PM
Cc: Brule, Jon
Subject: [SCXML] Conditional transitions into a composite state

I have the following SCXML state machine that defines a simple report
engine with the ability to handle report-specific tasks:

     <?xml version="1.0"?>
     <!-- $Id$ -->
     <scxml xmlns=""

       <state id="ReportEngine">
           <transition target="GetReportData" cond="_event ne
           <transition target="RenderReport" cond="_event eq 'return'"/>
         <state id="GetReportData">
           <transition event="report_data_retrieved"
         <state id="RenderReport">
           <transition event="save_report_changes"
           <transition event="get_report_data" target="GetReportData"/>
           <transition event="*"
                       cond="reportType eq 'OUTBOUND'"
         <state id="SaveReportChanges">
           <transition event="report_changes_saved"
       <state id="PerformReportTask_OUTBOUND">
           <transition event="view_employee_requests"
           <transition event="get_error_detail_report"
         <state id="ViewEmployeeRequests" final="true">
         <state id="GetErrorDetail">
           <transition event="error_detail_retrieved"
         <state id="RenderErrorDetail">
           <transition event="return"/>
         <transition event="return" target="RenderReport"/>


My questions are as follows:

1) Given that I am in the RenderReport state within the ReportEngine
state, if I throw the view_employee_requests event with a reportType
of 'OUTBOUND', will the state machine transition directly to the
ViewEmployeeRequests state within the PerformReportTask_OUTBOUND
state? Do I have to specify the PerformReportTask_OUTBOUND initial
transitions using the event attribute or using some sort of condition
like I attempted to represent within the ReportEngine state's initial

2) Is there a way to get the name of the thrown event from within the
_eventdata collection?

3) When I throw the return event from within any child of the
PerformReportTask_OUTBOUND state, will this state machine navigate to
the ReportEngine's Render Report state, as I am hoping?

4) I assume that the return event transition within the
RenderErrorDetail state (within the PerformReportTask_OUTBOUND state)
is redundant due to its parent state having a similar transition
defined. Is this correct?

Thanks for your help!

Jon Brule

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message