cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

how to write service for alert window ?

ds-21
1-Newbie

how to write service for alert window ?

i need small alert window(popup box)  whenever  the  some property value exceeded threshold level

8 REPLIES 8

Hello Dinesh,

You can use validator to check if property value exceeds threshold value and depending on validator output(true or false) you can use status message to show alert window.

hello gautham vejandla,

               this is correct way  to validate the property value

if(me.temp>50)

{

    me.visible=true;

}

the above code write in service.what can i do next...

I am not sure if I understood correctly, you wrote a service which returns 'true' as output when a property value exceeds certain level?

if that is the case, then you can bind the output of this service with 'visible' property of 'status message' widget and write your alert message in 'message' field.

dcbb
1-Newbie
(To:ds-21)

can u post the Alert code.i am new on thingworx

dcbb
1-Newbie
(To:ds-21)

can u post the Alert code.i am new on thingworx

adityaku
1-Newbie
(To:dcbb)

you can write the service which you have written above.

if(me.temp>50)

{

    me.visible=true;

    result=true;}

else{

me.visible=false;

result = false;}

The return type of the above service should be boolean.

Then, now take an validator widget and pass the output of the above service to the input of the validator added. This should be invisible.

Now, in the evaluate section of the widget properties write:

if (result=true){output=true}else{output=false;} and set true to checkbox of the output property.

and click on message property and type the message which you want if output is true and also for if output is false.


and bind with text box or any label widget etc.



dcbb
1-Newbie
(To:adityaku)

this is work, but i need pop up alert in mashup i mean suppose if temp is very high display the pop up alert..How can u tell me

yhuang-21
1-Newbie
(To:dcbb)

it is work?i do just like Aditya say, but i take an validator widget and pass the output of the service to the input of the validator's visible,i not sure it is right.    can you show  me more about what you do for making it work??   thanks a lot!!!!

Top Tags