1 of 1 people found this helpful
What version of Coresight/Vision are you using? On my system (Vision 2017), child attributes are returned for the DataSource.Multiple default symbols (trend, table, etc). There is no additional logic for these symbols to pull in the child attributes. If you're curious, check out the addTraces function that gets called when dataSources are added in PIVisualization.sym-trend.js - the datasources are passed in beforehand and not modified in the function.
Anyway, after quite a bit of digging it seems as though the functionality to pull in the attributes when you select an element is offloaded to the PI Web API search controller. For my particular test (pulling in an element called Well2), the URL that Vision used was:
https://<server>/piwebapi/search/query?q=(name:Well2 OR attributename:Well2)&scope=af:\\PMARTIN-AF\Regions\Region\South\Houston\Well2&fields=Name;Description;UoM;DataType;ItemType;UniqueId;MatchedFields;Template;HasChildren;Paths;Attributes&count=1000
You can use a similarly formatted URL to see what's returned from your Web API. Make sure your database has been crawled after making changes.
As an aside, I learned quite a bit researching this so thanks for the good question!
Using Vision 2017, so results should be the same. But it turns out i had not been paying attention to my test setup properly. All the child attributes i was missing were hidden...
Thanks for the nice research! Did not expect the stock symbols to also rely on the PI Web API... I know there is something brewing wrt to the way data is delivered to symbols, but i did expect at least the stock symbols to rely on the data already in the various behaviour types.
As long as one can avoid making another trip through the PI Web API no need to waiste the time and code on that!
2 of 2 people found this helpful
From my experience, dragging in an element will always drag in all non-hidden children every time (including childrens children etc.) as long as the datasourceBehaviour of the symbol symbol is Multiple (for custom symbols note that the 'Value' config.DataShape will override Multiple to Single).
Something else to note is, if you make a custom symbol which is multi-source, the first attribute in the list (scope.symbol.DataSources) is the attribute which the multi-state status is based upon, this can obviously be changed manually after the symbol has been turned into a multi-state or programatically.