AnsweredAssumed Answered

Adding Data Sources to a Coresight Custom Symbol programmatically

Question asked by JanvanderVen on Sep 6, 2016
Latest reply on Sep 7, 2016 by JanvanderVen

Hi all,

 

In order to make my custom Coresight symbol easy to use, I made in the following way:

1) The user drops the parent attribute on the display

2) Using the PI Web API the child elements and their relevant attributes are looked up

3) The symbol is rendered for the first time

4) Using the web api new data is read and the symbol updates itself

 

If you then double click on the symbol the trend that is shown is of the first attribute only, which I completely expected by the way, How could Coresight know what's going on?

 

I then found out what is displayed on that TrendPopup: The scope.symbol.DataSources.

 

So once I had retrieved the children through the web api, I added the ones I wanted to that DataSources array. Et voila, the double click trend showed them all.

 

But more things happened: The added datasources also came back in the dataUpdate function!

 

This means that I can simplify my customization:

1) The user drops the parent attribute on the display

2) Using the PI Web API the child elements and their relevant attributes are looked up

3) Add these to scope.symbol.DataSources array

4) Use the Coresight data pump to update the symbol.

 

Now my questions are:

1) Are there any drawbacks to this scenario?

2) Will this remain possible when the Coresight Extensibility is released?

 

 

Kind regards,

 

Jan

Outcomes