Book a Demo

Author Topic: XML that controls state machine symbol  (Read 7968 times)

Paul Neyman

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
XML that controls state machine symbol
« on: May 05, 2010, 07:08:34 am »
Hello!

I am currently writing a tool that creates EA-understood XMI file from our own homegrown diagrams. I am trying to figure out the XML that differentiates a simple state in EA from a state machine: expandable on a click and has 'glasses' symbol in the state.

I figured out that the minimum XML that controls it is of the following form:

<UML:TaggedValue tag="$ea_xref_property"
value="

$XREFPROP=$XID={My_Unique_Id}$XID;
$NAM=DefaultDiagram$NAM;
$TYP=element property$TYP;
$CLT={673E1AFA-FEC1-4573-9171-A3CAD95CAF8B}$CLT;
$SUP={DE9A2B61-92AB-495e-B7B4-C3316FD002C7}$SUP;

$ENDXREF;"/>

However, the CLT and SUP ids are unique in the XMI files generated by the EA itself when you do project export to XMI. What are these IDs and how could I create them properly so that EA could successfully parse the XMI and create state machines?

Thank you.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: XML that controls state machine symbol
« Reply #1 on: May 05, 2010, 08:50:59 am »
Quote
However, the CLT and SUP ids are unique in the XMI files generated by the EA itself when you do project export to XMI.
Are you sure? They should be the GUIDs of the state machine and its child diagram respectively. I would expect to see something like this:

Code: [Select]
<UML:StateMachine name="whatever" xmi.id="EAID_673E1AFA..."
and something like this:

Code: [Select]
<UML:Diagram name="whatever" xmi.id="EAID_DE9A2B61..."
The Sparx Team
[email protected]

Paul Neyman

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: XML that controls state machine symbol
« Reply #2 on: May 05, 2010, 09:13:53 am »
Quote
Are you sure? They should be the GUIDs of the state machine and its child diagram respectively. I would expect to see something like this:

Code: [Select]
<UML:StateMachine name="whatever" xmi.id="EAID_673E1AFA..."
and something like this:

Code: [Select]
<UML:Diagram name="whatever" xmi.id="EAID_DE9A2B61..."


KP,

The code you list is responsible for the hierarchy tree in the project explorer. Indeed, if you generate this XML (with proper geometry elements, etc), you will be able to navigate through state machines and see states inside using the project explorer.

BUT, the state machines will look just like regular states. You will not be able to click them and navigate to the sub-state machine, and they will not have the 'glasses' symbol.

This portion is controlled by the code I listed originally, and indeed, the CLT and SUP id's are unique. I suspect the are an encoded version of package/super-state machine id's, but I don't know what the algorithm is, and how they are generated.

Thanks.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: XML that controls state machine symbol
« Reply #3 on: May 05, 2010, 09:26:10 am »
Quote
BUT, the state machines will look just like regular states. You will not be able to click them and navigate to the sub-state machine, and they will not have the 'glasses' symbol.
Your state machine will also need:
Code: [Select]
<UML:TaggedValue tag="ea_ntype" value="8"/>The value is zero by default.
The Sparx Team
[email protected]

Paul Neyman

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: XML that controls state machine symbol
« Reply #4 on: May 05, 2010, 09:42:45 am »
Quote
Quote
BUT, the state machines will look just like regular states. You will not be able to click them and navigate to the sub-state machine, and they will not have the 'glasses' symbol.
Your state machine will also need:
Code: [Select]
<UML:TaggedValue tag="ea_ntype" value="8"/>The value is zero by default.

Thanks, KP!

But what about CLT and SUP codes? Any advice on how to generate those? Having ea_ntype by itself is not enough.

Thanks.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: XML that controls state machine symbol
« Reply #5 on: May 05, 2010, 11:34:53 am »
If they aren't in your XML then they must be somewhere else in your model. This isn't really my area of expertise so I'm not sure if I can be more helpful. All I did was create a package with a diagram, put a state machine on the the diagram and export the package to XMI and see what it looked like.
The Sparx Team
[email protected]

Paul Neyman

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: XML that controls state machine symbol
« Reply #6 on: May 05, 2010, 12:32:16 pm »
Quote
If they aren't in your XML then they must be somewhere else in your model. This isn't really my area of expertise so I'm not sure if I can be more helpful. All I did was create a package with a diagram, put a state machine on the the diagram and export the package to XMI and see what it looked like.

KP, is there anyone on Sparx team I could talk to about this? This is quite important, and I would like to file support ticket if needed to get this information.

Thank you.
Paul.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: XML that controls state machine symbol
« Reply #7 on: May 05, 2010, 01:02:28 pm »
Sure, you can contact support through the normal channels.
The Sparx Team
[email protected]