0
votes

When Updating a Enterprise Architect connector i get the following Error Message:

StateFlow is not legal for State --> State, Line:47 

The reason I want to update is that I want to add a Stereotype to one of my connectors. I have sorted out a Specific EA.Element via SQL Quierie searching for 1 GUID.

"SELECT * FROM t_object WHERE ea_guid='<Some specific GUID>'"

From this Element I have selected the only connector that is a selftransition. If i understand correctly i have to set the selftransition tag, and then update the connector. But when i update, the Error message above is shown.

My code:

if(element.Elements.Count!=0)//element is Propably a comp state or Statemachine
    {   
        connectors = element.Connectors; 
        for(var j = 0; j<connectors.Count; j++)
        {
            connector = connectors.GetAt(j);
            if(connector.ClientID == connector.SupplierID)
            {
                tempElement = element;
                connector.Stereotype="New Stereotype";
                connector.Update();

            }   
        }       
    }

The Red Transition in the picture is the Transition that throws the error.

enter image description here

What does the Error mean and why cant i update the connector? If you have other suggestions how to add a stereotype to a connector i would gladly apreciate them.

1

1 Answers

0
votes

That seems to be a bug, since StateFlow seems like a legitimate connector type between two States.

You can try unchecking the strict connector syntax setting in the options enter image description here

If you still have this issue in the latest version then you can report it as a bug

If nothing helps you can always try to go around the API and to the database directly. Try something like

Repository.Execute("update t_connector set stereotype = 'MyStereo' where connector_ID = 1234");

Replacing 1234 by the actual connector_ID of course.