Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-94885

[SCXML] Event 'done.state.' is not generated with nested parallel states

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.15.0
    • XML: SCXML
    • None
    • All

    Description

      Qt SCXML fails to pass 'done.state' tests for parallel states with nested parallel childs

      1. Test testDoneParallelTwoLevels.scxml

      2. Test testDoneParallelThreeLevels.scxml

      Minimal example

      #include <QCoreApplication>
      
      #include <QScxmlStateMachine>
      #include <QBuffer>
      #include <QLoggingCategory>
      
      namespace Scxml {
          static const char *chScxml =
          "<scxml datamodel=\"ecmascript\" name=\"ScxmlTestDoneThreeLevels\" version=\"1.0\" xmlns=\"http://www.w3.org/2005/07/scxml\">"
          "	<parallel id=\"p1\">"
          "		<onentry>"
          "			<send delay=\"1s\" event=\"timeout\"/>"
          "		</onentry>"
          "		<transition event=\"done.state.p1\" target=\"pass\"/>"
          "		<transition event=\"timeout\" target=\"fail\"/>"
          "		<parallel id=\"p2\">"
          "			<state id=\"s3\">"
          "				<final id=\"f3\"/>"
          "			</state>"
          "			<parallel id=\"p3\">"
          "				<state id=\"s4\">"
          "					<state id=\"s41\">"
          "						<transition target=\"f4\"/>"
          "					</state>"
          "					<final id=\"f4\"/>"
          "				</state>"
          "			</parallel>"
          "		</parallel>"
          "		<state id=\"s2\">"
          "			<final id=\"f2\"/>"
          "		</state>"
          "	</parallel>"
          "	<final id=\"pass\">"
          "		<onentry>"
          "			<log expr=\"'pass'\" label=\"Outcome\"/>"
          "		</onentry>"
          "	</final>"
          "	<final id=\"fail\">"
          "		<onentry>"
          "			<log expr=\"'fail'\" label=\"Outcome\"/>"
          "		</onentry>"
          "	</final>"
          "</scxml>";
      } // end namespace: Scxml
      
      int main(int argc, char *argv[])
      {
          QCoreApplication a(argc, argv);
      
          QBuffer buffer;
          buffer.open(QBuffer::ReadWrite);
          buffer.write(Scxml::chScxml);
          buffer.seek(0);
      
          auto machine = QScxmlStateMachine::fromData(&buffer);
      
          machine->connectToState("fail",[](bool active){
              if (active) {
                  qCritical() << "ERROR: I must not fail here!";
                  QCoreApplication::exit(-1);
              }
          });
      
          machine->start();
      
          return a.exec();
      }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ulherman Ulf Hermann
            alexzhornyak Alex Zhornyak
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes