1
Bugs and Issues / Publishing patterns does not consider package hierarchy
« on: June 06, 2017, 06:31:46 pm »
Sometimes good quick ideas turn into medium high effort ones if your enthusiasm is doing the front runner dance with reality 
The idea:
Create a pattern for virtual model documents to have the same documentation structure at hand over and over again.
The challenge:
To have a common header with history, etc. these have to be stored in a document artifact inside a package to be colelcted by the document generator.
What has been accomplished:
Setting up the structure of model documents (empty) to be filled with packages later on (after expanding the pattern).
Setting up a package with the document artifact containing the history.
Creation of a diagram with all elements on it including the package with the artifact plus the artifact itself separately on the diagram (it will otherwise not be saved with the pattern).
So the structure is:
model document 1 (referencing the header package below)
model document 2 (empty)
model document 3 (empty)
Header package
|
---Artifact with history
On the diagram all 5 objects are placed flat and the diagram is saved as a pattern.xml
After importing the pattern and applying it to a diagram the following is observable:
To conclude: Creating patterns does not consider package hierarchies as they are saved from diagrams. A package in turn does not automatically include its contents and putting the content flat in the diagram leads to having it reflected flat in the pattern.
I am not tempted to state this is a bug. Currently I felt this to be a great idea to handle a certain use case of mine to solve a specific problem and I have found my expectations are not matched.
Therefore I will not file a bug report but raise this as a note to everyone expecting recursive inclusion of items in patterns. It does not work.
I am pretty much convinced there are more important problems Sparx should take care of and I even know a few of these.
Oliver

The idea:
Create a pattern for virtual model documents to have the same documentation structure at hand over and over again.
The challenge:
To have a common header with history, etc. these have to be stored in a document artifact inside a package to be colelcted by the document generator.
What has been accomplished:
Setting up the structure of model documents (empty) to be filled with packages later on (after expanding the pattern).
Setting up a package with the document artifact containing the history.
Creation of a diagram with all elements on it including the package with the artifact plus the artifact itself separately on the diagram (it will otherwise not be saved with the pattern).
So the structure is:
model document 1 (referencing the header package below)
model document 2 (empty)
model document 3 (empty)
Header package
|
---Artifact with history
On the diagram all 5 objects are placed flat and the diagram is saved as a pattern.xml
After importing the pattern and applying it to a diagram the following is observable:
- The model documents are in place including tagged values and ready to be filled for documentation. This is nice. Check.
- The header package is present. Check.
- The artifact is no longer inside the package. Not good.
- The package is no longer referenced in the model document. Not good.
To conclude: Creating patterns does not consider package hierarchies as they are saved from diagrams. A package in turn does not automatically include its contents and putting the content flat in the diagram leads to having it reflected flat in the pattern.
I am not tempted to state this is a bug. Currently I felt this to be a great idea to handle a certain use case of mine to solve a specific problem and I have found my expectations are not matched.
Therefore I will not file a bug report but raise this as a note to everyone expecting recursive inclusion of items in patterns. It does not work.
I am pretty much convinced there are more important problems Sparx should take care of and I even know a few of these.
Oliver