Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. SCXML Statemachine donedata event
Forum Updated to NodeBB v4.3 + New Features

SCXML Statemachine donedata event

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 831 Views 1 Watching
  • 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 Offline
    D Offline
    DerHandwerk
    wrote on last edited by
    #1

    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

    kshegunovK 1 Reply Last reply
    0
    • D DerHandwerk

      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

      kshegunovK Offline
      kshegunovK Offline
      kshegunov
      Moderators
      wrote on last edited by
      #2

      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
      1
      • larry104L Offline
        larry104L Offline
        larry104
        wrote on last edited by larry104
        #3

        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
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved