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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

How can I add "Automatic update when values available" service in my custom service?

bgupta-2
9-Granite

How can I add "Automatic update when values available" service in my custom service?

Dear Team,

I need to enable  Automatic update when values available in custom service. So how can I achieve this  functionality?

7 REPLIES 7
PaiChung
22-Sapphire I
(To:bgupta-2)

Can you explain this a little better please?

What does your model look like, what is your service, what needs to be updated?

Hi,

I need to auto update my time series chart. For this I am using Auto refresh widget. But  I don't want to sue this AutoRefresh widget.  Such refresh option are available in GetProperties [Automatic update when values available] without using AutoRefresh widget.

In order to render data on my time series following  code has written. So How can I add  [Automatic update when values available] features in mu custom service in order to  avoid AutoRefresh widget?

My service code:

var query2 = {

  "filters": {

    "fieldName": "source",

    "type": "EQ",

    "value": filter

  }

};

var params = {

   

    oldestFirst: undefined /* BOOLEAN */,

  maxItems: undefined /* NUMBER */,

  sourceTags: undefined /* TAGS */,

  endDate: undefined /* DATETIME */,

  query:  query2 /* QUERY */,

  source: undefined/* STRING */,

  startDate: undefined /* DATETIME */,

  tags: undefined /* TAGS */

   

};

// result: INFOTABLE

var result = Things["PumpValueStream"].QueryStreamEntriesWithData(params);

Data binding  on mashups

ankigupta
5-Regular Member
(To:bgupta-2)

Hi Bhuwaneshwar Gupta

Automatically update values when able is currently available only for GetProperties service.

As a workaround; you can try to call your custom Service on ServiceInvokeCompleted of GetProperties service.

I hope it helps.

Thanks. But this workaround not working.

ankigupta
5-Regular Member
(To:bgupta-2)

Hi Bhuwaneshwar Gupta​,

Please do following:

1. Find all the Properties in your Thing for which the DataChange should trigger the custom service.

2. In mashup; add value display widget (or some other widgets) for each property in Step1.

3. Bind the properties from GetProperties service to these widget.

4. Set visible property of these widgets to false so that they don't show up at the RunTime.

5. Now bind the ServiceInvokeCompleted of GetProperties Service to your custom Service.

6. Save and view Mashup.

Result: When any of the Property from Step1 is changed; Custom Service will be called.

ankigupta
5-Regular Member
(To:bgupta-2)

Hi Bhuwaneshwar Gupta​,

Did my suggestion resolve your issue?

Thanks. Working

Top Tags