Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: avantol13 on June 20, 2014, 01:06:33 am

Title: Use of EA.Transition VS EA.Connector
Post by: avantol13 on June 20, 2014, 01:06:33 am
I'm trying to connect two states together with a transition in a C# addin. I can create the states and the "Transition" but don't know how to set the destination of the transition.

Alternatively, I've attempted using EA.Connector and setting the TransitionEvent/TransitionAction/TransitionGuard values. When using EA.Connector, it connects the 2 states but with a "dependancy"  not a "transition".

Any help would be greatly appreciated. Just getting to know the software and it's capabilities so forgive me.

Regards,
Alex
Title: Re: Use of EA.Transition VS EA.Connector
Post by: qwerty on June 20, 2014, 05:55:44 am
When you create the Connector supply "Transition" as the 2nd parameter.

q.
Title: Re: Use of EA.Transition VS EA.Connector
Post by: avantol13 on June 20, 2014, 09:34:49 pm
I tried that and when I go into EA and look at the connection, it's a dashed line and when right clicked it says "Dependancy Properties" instead of the desired "Transition Properties".

Here's a snippet of my code. states is a List<EA.Element>

connector = (EA.Connector)states[0].Connectors.AddNew("TRANSITION_EVENT_ONE", "Transition"); //source state
            connector.SupplierID = states[1].ElementID; //destination state
            if (!connector.Update()) //check for error
            {
                Console.WriteLine(connector.GetLastError());
            }
            states[0].Connectors.Refresh();
            connector.TransitionEvent = "TRANSITION_EVENT_ONE";
            connector.Constraints.AddNew("TRANSITION_EVENT_ONE", "Signal");
            connector.Update();

On another note, the constraints attempt above doesn't appear to work either. :(
Title: Re: Use of EA.Transition VS EA.Connector
Post by: qwerty on June 21, 2014, 10:27:04 pm
It appears that you have to create a "StateFlow" connector. That will do the job. I just tried that.

Regarding the constraints: for me the Update also fails. You should send a bug report to Sparx.

q.
Title: Re: Use of EA.Transition VS EA.Connector
Post by: avantol13 on June 23, 2014, 09:39:40 pm
"StateFlow" worked! Thank you so much.. I would've spent a bunch more time sifting through the help topics to figure this one out. I must've missed "StateFlow" the first time checking the different types of connectors.

Thanks,
Alex
Title: Re: Use of EA.Transition VS EA.Connector
Post by: qwerty on June 24, 2014, 01:14:11 am
Actually I created the connector in an empty repository and ran a SQL
Code: [Select]
SELECT * FROM t_connectorThat gave the immediate answer.

q.