Book a Demo

Author Topic: Extract StateMachine / States Transitions (java)  (Read 5166 times)

Luc De Graef

  • EA Novice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Extract StateMachine / States Transitions (java)
« on: June 08, 2012, 08:05:04 pm »
Hello,

I traverse the repository Object Model with java eeapi.jar. However I don't know how to determine a StateMachine connected to an element.
Furthermore how can I get the States from a StateMachine and its transitions.

I want to have the COM equivalent of the following SQL queries...

Code: [Select]
select * from t_object
           where  (Package_ID = 11121 and Name = 'Orderline')
--> this is  a Class with a StateMachine attached to it
          
   select * from t_object
            where  parentId = (select object_Id from t_object
            where  (Package_ID = 11121 and Name = 'Orderline') )
---> This shows the state machine
  
  
   select *  from t_connector
            where connector_type = 'StateFlow' and
            (Start_Object_ID in (select object_id from t_object where (Object_Type like 'State%' ) and Package_ID = 11121 and (ParentID = 94970 or Object_ID = 94970))
            or End_Object_ID in (select object_id from t_object where (Object_Type like 'State%' ) and Package_ID = 11121 and (ParentID = 94970 or Object_ID = 94970)) )  
 --> This shows the state transitions

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Extract StateMachine / States Transitions (jav
« Reply #1 on: June 08, 2012, 09:00:41 pm »
Luc,

The statemachine would be an element in the (parent) Element.Elements collection.
The states (and pseudo states) themselves are also elements in the (statemachine) Element.Elements collection.
Transitions are to be found in the (state/pseudostate) Element.Connectors

Geert

Luc De Graef

  • EA Novice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: Extract StateMachine / States Transitions (jav
« Reply #2 on: June 26, 2012, 12:05:26 am »
Thanks,
I did not notice your answer...
It helps me a lot.

Luc

minrie

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Extract StateMachine / States Transitions (jav
« Reply #3 on: November 23, 2012, 06:08:56 pm »
Hi,

Since you can get the transitions in a State Machine, is there a way to activate the transitions to continue the simulation flow?

Thanks,
Minrie

Luc De Graef

  • EA Novice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: Extract StateMachine / States Transitions (jav
« Reply #4 on: November 24, 2012, 01:47:02 am »
Sorry,
We haven't used the simulation (yet)
Luc

g.makulik

  • EA User
  • **
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: Extract StateMachine / States Transitions (jav
« Reply #5 on: November 24, 2012, 05:36:39 am »
Quote
Since you can get the transitions in a State Machine, is there a way to activate the transitions to continue the simulation flow?

What is meant here that the transition representation can be retrieved as a connector object from the model (-DB). I've never worked with the API for model simulation, but I'm pretty sure the objects represented there are s.th. quite different (maybe somehow related though).

Best regards,

Günther
Using EA9.3, UML2.3, C++, linux, my brain, http://makulik.github.com/sttcl/