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

feature requiest: add console logging to scxml ecmascript models

    XMLWordPrintable

Details

    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;
      }
      

       

      Attachments

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

        Activity

          People

            ulherman Ulf Hermann
            hitoshiito Hitoshi Ito
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes