commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jon Brule" <>
Subject [SCXML] Conditional transitions into a composite state
Date Thu, 14 Sep 2006 23:18:48 GMT
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 'return'"/>
           <transition target="RenderReport" cond="_event eq 'return'"/>
         <state id="GetReportData">
           <transition event="report_data_retrieved" target="RenderReport"/>
         <state id="RenderReport">
           <transition event="save_report_changes" target="SaveReportChanges"/>
           <transition event="get_report_data" target="GetReportData"/>
           <transition event="*"
                       cond="reportType eq 'OUTBOUND'"
         <state id="SaveReportChanges">
           <transition event="report_changes_saved" target="GetReportData"/>
       <state id="PerformReportTask_OUTBOUND">
           <transition event="view_employee_requests"
           <transition event="get_error_detail_report" target="GetErrorDetail"/>
         <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