Book a Demo

Author Topic: parsing data  (Read 3576 times)

utilisateurEA

  • EA User
  • **
  • Posts: 57
  • Karma: +0/-0
    • View Profile
parsing data
« on: August 23, 2010, 06:50:13 pm »
Hello,

I would like to write a C# script to find unused data.
I mean, I have parameters used in operations and data defined in another package. I would like to find data defined by not used in any operation.

My problem is that they have a different GUID :
- parameters used in operation are defined with parameterGUID
- data are defined with attributeGUID
I checked and it's not the same GUID.

I can find unused data with their name, but unfortunatly sometimes, several data has the same name (but are not contained in the same package).
And with Parameters there is no property like ParentID or something like this which could help me to differenciate parameters with the same name by a different path.

Do you have an idea of what I could do ?

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: parsing data
« Reply #1 on: August 23, 2010, 07:07:05 pm »
You have to use the ClassifierID.
That is the ID of the type of the parameter.

If you are looking for the operation that owns the parameter use the OperationID

I hope that is what you are looking for :-/, in your original post you are talking about AttributeGUID, but that should not have anything to do with parameters or their type.

Geert

utilisateurEA

  • EA User
  • **
  • Posts: 57
  • Karma: +0/-0
    • View Profile
Re: parsing data
« Reply #2 on: August 23, 2010, 10:38:39 pm »
Indeed I was confused with AttributeGUID... there is actually no link with attributes.

I'm going to try ClassifierGUID, thanks

utilisateurEA

  • EA User
  • **
  • Posts: 57
  • Karma: +0/-0
    • View Profile
Re: parsing data
« Reply #3 on: August 24, 2010, 10:23:14 pm »
Hi,

Do you know how to use ClassifierID. I mean: first of all, in help, there are 2 kind of ClassifierID : Long type and String type.

In my case, it seems to be string type.
But then, I don't know what kind of object I can find with ClassifierID.
For exemple using Repository.GetElementbyID does not work because it requires an "int" and not a "string".

Do you know waht kind of element I have (there is not Repository.getClassifierbyID...)

thank you
« Last Edit: August 24, 2010, 10:31:14 pm by utilisateurEA »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: parsing data
« Reply #4 on: August 24, 2010, 10:58:47 pm »
You'll have to parse the string to an integer/long depending on your needs. (welcome to the inconsistent world of EA :-/)

Using Repository.getElementByID should really get you an element (if the ClassifierID is not NULL or 0)

Geert