• Recent
    • Tags
    • Popular
    • Register
    • Login
    1. Home
    2. marganellim
    3. Topics

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website
    M
    • Profile
    • Following 0
    • Followers 1
    • Topics 2
    • Posts 5
    • Best 0
    • Controversial 0
    • Groups 0

    Topics created by marganellim

    • M

      Which Point Called Event Handler?

      Scripting general Discussion
      • • • marganellim
      4
      0
      Votes
      4
      Posts
      1.2k
      Views

      terrypackerT

      @marganellim the script I gave you is for the "script" section of the email event handler. That is the only place the "model" is included in the script context as it is normally used to modify the model that is used to generate the Email via the FTL template but you can do anything you want in that script.

      The script you use will depend on the type of Event Handler you choose. If you want to use a "Script" Event Handler then this would work:

      /** * This script implements com.serotonin.m2m2.rt.event.handlers.EventHandlerInterface * Add this script to a "Script" type event handler and choose the Graal.js or Nashorn engine. */ /** * Called when the Mango event is raised. * You must implement this method. * * @param event */ function eventRaised(event) { console.log('Raised', event); console.log('test xid: ' + event.getContext().get('point').getXid()); } /** * Called when the Mango event is acknowledged (the event may still be active). * Supported as of Mango v4.0.0-beta.14, you are not required to implement this method. * * @param event */ function eventAcknowledged(event) { console.log('Acknowledged', event); } /** * Called when the Mango event returns to normal or is deactivated (e.g. on shutdown). * You must implement this method. * * @param event */ function eventInactive(event) { console.log('Inactive', event); }
    • M

      Writting to JSON store from a Global Script

      How-To
      • json scripting • • marganellim
      6
      0
      Votes
      6
      Posts
      1.5k
      Views

      ThomasEinastoT

      Can you show your whole method instead of the error? Cant really help otherwise. Also version of Mango would also be helpful to know as 4.x has some major changes in scripting env.