cancel
Showing results for 
Search instead for 
Did you mean: 

Sending tag names dynamically

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

assign your tag names to the parameters TagName.1, TagName.2 etc

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

So, you are saying I will need to have as many as 50 or 100 links (depending on the maximum number of tags) preassigned in the link editor? Is there anyway we can index the tagnames in the tag query as well - TagName.[i=1], TagName.[i1], TagName.[i2] etc.

Chanti.

Former Member
0 Kudos

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.

Former Member
0 Kudos

The way I proposed is the only solution I am aware of. Sometimes you just have to do a little crud work. It cant all be fun and charts Once you get on a roll the 50 links will be done in like 20min.

Former Member
0 Kudos

I understand what you are saying. Wondering if having the Tag Name and Tag Value input of a Tag Query action block in an XML format versus the current TagName.1...TagName.128 and TagValue.1...TagValue.128 helps our scenario???

Chanti.

agentry_src
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Pretty much. You don't have to worry about creating rows in your xml where there are no more tags because an assignment by index of a row that doesnt exist ( e.g. /Row[4]/... where there are only 3 rows in the doc ) will assign blank.

Answers (1)

Answers (1)

jcgood25
Active Contributor
0 Kudos

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

Former Member
0 Kudos

I thought this existed but when I looked the 'TagName' property doesnt seem to be exposed by the link editor. 12.0.8

Former Member
0 Kudos

Can you explain more about the "TagName" property? I don't see it in my version of MII - 12.0.7 Build(20).

I did try it with TagName.1. Looks like its only returning the last tag value. Its overwriting the previous tag value.

Chanti.

Edited by: CKxMII on Dec 15, 2009 9:55 PM

jcgood25
Active Contributor
0 Kudos

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.