Book a Demo

Author Topic: UML Types for Standard BPMN 2.0 stereotypes  (Read 11663 times)

E.Eckstein

  • EA User
  • **
  • Posts: 35
  • Karma: +0/-0
    • View Profile
UML Types for Standard BPMN 2.0 stereotypes
« on: July 08, 2015, 09:18:51 pm »
Hi there,

i got problems with setting shape scripts for standard stereotypes of a BPMN2.0 Diagram.

What I want is quite simple (Gateways as example should get another color, should be smaller etc. - should be easy to achieve with shape scripts - at least this is what I tought)

In UML Types (Settings - UML Types) I want to override the shape for Gateways e.g.

I tryed Stereotype: "Gateway" as well as "BPMN2.0::Gateway" and also "UML:Gateway". (Base class i nearly tried every one that makes scence, as I think)
Unfortunately any of those one's work (I think the shapescript is alright)

Is this even possible, or will I have to implement own stereotypes for this to achieve?

Regards,
Eric

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: UML Types for Standard BPMN 2.0 stereotypes
« Reply #1 on: July 09, 2015, 01:53:54 am »
BPMN2.0::Gateway should work. You need to call DrawParentShape inside the shape script.

q.

E.Eckstein

  • EA User
  • **
  • Posts: 35
  • Karma: +0/-0
    • View Profile
Re: UML Types for Standard BPMN 2.0 stereotypes
« Reply #2 on: July 09, 2015, 04:01:25 pm »
Hi qwerty,

thank you for your response.
I tried as you suggested with following combinations:
Stereotype: "BPMN2.0::Gateway"
Group name: ""
Base Class : "<all>" / "event"
Notes: ""

My shapescript looks as followed:

shape main
{
      SetFillColor(240,0,0);
      DrawParentShape();
      Rectangle(10,10,50,50);
}
I just added the Rectangle to see directly if some shapes are affected - but this doesn't affect any kind of Gateway that I place into the diagram.

Am I doing something wrong, or do I have to make some changes in the settings probably?

Regards,
Eric


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: UML Types for Standard BPMN 2.0 stereotypes
« Reply #3 on: July 09, 2015, 04:32:17 pm »
Eric,

It may be that you can only extend the BPMN stereotypes with your own stereotypes, not replace a BPMN stereotype with yours.

(unless you modify the MDG technology file for BPMN I guess)

Geert

E.Eckstein

  • EA User
  • **
  • Posts: 35
  • Karma: +0/-0
    • View Profile
Re: UML Types for Standard BPMN 2.0 stereotypes
« Reply #4 on: July 09, 2015, 04:36:06 pm »
Hi there,

once again me. In the EA-User Guide i found a page named "Create Stereotypes Extending non-UML Objects".
There is expained how to extend those elements - with huge effort on creating a profil and so on and so forth.

-> Do I really have to create a own profile, extend those BPMN sterotypes I want to adjust and provide this to our users?

I mean, as qwerty wrote, I suggest it's possible to change the "standard" shape of those elements, without doing so...

Regards,
Eric

E.Eckstein

  • EA User
  • **
  • Posts: 35
  • Karma: +0/-0
    • View Profile
Re: UML Types for Standard BPMN 2.0 stereotypes
« Reply #5 on: July 09, 2015, 05:23:23 pm »
Quote
Eric,

It may be that you can only extend the BPMN stereotypes with your own stereotypes, not replace a BPMN stereotype with yours.

(unless you modify the MDG technology file for BPMN I guess)

Geert

Hi Geert,

okay, I was afraid of this, but if there is no other way, I'll have to do it this way.

Thanks for your reply!

Regards,
Eric

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: UML Types for Standard BPMN 2.0 stereotypes
« Reply #6 on: July 09, 2015, 06:35:27 pm »
Quote
-> Do I really have to create a own profile, extend those BPMN sterotypes I want to adjust and provide this to our users?
Yes, you need to do that. Alternatively you can create your own stereotype which mimics the one you want. But then they are no longer related in any way.

q.

E.Eckstein

  • EA User
  • **
  • Posts: 35
  • Karma: +0/-0
    • View Profile
Re: UML Types for Standard BPMN 2.0 stereotypes
« Reply #7 on: July 10, 2015, 05:29:17 pm »
Hi,

okay. So I'll just going to extend those stereotypes I need.

Thanks for your help guys. I really appreciate your help! :-*

Regards,
Eric

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: UML Types for Standard BPMN 2.0 stereotypes
« Reply #8 on: July 10, 2015, 09:00:06 pm »
The following article might help you to get at start: http://community.sparxsystems.com/tutorials/552-24intro-to-creating-a-mdg-file

q.

E.Eckstein

  • EA User
  • **
  • Posts: 35
  • Karma: +0/-0
    • View Profile
Re: UML Types for Standard BPMN 2.0 stereotypes
« Reply #9 on: July 14, 2015, 04:30:34 pm »
Quote
The following article might help you to get at start: http://community.sparxsystems.com/tutorials/552-24intro-to-creating-a-mdg-file

q.

Hi Qwerty,

thanks for your help with this. I allready got most things done, but i got stuck again.
I extended sterotypes for the bpmn2.0 Activity, all kind of gateways etc. That's working fine.

But when I try to extend Events (Start, Intermediate and End) I neither can drag and drop the items from the toolbox nore can I see the inherited Icon of their "parentshape" in the toolbox.

You know if there are any issues with those items? Because I've done it the same way as I did it with the other sterotypes and for them it works fine... :-/

Regards,
Eric
« Last Edit: July 14, 2015, 04:31:30 pm by ericeckstein »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: UML Types for Standard BPMN 2.0 stereotypes
« Reply #10 on: July 14, 2015, 05:43:27 pm »
Not every meta type is in the drop down so you need to type some manually. In those foggy areas you need to ask exactly which constellation you need (as you did for Start, Intermediate and End Events). The help has a list somewhere which might be more complete (don't ask me where  :-/). You can also either wait one or two days for one of the Sparxians to answer your question here (they know all those details by heart). If there is no reply you can send a mail to Sparx support directly. I'm pretty sure they will be able to help you directly.

q.

E.Eckstein

  • EA User
  • **
  • Posts: 35
  • Karma: +0/-0
    • View Profile
Re: UML Types for Standard BPMN 2.0 stereotypes
« Reply #11 on: July 14, 2015, 06:48:21 pm »
Hi Qwerty,

I will wait here another few days for a reply, maybe someone knows how to achieve what I try to do.

To make my problem easier to understand here is a "more precise" explanation:

I created three <<profile>> packages. One for the  (1)definition of diagramtypes for the mdg package, another for the (2) diagram definition itself and one for the (3) toolbox.

So the first package looks like this:

(1): Classdiagram with the name of my custom diagramtype
There is a <<metaclass> Diagram_Analysis and a <<stereotype>> MyDiagram which extends from the first one. (So this one provides my diagramtype for the mdg package)
- this part is fine working.

(2):
The second one is UML profile. It defines some customized (generalized) classes like my own "<<sterotype>>ExlusiveGateway" which generalizes from <<stereotype>>BMPN2.0::Gateway. (I added those ones with the Metaclass item from the toolbox, and this is working fine for gateways and activities.

-> I also have there the <<stereotype>>BPMN2.0::StartEvent e.g.
My own <<stereotype>>MyStartEvent generalizes from this stereotype.

(3):
In the diagram there is the <<metaclass>>ToolboxPage and some <<stereotypes>> like "Elements", "Events", "Gateways" etc.
In those there are attributes defined like Prozessmodellierung::ExclusiveGateway :int = MyExclusiveGateway.

So what works and what doesnt:

- Elements like Activities and Gateways which I extended work fine, I can drag and drop them from my toolbox in my own diagram type.
- I can also set other styles for those elements in the "UML types".

- My extended Events though show just those big brackets <<>> like from a stereotype, but not any picture. If I drag & drop them from the toolbox nothing is happening. The diagram remains empty, and nothing is added into the package.
 
- What's interessting to notice: While I can add e.g. standard BPMN2.0::Gateways from the context menu, my diagram won't take any event from the bpmn2.0 elements.

I appreciate any help with this issue,

Best Regards,
Eric


PS: This is how my (Save as profile) .xml looks like:

Code: [Select]
<Stereotype name="ExclusiveGateway" notes="" cx="121" cy="70" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0" generalizes="BPMN2.0::Gateway" baseStereotypes="BPMN2.0::Gateway"/>
<Stereotype name="InclusiveGateway" notes="" cx="121" cy="70" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0" generalizes="BPMN2.0::Gateway" baseStereotypes="BPMN2.0::Gateway"/>
<Stereotype name="ParallelGateway" notes="" cx="121" cy="70" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0" generalizes="BPMN2.0::Gateway" baseStereotypes="BPMN2.0::Gateway"/>
<Stereotype name="CustomActivity" notes="" cx="121" cy="70" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0" generalizes="BPMN2.0::Activity" baseStereotypes="BPMN2.0::Activity"/>
<Stereotype name="MyEndEvent" notes="" cx="121" cy="70" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0" generalizes="BPMN2.0::EndEvent" baseStereotypes="BPMN2.0::EndEvent"/>
<Stereotype name="MyIntermediateEvent" notes="" cx="163" cy="70" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0" generalizes="BPMN2.0::IntermediateEvent" baseStereotypes="BPMN2.0::IntermediateEvent"/>
<Stereotype name="MyStartEvent" notes="" cx="121" cy="70" bgcolor="-1" fontcolor="-1" bordercolor="-1" borderwidth="-1" hideicon="0" generalizes="BPMN2.0::StartEvent" baseStereotypes="BPMN2.0::StartEvent"/>
You see there is no difference at all between the events and other elements, so I don't get why it is not working.
« Last Edit: July 14, 2015, 06:57:30 pm by ericeckstein »

E.Eckstein

  • EA User
  • **
  • Posts: 35
  • Karma: +0/-0
    • View Profile
Re: UML Types for Standard BPMN 2.0 stereotypes
« Reply #12 on: July 16, 2015, 11:29:24 pm »
Okay guys,

after days of trying different stuff I'll post my own solution in case somebody will find this topic with the same requirement:

The "problem" is that BPMN2.0 works with hidden subtoolboxes, so to make this work you will have to do some "adjustments".
In you UML-profile:
1.)  you will need to extend your own event-sterotype (MyStartEvent) from <<metaclass>> Event (the standard UML::Event).
2.) Your extended stereotype will need to generalize the BPMN2.0::StartEvent sterotype.

In the Toolbox profile:
3.) You will have to add your own sterotype in your toolbox-submenu with a certain notation:
NameOfYourProfil::YourEventSterotypename(UML::Event) e.g. Prozessmodel::MyStartEvent(UML::Event)

This will make your item appear in the toolbox and be drag&drop-able into your custom diagram.

Well there is an issue with the icon of your custom StartEvent. It will display the icon of the standard uml event not of BPMN2.0::StartEvent. However, I wasn't able to get this done without overwriting the tagged value of the event:

In your uml-profile:
4. Add an attribute to your MyStartEvent stereotype called "icon". As standardvalue paste a path to a 16x16 bitmap image. (I think you'll be able to create a one looking like the BPMN2.0::StartEvent in no time).
The EA help tells that you should take the color "lightgrey" as "transparent" color (rgb: 192,192,192).
That's it :) Not that hard, but without the information it's quite much trying.

Good luck,
Regards,
Eric

Viking

  • EA User
  • **
  • Posts: 478
  • Karma: +2/-2
    • View Profile
Re: UML Types for Standard BPMN 2.0 stereotypes
« Reply #13 on: March 15, 2017, 03:51:09 am »
1.) You will need to extend your own event-sterotype (MyStartEvent) from <<metaclass>> Event (the standard UML::Event).
2.) Your extended stereotype will need to generalize the BPMN2.0::StartEvent sterotype.

Hope this thread is still read by the participants.

My question is, if I generalize my own MyStartEvent stereotype from BPMN2.0::StartEvent sterotype, why do I need to extend my own event-sterotype (MyStartEvent) from <<metaclass>> Event ? Don't I inherit the extension from the generalized StartEvent ?

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: UML Types for Standard BPMN 2.0 stereotypes
« Reply #14 on: March 20, 2017, 11:58:21 am »
My question is, if I generalize my own MyStartEvent stereotype from BPMN2.0::StartEvent sterotype, why do I need to extend my own event-sterotype (MyStartEvent) from <<metaclass>> Event ? Don't I inherit the extension from the generalized StartEvent ?

BPMN2.0::StartEvent extends two metaclasses, Event and ObjectNode. EA needs to know which one you want to create.
The Sparx Team
[email protected]