Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
Hello,
I have created a Thingtemplate, having certain numeric properties and I have also configured the Alerts for those properties. I would like to know, if I can get the 'Config' of those alerts, in exactly same way as they are shown in Composer. To make my point more understandable about what 'Config' I am talking about, please refer the attached image.
I want to show that aspect just for informative purpose. I mean even if I can get that data as metadata for any alert or by any other means. Other option is I can generate it myself, but that would require many checks and validations and I wanted to avoid that.
Thanks in Advance
Regards
Aditya Mittal
Solved! Go to Solution.
Hi Zyuan,
Thanks for your reply. Actually I did find a way to get the information I required using the same service you mentioned.
Just for the benefit of others, I would post the sample of on how to get this information using our own custom method. This can be extended to meet other needs, but I hope it would be a good starter for people who might need this. Pseudo logic attached as a file in this reply.
Regards
Aditya
Aditya,
There is not a standard service to retrieve this information in a simple structure. You would need to do a rest call to the platform to get the definition of the Thing (what composer does) and parse the xml or Json for that information. To do this you would use the ContentLoaderFunction resource and do a GetXML call to the localhost.
You can also view this in the browser by calling http://localhost/Thingworx/Things/ThingName?method=get&Accept=application/json
(or text/xml)
In that output there is an aspect named effectiveAlertConfiguration which is where you will find the information in question.
Thanks,
Adam
Thanks Adam for your response, I'll try to have a look through your proposed solution. Meanwhile I was able to get the information I need through the custom service.
Thanks
Aditya
Hi Aditya,
You may need to apply the GetAlertDefinitions service available in Generic service in every entity.
Hi Zyuan,
Thanks for your reply. Actually I did find a way to get the information I required using the same service you mentioned.
Just for the benefit of others, I would post the sample of on how to get this information using our own custom method. This can be extended to meet other needs, but I hope it would be a good starter for people who might need this. Pseudo logic attached as a file in this reply.
Regards
Aditya