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="http://www.w3.org/2005/07/SCXML"
version="1.0"
initialstate="ReportEngine">
<state id="ReportEngine">
<initial>
<transition target="GetReportData" cond="_event ne 'return'"/>
<transition target="RenderReport" cond="_event eq 'return'"/>
</initial>
<state id="GetReportData">
<transition event="report_data_retrieved" target="RenderReport"/>
</state>
<state id="RenderReport">
<transition event="save_report_changes" target="SaveReportChanges"/>
<transition event="get_report_data" target="GetReportData"/>
<transition event="*"
cond="reportType eq 'OUTBOUND'"
target="PerformReportTask_OUTBOUND"/>
</state>
<state id="SaveReportChanges">
<transition event="report_changes_saved" target="GetReportData"/>
</state>
</state>
<state id="PerformReportTask_OUTBOUND">
<initial>
<transition event="view_employee_requests"
target="ViewEmployeeRequests"/>
<transition event="get_error_detail_report" target="GetErrorDetail"/>
</initial>
<state id="ViewEmployeeRequests" final="true">
</state>
<state id="GetErrorDetail">
<transition event="error_detail_retrieved"
target="RenderErrorDetail"/>
</state>
<state id="RenderErrorDetail">
<transition event="return"/>
</state>
<transition event="return" target="RenderReport"/>
</state>
</scxml>
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
block?
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
tricolorcat-at-gmail.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]