[Uml-user] How to extract associations between states in state diagram?
funkyworklehead at yahoo.com
funkyworklehead at yahoo.com
Fri Jun 1 21:32:26 UTC 2007
I've drawn a simple finite state machine(FSM)
in Umbrello as a "State Diagram"
+---+ EVENT_A +---+
| A |------------>| B |
+---+ +---+
Given this FSM I would like to extract the
associations from the XML. i.e. I would like
to read the xml file produced by this drawing
and gain the following information:
There are 2 states:
- A
- B
There is 1 association (transition):
- <transition_1>:
type = directed (i.e. 1 endpoint)
text = EVENT_A
begin point = state A
endpoint = state B
Does anyone know what attributes of the XML will
give me this information? I can't seem to find
a pattern. I don't see how the states and
transition arrow are linked by looking at the
attributes of the XML.
Example StateWidget:
<--! FOR STATE A -->
<UML:StateWidget statetype="1" statename="A" usesdiagramfillcolour="1" width="47" usesdiagramusefillcolour="1" x="172" linecolour="none" y="185" instancename="" usesdiagramlinecolour="1" fillcolour="none" height="27" usefillcolor="1" isinstance="0" xmi.id="11" documentation="" font="Sans Serif,10,-1,5,50,0,0,0,0,0" >
<--! FOR STATE B -->
<UML:StateWidget statetype="1" statename="B" usesdiagramfillcolour="1" width="47" usesdiagramusefillcolour="1" x="342" linecolour="none" y="195" instancename="" usesdiagramlinecolour="1" fillcolour="none" height="27" usefillcolor="1" isinstance="0" xmi.id="12" documentation="" font="Sans Serif,10,-1,5,50,0,0,0,0,0" >
<--! Association widget -->
<associations>
<UML:AssocWidget totalcounta="2" indexa="1" visibilityB="200" totalcountb="2" indexb="1" widgetbid="12" widgetaid="11" roleBdoc="" roleAdoc="" type="514" changeabilityA="900" changeabilityB="900" visibilityA="200" >
<linepath>
<startpoint startx="219" starty="198" />
<endpoint endx="342" endy="208" />
</linepath>
<UML:FloatingTextWidget usesdiagramfillcolour="1" width="120" usesdiagramusefillcolour="1" x="280" linecolour="none" y="203" instancename="" posttext="" usesdiagramlinecolour="1" role="703" fillcolour="none" height="20" usefillcolor="1" pretext="" isinstance="0" xmi.id="-1" text="EVENT_A" font="Sans Serif,10,-1,5,50,0,0,0,0,0" />
<UML:FloatingTextWidget usesdiagramfillcolour="1" width="16" usesdiagramusefillcolour="1" x="221" linecolour="none" y="200" instancename="" posttext="" usesdiagramlinecolour="1" role="709" fillcolour="none" height="20" usefillcolor="1" pretext="+" isinstance="0" xmi.id="-1" text="" font="Sans Serif,10,-1,5,50,0,0,0,0,0" />
<UML:FloatingTextWidget usesdiagramfillcolour="1" width="16" usesdiagramusefillcolour="1" x="324" linecolour="none" y="186" instancename="" posttext="" usesdiagramlinecolour="1" role="710" fillcolour="none" height="20" usefillcolor="1" pretext="+" isinstance="0" xmi.id="-1" text="" font="Sans Serif,10,-1,5,50,0,0,0,0,0" />
</UML:AssocWidget>
</associations>
I don't want to try to extract the information from the X,Y position
co-ordinates, because who is to say that some of the consumers of my
code in process won't overlap states...
Does anyone know? Could a developer give me a hint?
Thanks.
____________________________________________________________________________________
Luggage? GPS? Comic books?
Check out fitting gifts for grads at Yahoo! Search
http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/umbrello/attachments/20070601/688b34dd/attachment.html>
More information about the umbrello
mailing list