Author Topic: Alternate image in MDG  (Read 13122 times)

beginner

  • Guest
Re: Alternate image in MDG
« Reply #15 on: June 29, 2010, 04:50:58 pm »
It seems you need some kind of automation to automate automation.

b.

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1309
  • Karma: +120/-10
  • Its the results that count
    • View Profile
Re: Alternate image in MDG
« Reply #16 on: July 02, 2010, 07:23:10 am »
Okay after a few days of trying different things to get alternative images to work from a stereo type in a profile. I've exhausted various options and the only things that seems to work is as described in my previous post. So I decided to raise the alternative images behaviour in profiles as a bug with Sparx Systems and see if they can fix it so you only have to deploy the MDG file once.
Happy to help
:)

ecourt

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Alternate image in MDG
« Reply #17 on: July 07, 2010, 07:32:55 pm »
Hi,

I have come across a similar problem with alternative images.  I found that if when creating the MDG technology file you select the images used in the shape scripts when you get to the images dialogue, that if you just copy the MDG xml file into the MDGTechnologies directory it works.  I have had some slightly odd behaviour is I imported the tehcnology and put it into thedirectory so now just copy the xml files into the directory.

Emma

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8595
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Alternate image in MDG
« Reply #18 on: July 08, 2010, 10:25:11 am »
Can you elaborate on that please Emma?

I'm not sure I understand the point you are making...

TIA,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1309
  • Karma: +120/-10
  • Its the results that count
    • View Profile
Re: Alternate image in MDG
« Reply #19 on: July 13, 2010, 07:17:37 am »
Sparx Systems have come back to me regarding the images in MDG. Here is their response with suggested work around;

Quote
Thanks for your note.

There are two ways to deploy a technology:
1. Model-based deployment (import into Resources view) imports images but you can't use a number of features of technologies including custom toolboxes.

2. File-based deployment (using the Settings > MDG Technologies command) doesn't import images.

We do not recommend using both deployment methods simultaneously as the imported resources (e.g. stereotype definitions) will interfere with the external resources.

The better solution is to export images as reference data (Tools > Export Reference Data) and import the reference data into the target databases, and use the file-based deployment of the technology.  You may also consider applying the images using a shape script:

shape main
{
      layouttype="border";
      image("image.bmp",0,0,100,100);
      addsubshape("name","S");

      shape name
      {
            h_align="center";
            print("#NAME#");
      }
}

See the "Shape Scripts" topic in EA help for details.

I hope that helps.  If you have further questions or issues please let us know.

So it looks like my work around of deploying two different ways is not recommend. It doesn't look like they are going to fix the problem either. :(
Happy to help
:)

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1309
  • Karma: +120/-10
  • Its the results that count
    • View Profile
Re: Alternate image in MDG
« Reply #20 on: July 28, 2010, 09:34:31 am »
Just to clarify something about using images in shapescripts mentioned in the previous post, incase like me you thought you could get away with just one MDG Technology file. You still need to import the images into the model otherwise it doesn't work even though you can export the images into the MDG Technology file.   :(

If you don't you end up with a grey box indicating its referencing an image that doesn't exist in the model.

Here is the description of using the image() function from the help
Quote
Draws the image that has the name imageId in the Image Manager.

Note:
 
The image must exist within the model in which the stereotype is used. If it does not already exist in the model, you must import it as reference data.
Happy to help
:)

jakob

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Re: Alternate image in MDG
« Reply #21 on: April 28, 2011, 06:12:52 am »
Quote
As far as I know there are two approaches to applying alternative images to stereotypes.
a) Use shape script as mention in previous lists.
b) apply the alternative image to the stereo type on the profile diagram.

I think you are after the easiest option which is option b)
On your profile diagram where you inherit from an existing meta class you need apply the alternative image (ctrl+shft+w) to the new stereotype you are creating. Then when you save as profile ensure you have the alternative image tick box selected.

I've used both techniques on past versions of EA. Although haven't tried it with V7.5 or 8.0.

I like option b) but this option seems not to work if you use more than one diagram to define your profile: When you export your Profile by right clicking on the profile package and clicking on Save Package as Profile... the images won't be included.  :(