• Recent
    • Tags
    • Popular
    • Register
    • Login

    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

    Event handler not saving script

    Scheduled Pinned Locked Moved Mango feedback
    3 Posts 2 Posters 1.1k Views 2 Watching
    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.
    • MattFoxM Offline
      MattFox
      last edited by MattFox

      Hi Folks,

      Am trying to set values based upon status of active flag from the advanced scheduler. However despite saving, the script written is not saved and is gone upon revisiting the page either by refresh or navigation.
      All I want to do is set a binary point every time the advanced scheduler fires (preferably without emailing...) .
      Happy to take any advice but I cannot progress further if the script will not save...

      //val is chosen datapoint to update
      var resp;
      HttpBuilder.get("http://oursite.com:80/rest/v2/schedules", {'Authorization':'Bearer TOKENHERE'}, {'xid':'TEST_SCHEDULE'})
      	.err(function(status, headers, content) { //setErrorCallback for linguistic completion
      		throw "Request got bad response: " + status;
      	}).resp(function(status, headers, content) { //setResponseCallback
      		resp=JSON.parse(content);
      		print(JSON.stringify(resp.items[0].rtData));
      		var pt = resp.items[0].rtData.active===false?0:1;
      		print(pt);
      val.set(pt);
      		return true;
      	}).excp(function(exception) { //setExceptionCallback
      		throw exception.getMessage();
      	}).execute(); //will print the help page then "true" if the resp function is executed. Otherwise will throw the error.
      

      Am using mango 3.4.1

      Do not follow where the path may lead; go instead where there is no path.
      And leave a trail - Muriel Strode

      1 Reply Last reply Reply Quote 0
      • Jared WiltshireJ Offline
        Jared Wiltshire
        last edited by

        You should be creating an event handler for the scheduler event, you can use a "Set point value" handler to set a binary point value or use a script event handler.

        Developer at Radix IoT

        1 Reply Last reply Reply Quote 0
        • MattFoxM Offline
          MattFox
          last edited by

          Well I certainly have this configured under the Scheduler Events tree in Event types under the Event Handlers page.
          Oh I see! man after all this time.... and I never even once noticed the type was a drop down.
          Need more coffee...
          And a holiday I think..

          Thanks Jared!

          Do not follow where the path may lead; go instead where there is no path.
          And leave a trail - Muriel Strode

          1 Reply Last reply Reply Quote 0
          • First post
            Last post