on 12-14-2009 5:11 PM
Hi,
Can somebody explain how to input the tag names dynamically into a tag query? I wouldn't know the tag names beforehand and the number could vary each time.
Regards,
Chanti.
assign your tag names to the parameters TagName.1, TagName.2 etc
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Christian,
I am not sure if I am missing your point. But heres what I am facing issue with. For instance, if I knew it was 3 tags I would assign them to TagName.1, TagName.2 and TagName.3. Likewise, if it was always 5 tags I would assign those to TagName.1 thru TagName.5. The thing though is I wouldn't know how many number of tags beforehand. It could be 3 tags one time, 5 the other, may be 50 the next time. How do you explain this scenario? Also, I would like to execute the tag query only once and not as many number of times as the tags. Did I make it clear?
Chanti.
Build a illum doc of your tag names and then assign the values all at once in the link editor using row indexing. e.g.
Rowset/Row[1]/TagName... Rowset/Row[2]/TagName ... etc.
I believe rows that don't exist will just assign blank to their respective tag name and thus not pull data. This has worked for me elsewhere but I have never tried it in a tag query.
UPDATE: Tried it on our 12.0 box and it works.
Edited by: Christian Libich on Dec 15, 2009 4:36 PM
I have exactly the same requirement.
My scenario needs to run in a BLS transaction. The tags I want to retrieve are stored into a DB table so I don't know them on development time. The user is free to add new tags to be monitored.
I need a way to retrieve the values from arbitrary tags.
Thank you.
Chanti,
You may actually be better off doing an OLEDB query against the datasource, especially if you have 50-100 tags. Your where clause could simply aggregate the tags as a stringlist and pass it into the SQL as
[Param.X]
. I am not sure whether you have a tag data source which you could gather the data from.
If you are doing aggregate functions, you may actually get a performance boost, but that would need testing to verify.
Another alternate is a bit more cumbersome.
Create an xml file with TagName.1 through TagName.128. Depending upon your MII version, you may have to do 128 assign statements with blank values assigned to those without a tagname. Should run pretty fast, but it would be tedious to build. Dynamic property addressing is coming, but I do not remember which version it will work in. With dynamic property addressing you could simply build the address using Repeater_0.CurrentItem to build your TagName.X addresses.
My apologies if I did not understand the previous posting, which seems to describe a similar approach. (Christian, is this what your posting referred to?)
Good luck,
Mike
Edited by: Michael Appleby on Dec 15, 2009 5:28 PM
Try sending a comma separated list of tagnames into your TagQuery action and link it to the "TagName" property.
It's a quick and easy test with a Current TagQuery template against simulator, then just link "CylTemp1,L1Speed" to the TagName property of the action block. Then Trace out the query results and look at the Rowsets/Rowset/Row for 2 tags.
Edited by: Jeremy Good on Dec 15, 2009 4:04 PM
Sorry to have not qualified this in my original post - this property is only exposed as of 12.1
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
My earlier comment about the action block exposing TagName as a linkable property is only relevant for MII 12.1.
http://help.sap.com/saphelp_xmii120/helpdata/en/45/cca23393696f74e10000000a1553f6/frameset.htm
/XMII/Illuminator?QueryTemplate=XXXXX/TagQuery&TagName=A,B,C,D&Content-Type=text/xml
So the comma list should do the trick and you can incorporate this as an XMLQuery in your TRX.
If your list of tags is already in document xml format, Christians idea of linking these into the indexed properties is a good one too, since the xpath for either a missing node or blank value should allow the link to 'blank' out a tag and not impact the query.
User | Count |
---|---|
12 | |
7 | |
3 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.