Book a Demo

Author Topic: How to select tag values for operation parameters  (Read 3995 times)

heydukr

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
How to select tag values for operation parameters
« on: March 07, 2023, 01:54:41 am »
Hello, I've defined t_operationparams items in EA as a detail row for t_operation row connected via OperationID realation key. I've add a tag value to the operationparam. I'm able to select the operationparam:
SELECT * FROM t_operationparams a  where a.Name = 'IP_ADDRESS' 
Will You please give me an advice how to select matching tag to this param? And what raltaion key shall I use?

SELECT * FROM `ea-integration-platform`.t_propertytypes a where a.Property = '...'   - is a possibility but I miss a raletion key

Thank You

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to select tag values for operation parameters
« Reply #1 on: March 07, 2023, 01:56:36 am »
Parameter tags are stored in t_TaggedValue IIRC

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: How to select tag values for operation parameters
« Reply #2 on: March 07, 2023, 05:18:19 am »
Almost. It's t_oparationtag

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: How to select tag values for operation parameters
« Reply #3 on: March 07, 2023, 05:59:40 am »
Almost. It's t_oparationtag

q.
For parameters? Are you sure?

In my parameter wrapper class I have this:

Code: [Select]
        protected override string getTaggedValueQuery(string taggedValueName)
        {
            return @"select tv.PropertyID from t_taggedvalue tv
where tv.TagValue like '" + taggedValueName + "' "
                + " and tv.ElementID = '" + this.uniqueID + "'";
        }

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: How to select tag values for operation parameters
« Reply #4 on: March 07, 2023, 09:26:33 am »
My, bad. I attached it to an operation :-( But now, how can a parameter be tagged?

q.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: How to select tag values for operation parameters
« Reply #5 on: March 07, 2023, 07:26:12 pm »
My, bad. I attached it to an operation :-( But now, how can a parameter be tagged?

q.
EA lets you do it.  Select a parameter for an operation (I used the Primary Key operations on a Table), then add the tag.  As Geert said, they end up in t_taggedvalue.

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

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: How to select tag values for operation parameters
« Reply #6 on: March 07, 2023, 07:40:52 pm »
I guess, since you mention it, that this is only possible for database opertation parameters (I dealt with that only many years ago). Normal classes do not offer creation of tags.

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: How to select tag values for operation parameters
« Reply #7 on: March 07, 2023, 08:15:13 pm »
I guess, since you mention it, that this is only possible for database opertation parameters (I dealt with that only many years ago). Normal classes do not offer creation of tags.

q.
They do. It works the same as with associationends.
On the operation properties Tags, there are sections for all parameters. If you click on a parameter and then use the "add new tag" button, it adds a tagged value to the parameter.

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: How to select tag values for operation parameters
« Reply #8 on: March 07, 2023, 08:52:40 pm »
You are right (as always), Geert. I never was aware of that... (the way it works is EAUI, also as always).

q.

heydukr

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: How to select tag values for operation parameters
« Reply #9 on: March 07, 2023, 11:07:49 pm »
Thank You very much, I've got it:

SELECT b.Name AS param_name
         , a.Notes  AS param_tag_value
   FROM  t_TaggedValue a
           , t_operationparams b
  WHERE a.TagValue = 'TAG NAME'  
      AND a.ElementID = b.ea_guid

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to select tag values for operation parameters
« Reply #10 on: March 07, 2023, 11:39:14 pm »
Yes, but I would write it differently:

Code: [Select]
SELECT opr.Name AS param_name
,tv.Notes AS param_tag_value
FROM  t_TaggedValue tv
INNER JOIN t_operationparams opr on opr.ea_guid = tv.ElementID
WHERE tv.TagValue = 'TAG NAME' 

This way you differentiatie between your join criteria and your selection criteria

Geert

heydukr

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: How to select tag values for operation parameters
« Reply #11 on: March 08, 2023, 07:12:19 pm »
You're right, thank You