Author Topic: Use of EA.Transition VS EA.Connector  (Read 4284 times)

avantol13

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Use of EA.Transition VS EA.Connector
« 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

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Use of EA.Transition VS EA.Connector
« Reply #1 on: June 20, 2014, 05:55:44 am »
When you create the Connector supply "Transition" as the 2nd parameter.

q.

avantol13

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Use of EA.Transition VS EA.Connector
« Reply #2 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. :(
« Last Edit: June 20, 2014, 10:00:26 pm by avantol13 »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Use of EA.Transition VS EA.Connector
« Reply #3 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.
« Last Edit: June 21, 2014, 10:38:36 pm by qwerty »

avantol13

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Use of EA.Transition VS EA.Connector
« Reply #4 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

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Use of EA.Transition VS EA.Connector
« Reply #5 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.