Author Topic: ShapeScript for BPMN activity  (Read 16474 times)

Viking

  • EA User
  • **
  • Posts: 453
  • Karma: +2/-2
    • View Profile
ShapeScript for BPMN activity
« on: February 11, 2017, 12:12:58 am »
Hello,

I want to display a process step as BMPN activity in one diagram and as Achimate process step in another with shape scripts (of if EA provides something else in the meantime than somethings else).

I learned that this is possible. I am able to create simple shape scripts. But the BPMN activite can be shown in many different ways and I do not have an idea how to implement this.

Suggestions are very welcome. Please do not discuss if this makes sense or not.

Thank you in advance, V.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: ShapeScript for BPMN activity
« Reply #1 on: February 11, 2017, 12:26:19 am »
You are another one looking for schizophrenic element (can't remember who was the other guy starting a longish discussion here). An element is what it is. Either one thing or another. I guess you are just tackling your problem from the wrong side here.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: ShapeScript for BPMN activity
« Reply #2 on: February 11, 2017, 01:17:39 am »

Viking

  • EA User
  • **
  • Posts: 453
  • Karma: +2/-2
    • View Profile
Re: ShapeScript for BPMN activity
« Reply #3 on: February 11, 2017, 01:32:50 am »
You are another one looking for schizophrenic element (can't remember who was the other guy starting a longish discussion here). An element is what it is. Either one thing or another. I guess you are just tackling your problem from the wrong side here. q.

An element is an element and a notation is a notation. A notation just shows an element with a specific shape. An element could be shown by a circle or by a rectangle. It's still the same element.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: ShapeScript for BPMN activity
« Reply #4 on: February 11, 2017, 02:04:17 am »

Viking

  • EA User
  • **
  • Posts: 453
  • Karma: +2/-2
    • View Profile
Re: ShapeScript for BPMN activity
« Reply #5 on: February 11, 2017, 05:45:01 am »
It appears that it was you: http://sparxsystems.com/forums/smf/index.php/topic,37317.msg234563.html#msg234563
I'm out here. q.

It does not appear, that it is me. It is me. That's why I did not want you to start the discussion.

While I told you my arguments, you did not tell me your arguments. So why did you start the discussion again?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: ShapeScript for BPMN activity
« Reply #6 on: February 11, 2017, 08:17:06 am »
Aliens are so funny - Can someone please turn on Country music?

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8083
  • Karma: +118/-20
    • View Profile
Re: ShapeScript for BPMN activity
« Reply #7 on: February 13, 2017, 09:15:33 am »
Here's a starting point for creating the pictures you want.

Code: [Select]
shape main
{
layouttype="border";
if(hasproperty("diagram.mdgtype", "ArchiMate3::Application"))
{
AddSubShape("ProcessStep","center");
}
else if(hasproperty("diagram.mdgtype", "BPMN2.0::Business Process"))
{
AddSubShape("Activity","center");
}
else
{
AddSubShape("DiagramType","center");
}

shape ProcessStep
{
ellipse(0,0,100,100);
println("#name#");
}

shape Activity
{
roundrect(0,0,100,100,10,10);
println("#name#");
}

shape DiagramType
{
rectangle(0,0,100,100);
println("#diagram.mdgtype#");
println("#diagram.stereotype#");
println("#diagram.type#");
}
}


Glassboy

  • EA Practitioner
  • ***
  • Posts: 1367
  • Karma: +112/-75
    • View Profile
Re: ShapeScript for BPMN activity
« Reply #8 on: February 13, 2017, 10:43:30 am »
Aliens are so funny - Can someone please turn on Country music?

Not Country but may be a little bit of psychobilly? https://www.youtube.com/watch?v=7I8pC_DOXC4

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: ShapeScript for BPMN activity
« Reply #9 on: February 13, 2017, 05:59:09 pm »

Viking

  • EA User
  • **
  • Posts: 453
  • Karma: +2/-2
    • View Profile
Re: ShapeScript for BPMN activity
« Reply #10 on: February 13, 2017, 07:27:14 pm »
Aliens are so funny - Can someone please turn on Country music?

Not Country but may be a little bit of psychobilly? https://www.youtube.com/watch?v=7I8pC_DOXC4

I rather was after this: https://www.youtube.com/watch?v=aTe0MjAZvMU

q.

Dear qwerty, dear classboy, Thank you very much for these arguments. Regards V

Viking

  • EA User
  • **
  • Posts: 453
  • Karma: +2/-2
    • View Profile
Re: ShapeScript for BPMN activity
« Reply #11 on: February 13, 2017, 07:31:34 pm »

Viking

  • EA User
  • **
  • Posts: 453
  • Karma: +2/-2
    • View Profile
Re: ShapeScript for BPMN activity
« Reply #12 on: February 13, 2017, 07:32:36 pm »
Here's a starting point for creating the pictures you want.

Code: [Select]
shape main
{
layouttype="border";
if(hasproperty("diagram.mdgtype", "ArchiMate3::Application"))
{
AddSubShape("ProcessStep","center");
}
else if(hasproperty("diagram.mdgtype", "BPMN2.0::Business Process"))
{
AddSubShape("Activity","center");
}
else
{
AddSubShape("DiagramType","center");
}

shape ProcessStep
{
ellipse(0,0,100,100);
println("#name#");
}

shape Activity
{
roundrect(0,0,100,100,10,10);
println("#name#");
}

shape DiagramType
{
rectangle(0,0,100,100);
println("#diagram.mdgtype#");
println("#diagram.stereotype#");
println("#diagram.type#");
}
}

Dear Simon, Thank you. This is in the right direction. I am looking for a property, which tells the scripts, that the BPMN-element is for example executed automatically or by hand (and all the other possible properties). So the shape-script should not only decide, that the element is a BPMN activity. It should further identify, which kind of BPMN activity it is and than using the correct BMPN activity shape (e.g. gear-wheels for an automated service or a hand for manually).
« Last Edit: February 13, 2017, 09:24:05 pm by Viking »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8083
  • Karma: +118/-20
    • View Profile
Re: ShapeScript for BPMN activity
« Reply #13 on: February 14, 2017, 08:32:48 am »
Dear Simon, Thank you. This is in the right direction. I am looking for a property, which tells the scripts, that the BPMN-element is for example executed automatically or by hand (and all the other possible properties). So the shape-script should not only decide, that the element is a BPMN activity. It should further identify, which kind of BPMN activity it is and than using the correct BMPN activity shape (e.g. gear-wheels for an automated service or a hand for manually).
Replace the Activity subshape with the contents of the script Geert referenced. Replace the ProcessStep subshape with the appropriate script from the same repository.

Viking

  • EA User
  • **
  • Posts: 453
  • Karma: +2/-2
    • View Profile
Re: ShapeScript for BPMN activity
« Reply #14 on: February 15, 2017, 06:57:35 pm »
Dear Simon, Thank you. This is in the right direction. I am looking for a property, which tells the scripts, that the BPMN-element is for example executed automatically or by hand (and all the other possible properties). So the shape-script should not only decide, that the element is a BPMN activity. It should further identify, which kind of BPMN activity it is and than using the correct BMPN activity shape (e.g. gear-wheels for an automated service or a hand for manually).
Replace the Activity subshape with the contents of the script Geert referenced. Replace the ProcessStep subshape with the appropriate script from the same repository.
Hello Simon,
Thank you very much.
The result of my attempt was not as expected. That's why I tried the plain scrpts of Geert. I tried Enterprise-Architect-Shapescript-Library / Archimate2 / ArchiMate_BusinessProcess.shapeScript. It does not show the process icon on the top right (even not in the preview). I tried the same for BPMN Activity and it looked also differently to the original one.

Following questions arose:
(1) The scripts from Geert seem to be extracted from EA. Why are the icons not shown?
(2) Within the properties of an element I can assign several stereotypes. What is the impact of conflicting stereotypes?
(3) What is the impact of BaseClass on the UML-types editor to the ShapeScript?

Many thanks in advance, V,
« Last Edit: February 15, 2017, 09:19:33 pm by Viking »