Author Topic: Dockable property in shape script  (Read 6398 times)

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Dockable property in shape script
« on: January 16, 2014, 05:52:00 am »
When I try to assign a value (off or standard as suggested by the help) the compiler claims
Quote
Error: Invalid value for orientation. Acceptable values are: "nw", "n", "ne", "e", "se", "s", "sw", "w", "nw",  and "center"'off

Has anybody at Sparx tested this shape script in any way? I do not expect an answer to that question >:(

q.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: Dockable property in shape script
« Reply #1 on: January 16, 2014, 10:08:16 am »
Yes, it's used in the BPMN pool/lane scripts.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Dockable property in shape script
« Reply #2 on: January 16, 2014, 10:06:08 pm »
So why do I get this strange error message? I even can't save the script:
Code: [Select]
shape main {
      dockable = "off";
}
The "no-op" dockable = "standard" however will pass the compilation.

q.

OpenIT Solutions

  • EA User
  • **
  • Posts: 555
  • Karma: +9/-1
    • View Profile
Re: Dockable property in shape script
« Reply #3 on: January 16, 2014, 11:01:04 pm »
Want help with this qwerty - but could be a useful tip for your shapescript book - when i was trying to get to grips with shapescripts - i started a new project then imported the BPMN MDG. This gave my access to the scripts via Setting->UML Types-Stereotypes. So i could for example view the shapescript for Pools/Lanes/Actiivties etc to figure out how things worked and of course copy and paste sections of a script into a new stereotype/script easily...

Regards,

Jon.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Dockable property in shape script
« Reply #4 on: January 17, 2014, 12:36:23 am »
Thanks, Jon. That's definitely a good idea. Could have been from me ;-)

Nevertheless I will for a moment go on with a wiped brain, not influenced by any tricks which were coded by Sparx. Currently I feel like a beta tester. The help does in many parts not match reality (don't want to blame Roy who's doing a good job, but it looks as he's the only one working on the docs). Next week I'll dive into the scripts of the existing MDGs.

q.

stao

  • EA User
  • **
  • Posts: 137
  • Karma: +0/-0
    • View Profile
Re: Dockable property in shape script
« Reply #5 on: January 17, 2014, 05:11:26 am »
Quote
Want help with this qwerty - but could be a useful tip for your shapescript book - when i was trying to get to grips with shapescripts - i started a new project then imported the BPMN MDG. This gave my access to the scripts via Setting->UML Types-Stereotypes. So i could for example view the shapescript for Pools/Lanes/Actiivties etc to figure out how things worked and of course copy and paste sections of a script into a new stereotype/script easily...

Regards,

Jon.


Hi Jon,

how do you import the BPMN Mdg Tech.?

Neither Extensions/Import/Other Tools nor Tools/MDG Technology Import does the trick for me. I tried it with the File C:\Program Files (x86)\Sparx Systems\EA\MDGTechnologies\BPMN 2.0 Technology.xml

What am i doing wrong?


qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Dockable property in shape script
« Reply #6 on: January 17, 2014, 05:18:34 am »
That's another black magic. You can't reverse the XML. To see the script you need to decode some base64 inside which then offers a zip with the script.

Of course I will not do that since it will certainly breach some license agreement. But I have a nice glas bowl here.

q.
« Last Edit: January 17, 2014, 05:19:30 am by qwerty »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Dockable property in shape script
« Reply #7 on: January 18, 2014, 08:29:36 am »
stao,
actually you can do it (officially) the following way:

-Project/Resources
-MDG Technologies/Context Import Technologie
-Choose the one from the EA Program folder/MDG...

Now you can see the stereotypes for the MDG under Settings/UML. Just scroll through the list and you will find the shape script enabled ones.

q.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Dockable property in shape script
« Reply #8 on: January 19, 2014, 04:40:55 am »
Here's a little Perl script which spits out the scripts from the exported reference data:

Code: [Select]
use strict;
no strict 'refs';

use XML::Parser;

my $p1 = new XML::Parser(Style => 'Tree');
my $file = "<path to the exported stereotypes reference file";

my @tree = $p1->parsefile($file); # parse that stuff
@tree = @{$tree[0][1][4]};
for my $datarow (@tree) {
  next unless (ref($datarow) eq "ARRAY");
  for my $column (@{$datarow}) {
    next unless ref($column) eq "ARRAY";
    my %hash = %{@{$column}[0]};
    if ($hash{'name'} =~ /(Style|Stereotype)/) { print $hash{'value'} . "\n"; }
  }
}

q.