Book a Demo

Author Topic: Create a model pattern  (Read 6770 times)

Guillaume

  • EA Practitioner
  • ***
  • Posts: 1405
  • Karma: +42/-2
    • View Profile
    • www.umlchannel.com
Create a model pattern
« on: March 15, 2012, 08:53:32 pm »
Hi,

I'd like to list in my EA a model pattern that matches an EAP project I created to be used as a template.
I know I could use the copy base project, but how can I get it listed in the Model Patterns set up by Sparx?

I tried creating an MDG but it doesn't seem to include the project structure

Thanks,
Guillaume
Guillaume

Blog: www.umlchannel.com | Free utilities addin: www.eautils.com


philchudley

  • EA User
  • **
  • Posts: 750
  • Karma: +22/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: Create a model pattern
« Reply #1 on: March 16, 2012, 12:22:08 am »
Hi

You have to export the structure of your patter model as XML files (say one per view).

The Generate an MDG using a new MTS file.

You then have to manually edit the MTS file to add sections such as the example below


[highlight]<ModelTemplates>
            <Model name="Requirements View"
                       description="Requirements section Krutchen's 4+1 View"
                       location="C:\EA-Projects\Training\Power Users\XML Files\Requirements View.xml" default="yes"
                       icon="34"
                       filter=""/>[/highlight]


Where location is the path to the xml exports created from your pattern EAP

Icon is the View Icon

This is detailed in the User Guide and is easier to do than it is to describe, I hope I have given you enough info to get you started. If not let me know and I can send you a step by step tutorial

Cheers

Phil
Models are great!
Correct models are even greater!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Create a model pattern
« Reply #2 on: March 20, 2012, 12:37:58 am »
I also tried to create a pattern to be included in a toolbox. I can't get it to work. Phil's addition did change the resulting MDG but in both cases I don't get the toolbox up and running. I'm only presented the guillemets and when trying to drag the pattern onto a diagram I get the message: Pattern not found in model's resources.

So I imported my pattern manually in the resource view. Same message. (I tried both the MDG ID and the Profile group name: MyMDG::MyPatter(UMLPattern) as well as Basic Patterns::MyPattern(UMLPattern)).

What's going wrong?

q.

philchudley

  • EA User
  • **
  • Posts: 750
  • Karma: +22/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: Create a model pattern
« Reply #3 on: March 20, 2012, 01:27:50 am »
Ah I see, I believe Guilluame was trying to incorporate a Model Project structure in an MDG Technology, so that he could create such a structure using Create New Project or Add New Model using Wizard.

That's what my reply was about.

With regards to patterns. I assume that you created the pattern by creating a pattern on a diagram and then using the Diagram | Advanced | Save as UML Pattern menu option ... thereby creating an XML file.

To incorporate this into an MDG try the following:

1) Select Tools | Generate MDG Technology File...
2) Click Next when the Wizard begins
3) Select either "Create a new MTS file" or if you already have an MTS file select "Open and existing MTS file"
4) Proceed through the Wizard until a dialog of checkboxes appears, these indicate what to include in the MDG
5) Ensure that the checkbox Patterns is selected
6) When you proceed through the wizard, you will be asked to navigate to where your pattern(s) are stored. Choose the pattern(s) and then continue and complete the wizard and generate your MDG

Upon reloading EA  your pattern should now be available. I say should, because I have never incorporated a pattern in an MDG, but it's worth a try.

Cheers

Phil
Models are great!
Correct models are even greater!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Create a model pattern
« Reply #4 on: March 20, 2012, 01:50:17 am »
Hi Phil,
thanks for the fast response. Actually that is what I did. But it does not work. I currently try to find out what's happening by comparing my MDG with the StrategyMap. Maybe it's something trivial and it's just a blockade in my brain. I'll post my findings when I got it.

q.

philchudley

  • EA User
  • **
  • Posts: 750
  • Karma: +22/-0
  • EA Consultant / Trainer - Sparx Europe
    • View Profile
Re: Create a model pattern
« Reply #5 on: March 20, 2012, 01:55:53 am »
Thanks will be most interested in your findings. I have also just found that it doesn't work .

I had a similar problem with user defined tagged values being part of the MDG but not available when elements where created from the profile, but I have cracked that. I found the answer by dissecting the BPMN 1.1 MDG xml file

Cheers

Phil
Models are great!
Correct models are even greater!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Create a model pattern
« Reply #6 on: March 20, 2012, 02:10:57 am »
So I found out a bit more. First: I had a simple typo.

Second: The namespace seems that it must be the ID you specify in the MDS. When I do so I'm able to drag my pattern from the toolbox.

The icon still is invalid (guillemts only). And I get an error message when loading my EAP "Encountered an improper argument".

Hmmm...

q.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Create a model pattern
« Reply #7 on: March 20, 2012, 02:15:30 am »
Okay. Almost done. The error message was due to the manual editing of the MTS (as playing with your above addition). After cleaning the MTS it's almost working. The only thing missing is the correct icon.

q.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Create a model pattern
« Reply #8 on: March 20, 2012, 03:51:47 am »
Now I'm able to create a pattern line in the toolbox. But I have to do that completely manually. I copied the Org Chart part from the StrategyMap and modified it to present my pattern. Okay - on startup I now again get above mentioned error message. But as I see it this whole pattern toolbox thingy does not work. Probably I have to dig into how the MTS couples the single profiles into a single profile and do that myself, thereby creating the correct toolbox entry.

"§$%&/(

q.