Author Topic: read Combined fragment's conditions  (Read 5225 times)

Yassine

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
read Combined fragment's conditions
« on: September 09, 2016, 08:42:04 pm »
Hi all,

I'm using a c# add-in and I would like to know, how I can read the Combined fragment's conditions. I went through all the properties available and I still cannot find where they are stored.

Thank you,
Yassine Hamza

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: read Combined fragment's conditions
« Reply #1 on: September 09, 2016, 08:46:33 pm »
You might want to give us a bit more information then "combined fragment condition". That doesn't really ring a bell for me.

Geert

Yassine

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: read Combined fragment's conditions
« Reply #2 on: September 09, 2016, 09:04:05 pm »
Hi,

Sorry for the lack of information form my side.

So I have a Sequence diagram, and I want to parse the elements of all the diagram including Combined fragment( or InteractionFragment)

This is my Code:

foreach ( Diagram d in packages.Diagrams){

if(d.Name == "Sequence diagram"){

foreach(DiagramObject o in d.DiagramObjects){
if( repository.GetElementById(o.ElementID).Type == "InteractionFragment"){
Element CombinedFragement=repository.GetElementById(o.ElementID);
string condition = //Here is where I want to extract the conditions (if [condition 1] else [condition 2] ) in the Combined Fragment
}
}

}

I hope that's clear.

Thank you,
Yassine


qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: read Combined fragment's conditions
« Reply #3 on: September 09, 2016, 09:25:03 pm »
They are stored in t_xref. Look for the entries with ClientID being the guid of the fragment. You will find entries like

Name:Partitions
Type:element property
Description:@PAR;Name=condition;Size=40;GUID={BB1E1E12-7F24-4ee7-9A67-6121C07B5AB0};@ENDPAR;

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: read Combined fragment's conditions
« Reply #4 on: September 09, 2016, 09:47:40 pm »
They are stored in t_xref. Look for the entries with ClientID being the guid of the fragment. You will find entries like

Name:Partitions
Type:element property
Description:@PAR;Name=condition;Size=40;GUID={BB1E1E12-7F24-4ee7-9A67-6121C07B5AB0};@ENDPAR;

q.

Always fun having to parse out the details from a t_xref field.  :-X

If you are lucky you might find through the API too. Look closely at all the field EA.Element. Might be hidden in the StyleEx or CustomProperties or something like that, your never know.

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: read Combined fragment's conditions
« Reply #5 on: September 09, 2016, 09:56:46 pm »
Ah yes, Geert. Element.Partitions also has the needed information.

q.

Yassine

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: read Combined fragment's conditions
« Reply #6 on: September 09, 2016, 10:11:40 pm »
Hi,

It's solved.
Thank you all for your help :D.

Best Regards,
Yassine