Hi Fernando,
I have some static swimlines in my DSL - I think it is working in just the way you describe.
I didn't have to do anything special to make it work like this, though. I think it must be the default behaviour for swimlanes that are mapped to domain classes.
My swimlanes are mapped to different Domain Classes, each of which is embedded in the root class. I specified the cardinality to be 1..1 in each relationship, but I'm pretty sure this is not a crucial step.
The other types of Domain Classes in my DSL are embedded in the various "swimlane" classes, as required.
I did not create any tools to correspond to the "swimlane" classes.
Now when I create a new instance of the designer, the swimlanes are always added when it first opens, and instances of their classes appear in the DSL explorer under the root.
I'm not sure where the code that does this is. If you look in the generated code, there is a method called InitializeSwimlanes in Diagram.cs, but it appears to only create them if they are not mapped, as Attila was describing.
There is also a getter in there called CreatableSwimLaneSubjects that looks like it might be used for this, but I can't see where it is called. Anyway, the main thing is that it will create the swimlanes for you automatically. Understanding how it does so is not so important, from my perspective at least.
One minor point - you can control the order of the swimlanes, but in order to do this, you have to open the DslDefinition.dsl file in the XmlEditor (right click on SolutionExplorer and select Open With.. -> XML Editor). Then you must find the SwimLaneMap tags and cut and paste them until the order in the file matches the order you want, left to right, in your designer.
Chris |