Hi!
Well I've finally taken the plunge into the Automation Interface.
I've written (well actually, Dan did in case he's reading this, but I'm the one who'll be doing the maintenance) a Java program to reverse-engineer one of our proprietary configuration languages.
This language has 'structs' which contain 'fields.' The fields in turn have a type, but structs cannot contain other structs, nor can fields contain other fields. In other words, the type system is very simple.
I have created a Profile to represent these entities in UML.
Now here's the problem. I can generate all the 'field' UML classes just fine, and also all the 'struct' UML classes. But the attributes in the 'struct' classes don't get the right types.
The class for a 'struct' is, of course, intended to use the 'field' classes for its attribute types. But while the name matches in the generated model, the actual reference is missing.
I've tested this by renaming a 'field' class which is being used in a 'struct' class. Normally when you do this, EA updates the type name in the using class. In my case this doesn't happen, indicating that the attribute type is not correctly referenced.
If I go into the dialog and set the attribute type to the exact same one by selecting it from the list, the test works.
The 'struct' and 'field' classes are in two packages, but I tried putting them in the same package and that didn't make a difference.
When I create my 'struct' class, I use the org.sparx.Attribute.SetType() method, simply specifying the name of the previously generated 'field' class.
What should I be doing?
Thanks,
/Uffe