Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved SCXML Statemachine donedata event

    General and Desktop
    3
    3
    651
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      DerHandwerk last edited by

      Hallo,

      I am exprimenting with the new QScxmlStateMachine. Currently I am running a state machine with JavaScript data model and I am wondering how to catch the donedata event.

      For example my statemachine defines the following final state:

      <final id="finished">
          <donedata>
              <param name="DoneValue" expr="1" />
          </donedata>
      </final>
      

      According to the SCXML spec (section 3.7.2)

      When the state machine enters the <final> child of a <state> element, the SCXML Processor must generate the event done.state.id after completion of the <onentry> elements, where id is the id of the parent state.

      an event should be send when the final state is reached. My question now is, how can I catch the event on C++/QML side. I have alread tried a generice event handler like as shown below but now done event occurred.

      Connections {
          target: stateMachine
          onEventOccurred: {
              console.log(event.name)
          }
      }
      

      May someone could give me a hint.

      Many thanks in advance!

      Wolf Bublitz

      kshegunov 1 Reply Last reply Reply Quote 0
      • kshegunov
        kshegunov Moderators @DerHandwerk last edited by

        Hi,
        This is a user forum and it's somewhat unlikely you'd get a good answer here, because your question relates to a technical preview module.
        I suggest you ask on the mailing list where you might find the actual developers of the module.

        Kind regards.

        Read and abide by the Qt Code of Conduct

        1 Reply Last reply Reply Quote 1
        • larry104
          larry104 last edited by larry104

          Why don't you just send a signal

          <final id="finished">
              <onentry>
                 <send type="qt:signal" event="done"/>
             </onentry>
          </final>
          

          don't forget to turn on the qt mode to receive signals on the c++ side

          <?xml version="1.0" encoding="UTF-8"?>
          <!-- enable-qt-mode: yes -->
          <scxml ....
          
          1 Reply Last reply Reply Quote 0
          • First post
            Last post