Details
-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.8.3
Description
This report is to suggest a patch provided by a commercial user.
The patch was made to add features below to SCXML ECMAScript data model.
1. dispatching of events taking targets into account (routing)
- without this, events are posted to the main statemachine but location dispatches it to the appropriate invoked machine
2. forwarding log to the main state machine
- without it log statements in invoked machines do not work
3. error messages in invoked machines with property source file (patch I received from support)
- without it state machines crash or fail without any information (like invalid properties or syntax errors in javascript code)
- also do not forget the adding of the console.log as it allows better debugging.
For specific implementation, please look into the patch attached.
Here is an additional comment from the user:
this patch entry is probably not necessary
file : qtscxml/qtscxml/src/scxml/qscxmlexecutablecontent.cpp
*************** *** 450,457 **** QString eventName = QStringLiteral("done.state.") + extraData.toString(); QScxmlEventBuilder event(stateMachine, eventName, doneData); auto e = event(); ! e->setEventType(QScxmlEvent::InternalEvent); ! qCDebug(qscxmlLog) << stateMachine << "submitting event" << eventName; stateMachine->submitEvent(e); return ip; } --- 451,458 ---- QString eventName = QStringLiteral("done.state.") + extraData.toString(); QScxmlEventBuilder event(stateMachine, eventName, doneData); auto e = event(); ! e->setEventType( stateMachine->isInvoked() ? QScxmlEvent::InternalEvent : QScxmlEvent::ExternalEvent); ! qCDebug(qscxmlLog) << stateMachine << "submitting event" << eventName << stateMachine->isInvoked(); stateMachine->submitEvent(e); return ip; }