Book a Demo

Author Topic: Accessing notes from the tagvalue  (Read 6554 times)

SalimMulla

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Accessing notes from the tagvalue
« on: July 13, 2016, 11:43:58 pm »
Hello All,

I have multiple TagValues for an element. Now I want to generate notes for each TagValue in the document.
I have created a fragment template and written script as :

SELECT * FROM t_objectproperties
LEFT join t_object
ON t_objectproperties.Object_ID = t_object.Object_ID
WHERE t_objectproperties.Property = 'Test Case Type'

Here 'Test Case Type' is one of the TagValue for the element. This code prints the all the tag properties for 'Test Case Type' is one of the TagValue.
Now I want to extract the "Notes" from this 'Test Case Type' TagValue. Please let me know how to proceed further after "WHERE  t_objectproperties.Property = 'Test Case Type'".
I have attached the image for the same also.

Waiting for your reply.

Regards,
Salim Mulla

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Accessing notes from the tagvalue
« Reply #1 on: July 14, 2016, 12:35:34 am »
Where is your problem? The notes are in the Notes column.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Accessing notes from the tagvalue
« Reply #2 on: July 14, 2016, 02:03:59 am »
I don't see any image.

Geert

SalimMulla

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Accessing notes from the tagvalue
« Reply #3 on: July 14, 2016, 03:11:40 pm »
Hello,

I forgot to attach the image.

I know that notes are in the notes column. I want take the notes value in the local variable.
How can I do this?

Regards,
Salim Mulla

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Accessing notes from the tagvalue
« Reply #4 on: July 14, 2016, 03:39:07 pm »
Salim,

I'm not following. :-\
Sadly enough we cannot read your mind, so you'll have to explain in a bit more detail what you are trying to achieve, and where exactly you have a problem.

Geert

SalimMulla

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Accessing notes from the tagvalue
« Reply #5 on: July 14, 2016, 04:03:13 pm »
Hi,

SELECT * FROM t_objectproperties
LEFT join t_object
ON t_objectproperties.Object_ID = t_object.Object_ID
WHERE t_objectproperties.Property = 'Test Case Type'

After this I will get all the object properties for 'Test Case Type'. From these properties I want to extract the Notes column into a local variable so that I will use that variable in template generation.
The problem is with extraction of the notes column into local variable. How can I do this?

Regards,
Salim Mulla


« Last Edit: July 14, 2016, 04:48:14 pm by SalimMulla »

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Accessing notes from the tagvalue
« Reply #6 on: July 14, 2016, 05:03:08 pm »
Hi Salim,

One problem we have in answering your question is that you haven't indicated the context of the SQL query.   For example, if you are working directly in SQL (via, for example, SQL Management Studio or MS Access) then there is one answer.  If you are using the query as part of an EA internal search then there is another answer.  If you are using it as part of some add-in code (such as in C#), then there will be yet another answer.

Can you please clarify the surrounding context so we can help.

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Accessing notes from the tagvalue
« Reply #7 on: July 14, 2016, 05:37:42 pm »
I'm still not clear on what you are trying to do.

Are you working on RTF Templates?
In that case; are you using a query fragment or a script fragment?
If you are using a query fragment then you have to explicitly set the aliases of each result field and use that in your template.

So your query should be something like

Code: [Select]
SELECT tv.Property AS Tag, tv.Value AS TagValue, tv.Notes AS TagNotes
FROM t_objectproperties tv
INNER JOIN t_object o ON o.Object_ID = tv.Object_ID
WHERE tv.Property = 'Test Case Type'

Then in the template use custom fields as {Tag}, {TagValue} and  {TagNotes }

Geert