Book a Demo

Author Topic: export all transitions from a statemachine  (Read 4300 times)

mati

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
export all transitions from a statemachine
« on: July 12, 2013, 07:25:16 pm »
Hello,

I modeled a Statemachine with many transitions. With a guard and/or trigger and without a guard or trigger. I also have Substatemachines in my model.

I need an list of all transitions which are included in the Statemachine and in the Substatemachines.

The list could be formatted like the following.

SourceDestination
State1State2
State3State1
......


it doesn't need to be a table. Also a text list like the following would be enough.

State1_State2
State3_State1
..._...

Since my Statemachine will changed often, I need a way to get the list without too much effort.

Thanks for your help.

Best Regards,

Mati

Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
Re: export all transitions from a statemachine
« Reply #1 on: July 12, 2013, 08:30:01 pm »
Hello Mati,

I would write a little query and export the reults to *.csv.

Helmut
Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)

mati

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: export all transitions from a statemachine
« Reply #2 on: July 12, 2013, 10:23:50 pm »
Hi,
Thanks for your help.

I didn't know that it is possible to do an sql query in the "Model Search".
I tried several thinks. But i wasn't able to get it run like is need it.
SQL didn't help me as well. Is there an documentation for the SQL Tables?

Or what would be the best way to get it done.

Thanks again.


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: export all transitions from a statemachine
« Reply #3 on: July 12, 2013, 11:33:08 pm »
Try this when you create a new SQL Search.
(check the manual if you have never added SQL Searches before)
Code: [Select]
select sob.ea_guid as CLASSGUID,sob.object_type as CLASSTYPE, pob.Name as StateMachine, sob.Name as FromName, tob.Name as ToName from (((t_connector c
inner join t_object sob on c.Start_Object_ID = sob.Object_ID)
inner join t_object tob on c.End_Object_ID = tob.Object_ID)
inner join t_object pob on sob.ParentID = pob.Object_ID)
where
pob.Object_Type = 'StateMachine'
and c.Connector_Type = 'StateFlow'
and pob.name like '#WC#<Search Term>#WC#'
order by pob.Object_ID, sob.Name, tob.name

Geert

mati

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: export all transitions from a statemachine
« Reply #4 on: July 13, 2013, 12:45:25 am »
Thanks Geert,

that helps me a lot.
I just added some conditions.

Regards

mati

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: export all transitions from a statemachine
« Reply #5 on: July 16, 2013, 04:33:11 pm »
Hi everybody,

I've got one additional question.
How can I add the Trigger, Guards and the effect of a transition in the query?
Shouldn't they a property of the t_connector  ?

Thanks again.

mati

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: export all transitions from a statemachine
« Reply #6 on: July 16, 2013, 05:15:54 pm »
Check the contents of PDATA2.

q.