Blog Post

Import Model Patterns through Add-in

In this article we will brief how to share a model pattern to a large group. In general model pattern can be included along with MDG definition file and can be used. There are certain limitations in this approach while importing MDG to a shared model and many people use it. To overcome we decided to create an external program and to refer Pattern and share the installer to users.

Assumption:

The reader has a fairly good understanding of creating an Enterprise Architect Addin or writing an application that can use Enterprise Architect. Refer to below references if you need more information on these

  • To create an Addin from scratch refer this link 
  • Download Skeleton for creating an Add-In using the C# Language from this link

Steps to follow:

  • Create & Save custom pattern as XML (Export as XMI)
  • Create MDG file
  • Create an external project
  • Reuse Patterns from Model Wizard Window

Create MDG File:

Create MDG file for patterns by copying the below syntax

<?xml version=”1.0″ encoding=”windows-1252″?>

<MDG.Technology version=”1.0″><Documentation id=”SSIN” name=”Sparx Technology” version=”1.0.0″ notes=”Sparx Systems India Patterns Sample”/><Logo><Image type=”bitmap” xmlns:dt=”urn:schemas-microsoft-com:datatypes” dt:dt=”bin.base64″>

<MDG.Technology>

<ModelTemplates>

<Model name=”Motivation Layer” description=”Create Motivation Layer.” location=”Motivation Layer.xml” default=”” icon=”34″ filter=””/>

<Model name=”Business Layer” description=”Create Business Layer.” location=”Business Layer.xml” default=”” icon=”34″ filter=””/>

</ModelTemplates>

</MDG.Technology>

Create an external project

Create an external program. Add the XMI and MDG Definition as resources. Use EA_OnInitializeTechnologies to pass an MDG Technology to Enterprise Architect for loading. This event occurs on Enterprise Architect startup. Return your technology XML to this function and Enterprise Architect loads and enables it. Refer the below code

#region MDG Load

//Load MDG Files
public object EA_OnInitializeTechnologies(EA.Repository Repository)
{

string sTechnologyXML = Properties.Resources.Sparx_Technology;
return sTechnologyXML;

}

#endregion

Use EA_OnRetrieveModelTemplate event occurs when a user executes the Add a New Model Using Wizard command. Below code refers to Motivation Layer & Business Layer XMl referred in resources of the external project.

public virtual string EA_OnRetrieveModelTemplate(EA.Repository Repository,string sLocation)
{

string sTemplate = “”;
try
{

switch (sLocation)
{

case “Motivation Layer.xml”:
sTemplate = global::SparxAddin.Properties.Resources.Motivation_Layer;
break;
case “Business Layer.xml”:
sTemplate = global::SparxAddin.Properties.Resources.Business_Layer;
break;

}

}
catch (Exception ex)
{
}
return sTemplate;

}

Reuse Patterns from Model Wizard Window

Install the Add-In. After installation, Click the Specialize (Extend in Enterprise Architect 13.5) | Add-In | Manage to verify whether the Add-In installed properly. Create a model try to add the Model Wizard.

Note: To display custom patterns add technology to custom perspective or click show all perspectives

14 Comments

  1. When you’re trying to spy on someone’s phone, you need to make sure the software isn’t found by them once it’s installed.

    Reply
  2. Wow, amazing weblog structure! How lengthy have you ever
    been running a blog for? you made blogging look easy.
    The overall look of your web site is great,
    as well as the content material! You can see similar here
    najlepszy sklep

    Reply
  3. Wow, fantastic blog format! How long have you ever been running a blog for?
    you made running a blog look easy. The whole look of your website is fantastic, as neatly as the content
    material! You can see similar here e-commerce

    Reply
  4. I used to be able to find good advice from your blog
    posts. I saw similar here: Sklep internetowy

    Reply
  5. Wow, fantastic blog structure! How lengthy have
    you been blogging for? you made running a blog look easy.

    The full look of your site is wonderful, let alone
    the content! You can see similar here e-commerce

    Reply
  6. Wow, marvelous weblog format! How lengthy have you
    ever been blogging for? you made blogging look easy.

    The total glance of your website is fantastic, as well as
    the content! You can see similar here e-commerce

    Reply
  7. It’s very interesting! If you need help, look here: ARA Agency

    Reply
  8. Thanks for sharing. I read many of your blog posts, cool, your blog is very good.

    Reply
  9. Hi! Do you know if they make any plugins to help with SEO?
    I’m trying to get my site to rank for some targeted keywords but
    I’m not seeing very good results. If you know of any
    please share. Thanks! You can read similar article here: AA List

    Reply
  10. Hello! Do you know if they make any plugins to
    help with Search Engine Optimization? I’m trying to get my blog to rank for some targeted keywords but I’m not seeing very good
    results. If you know of any please share. Appreciate it!

    I saw similar article here: Backlink Building

    Reply
  11. Hey! Do you know if they make any plugins to help
    with SEO? I’m trying to get my blog to rank for
    some targeted keywords but I’m not seeing very
    good success. If you know of any please share. Appreciate it!
    You can read similar text here: GSA Verified List

    Reply
  12. Wow, awesome blog structure! How long have you ever been running a blog for?
    you made running a blog look easy. The overall look
    of your website is wonderful, let alone the content!
    You can see similar here najlepszy sklep

    Reply
  13. Can you be more specific about the content of your article? After reading it, I still have some doubts. Hope you can help me.

    Reply
  14. It’s very interesting! If you need help, look here: link building

    Reply

Leave a Comment

*