Skip to main content
1-Visitor
January 30, 2020
Question

how can i set up alerts threshold from a mashup ?

  • January 30, 2020
  • 2 replies
  • 2320 views

hi community ,

how can i access to alertName from a service called in mashup ?

- I made a service that update alert threshold for all things of a template.

- I want to modify threshold from mashup (see picture) using textfield widget and call the first service when I click on a button (validate).

please help , and thank you in advance.

 

 

 

2 replies

17-Peridot
January 30, 2020

Hi,

 

You can use AddOrUpdateAlerts() service available at the level of the Thing or Thing Template.

Please take a look here: https://www.ptc.com/pt/support/article?n=CS299728

Your service should have as input the range values you want to update and the output - nothing.

 

To get the name of the alerts for a specific property you can use GetAlertDefinitions() at the Thing level.

 

Hope it helps,

Raluca Edu

1-Visitor
January 30, 2020

First of all, thank you for your response.

 

I created 3 services that us AddOrUpdateAlerts() : below _ above _in range. i think I should put all those services on  a subscription if i want to use the button to trigger those services ?

 

also i have a problem with thresholds precisely at the point of calling service for in range   : 

for example : alert1 : measure <10 ===> call service for below alert

                      alert2: 10<=measure <20 ===> call service for in range alert

                      alert3: 80<=measure <100 ===> call service for in range alert

                     alert4: measure >100 ===> call service for above alert

so how can i call a service two time from mashup.

17-Peridot
January 30, 2020

Hi,

 

Subscriptions are used to be executed when a specific event is happening (Alert, DataChange), so if this is corresponding to what you want to accomplish then it is ok to use it.

Otherwise, think what you want to trigger the service: a click on a button, selected rows changed, all data changed etc.

To execute a service more than once in mashup, you need to change the bindings, so one idea is to get once again the service in the Data panel and create once again the bindings.

 

I would work with one service for every alert, but I don't know exactly what you need to do or if this fits to your case.

 

Hope it helps,

Raluca Edu 

 

 

Support
February 21, 2020

Hi @anassNasser.

 

If one of the previous responses allowed you to find a solution, please mark the appropriate one as the Accepted Solution for the benefit of others with the same issue.

 

Regards.

 

--Sharon