Book a Demo

Author Topic: Graphical embelishment of an element  (Read 10712 times)

OpenIT Solutions

  • EA User
  • **
  • Posts: 555
  • Karma: +9/-1
    • View Profile
Graphical embelishment of an element
« on: December 16, 2011, 09:26:58 pm »
Hi All,

Does anyone know where to look in an MDG file for the xml that specifies which embelishment to add to a graphical element (say Activity) when a specific tagged value is picked ????

I'm assuming its in the BPMN v2 MDG file somewhere as an embelishment is added to Actvities if various tagged values (such as TaskType) are selected.

Any help pointers appreciated !

Regards,

Jon.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Graphical embelishment of an element
« Reply #1 on: December 19, 2011, 09:05:29 am »
It's all done in the shape script, which is in the XML file but encoded.
The Sparx Team
[email protected]

OpenIT Solutions

  • EA User
  • **
  • Posts: 555
  • Karma: +9/-1
    • View Profile
Re: Graphical embelishment of an element
« Reply #2 on: December 19, 2011, 11:44:21 pm »
Thanks for the feedback. I gone through the help files on shapscripts - i've been able to apply a shape based upon a stereotype, but the hasTag method doesn't appear to work for me - i suspect it may be because the element in question is an Activity on a BPMN diagram, the BPMN MDG already has an eashapescript applied to activities to add "decorations" when various tagged values are picked.

Am i right in thinking that you can't apply multiple shapescripts to a single element ? If so is there a way to decode the shapescript in the MDG file so i can extended it for my purposes ?

Regards,

Jon.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Graphical embelishment of an element
« Reply #3 on: December 20, 2011, 02:06:31 am »
There's only room for a single script. Inside the script you need to decide what to do.

Regarding decode: First stage is base64 (notepad++ has plugins/mime tools/decode base64; copy the string to a new file buffer).  You need to unzip the result afterwards (you can save the decode and unzip externally). Inside is a str.dat with the shape script.

q.
« Last Edit: December 20, 2011, 02:11:23 am by qwerty »

OpenIT Solutions

  • EA User
  • **
  • Posts: 555
  • Karma: +9/-1
    • View Profile
Re: Graphical embelishment of an element
« Reply #4 on: December 20, 2011, 11:48:11 pm »
Thanks for the feedback, ill give notepad++

OpenIT Solutions

  • EA User
  • **
  • Posts: 555
  • Karma: +9/-1
    • View Profile
Re: Graphical embelishment of an element
« Reply #5 on: December 23, 2011, 01:22:52 am »
Hoping you can help a bit further - i've got notepad++, installed the mime plugin so can decode to base 64....how do i put the output in a new "file buffer" and unzip it ?

Apologies - not v technical, so need some help.

Thanks,

Jon.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Graphical embelishment of an element
« Reply #6 on: December 23, 2011, 06:22:55 am »
Quite simple:
- Select the base64 stuff including the last equal sign
- create a new file (ctrl-n)
- paste it
- select all
- invoke the decode
-> now it should look quite binary starting with PK...
- simply save as temp.zip to desktop
- unzip the file using pkzip

q.

OpenIT Solutions

  • EA User
  • **
  • Posts: 555
  • Karma: +9/-1
    • View Profile
Re: Graphical embelishment of an element
« Reply #7 on: December 23, 2011, 09:24:36 pm »
Many thanks..i have my shape script now to edit....final question on this - what are the steps for encoding to add back into an MDG file ?

Appreciate any help,

Regards,

Jon.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Graphical embelishment of an element
« Reply #8 on: December 28, 2011, 09:02:58 am »
Quote
final question on this - what are the steps for encoding to add back into an MDG file ?
Probably the simplest way would be to create a profile with a stereotype that has your shape script. You can then copy-and-paste between the profile and technology XML files.
« Last Edit: December 28, 2011, 09:03:33 am by KP »
The Sparx Team
[email protected]

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Graphical embelishment of an element
« Reply #9 on: December 28, 2011, 09:42:04 pm »
Or just the way show before vice versa:

- Create a file from the shape script and call it str.dat
- Zip that file
- Open it with notepad++
- Use Pugins/Mime/Base64 Encode
- Replace the resulting string in your MDG
(you can insert line breaks as you like to leave it as it is)

q.
« Last Edit: December 28, 2011, 09:43:09 pm by qwerty »