• 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

    Publisher Queries?

    User help
    2
    2
    460
    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.
    • A
      aosc98
      last edited by

      Hi again.
      Is there an option similar to DataPointQuery.query but for use in publishers? I want to create a script that activates all publishers at the same time.

      Thanks!!

      1 Reply Last reply Reply Quote 0
      • terrypackerT
        terrypacker
        last edited by

        @aosc98 there is not a utility like that. However it would be possible to do the same type of RQL query on the publisher's table but it would require understanding the java backing code and how to access it from the script environment. I don't have the resources to currently supply you with a fully working example but if you are proficient in Java and Javascript this shouldn't be too much of a stretch to look into our public code on GitHub and figure it out. This might jumpstart some thoughts out there, and could work in Mango 3.7.x:

            //Get a reference to Common to be able to 'find' a Spring Bean
            var Common = Java.type('com.serotonin.m2m2.Common'); 
            //Find the publisher dao
            var dao = Common.getBean(Java.type('com.serotonin.m2m2.db.dao.PublisherDao').class);
            var RQLUtils = Java.type('com.infiniteautomation.mango.util.RQLUtils');
            //Parse RQL to ASTNode
            var astNode = RQLUtils.parseRQLtoAST('eq(name,Testing Publisher)');
            //Query using RQL
            dao.rqlQuery(astNode, function(dp, row) {
                console.log(dp.name);
            });
        
        1 Reply Last reply Reply Quote 0
        • First post
          Last post