Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Viking

Pages: 1 ... 3 4 [5] 6 7 ... 16
61
Thank you very much for your answers !

62
Hi,

We need to use the Microsoft Script Debugger. The support says that this product is "depricated". That's why they are not allowed to install it. Is there an alternative available?

Many thanks in advance for your answers, Viking

63
No. There is no AND. There is no OR. Look at Simon's example how to code a work around for the AND. It's simple Boolean algebra and use of copy and paste.q.

We are using AND and it works as intended :)

Yes, there is no OR or XOR in the way we need it.

Given that the OP is trying to do something that everyone advised him not to do, I think this whole conversation is down the rabbit hole anyway.  :-)

I did not know that everybody told me. Many thanks for telling me.

64
It has been said more than once here, that there is no OR. There are also no functions/procedures. There is just COPY and PASTE. The way you do it is the only way. Capisce? q.

Many thanks, Thomas.

65
Why do you use Metaclass from the toolbox?
All I ever needed to do what create stereotypes, and then link them to a metaclass using the profile helper. Geert
We thought that we need a metaclass. But that was a mistake. Trial and error ...

66
What you get is a stereotype that is based on a certain metaclass. If you don't override any of the properties of the metaclass then your stereotype will behave exactly like the "plain" metaclass. So in that way you should look at it as a "generalization" in class diagram terms.
I honestly don't understand your confusion.
Geert

I use Toolbox > Profile > Metaclass. I drag and drop metaclass into a diagram. I select the required metaclass from a list and the element gets displayed. EA shows this new element as a metaclass and not as a stereotype. It also add this element in my package.

You say "What you get is a stereotype". Really? As I said it is shown as a metaclass. And I thought that I just get a reference to something which is already there. I have the impression, that I get a copy, that extends or inherits from the original.

67
In that case you might need to do something like
Code: [Select]
shape main
{
   layouttype="border";
   if(hasproperty("diagram.mdgtype", "BPMN1.0::Business Process")
  {
   ...
  }
  else if(hasproperty(...)
   {
      ...
   }
 if hasproperty("diagram.mdgtype", "BPMN2.0::Business Process")
   {
      AddSubShape("Activity","center");
   }
  else if(hasproperty(...)
   {
      ...
   }
}

That would means some duplicated code, but it would work. It would make things easier if we could use NOT, AND and OR, but where's the challenge then right  ;D

Geert

This is what we are doing at the moment. But the issue is in the SubShapes where we are using a lot of code. And this code has to be dublicated several times.

68
We put a stereotype between stereotype "ProcessStep" and the stereotypes BPMN2.0::Activity and Archimate2::Archimate_BusinessProcess. We declared _image as private to suppress inheritance.

The upper Shape Script is not executed any more.

The side-effect is, that the Properties Sheet does not open automatically any more and that the attributes are not ordered any more.

Can somebody tell me a better solution?

69
No. There is no AND. There is no OR. Look at Simon's example how to code a work around for the AND. It's simple Boolean algebra and use of copy and paste. q.

I was not asking for AND. I was asking for OR. If Simon's example reflects AND, than this is no solution for my issue. If Simon's example reflects OR, than I do not understand how to copy and paste it into my example.

70
Yes, the language is simplistic.
I've handled this is the past by reversing the logic.
if (a!=1) {
   if (a!=2)   {do XY}
}

Could be that I do not understand the point. Could you translate this into my example, please?

shape main
{
   layouttype="border";
   if(hasproperty("diagram.mdgtype", "BPMN1.0::Business Process") OR hasproperty("diagram.mdgtype", "BPMN2.0::Business Process") )
   {
      AddSubShape("Activity","center");
   }
  else if(hasproperty(...)
   {
      ...
   }
}


71
I believe what qwerty is saying is that you cannot do text or value comparisons in ShapeScript.  There is no "if ( a=1 )" syntax.  There is only "if (hasproperty(a))"
I thought the pseudo-code would make the issue easier to undertand. I did not. I am sorry.

I need someting like:

shape main
{
   layouttype="border";
   if(hasproperty("diagram.mdgtype", "BPMN1.0::Business Process") OR hasproperty("diagram.mdgtype", "BPMN2.0::Business Process") )
   {
      AddSubShape("Activity","center");
   }
}

72
The first sentence in my first reply still stands.
q.

So there is no workaround. Many thanks for your answers.

73
Hi together,

We implemented a stereotype "ProcessStep" with an own shape script. The stereotype generalizes the stereotypes BPMN2.0::Activity and Archimate2::Archimate_BusinessProcess. Both have the same MetaClass Activity.

The script would work fine. Unfortunately it "inherits" the shapescript. We thought "overwriting" prevents "inheritage". Did we do something wrong or missed something? How can we avoid the inheritance of the script?

We did not use "drawparentshape" in the script.

We did the same for Pool and Archimate2::Application. This works fine. The reason seems to be that they have different metaclasses.

Many thanks in advance, V.

74
I'm not sure about most of the questions, I guess you'll have to find out using trial and error.
I can give you an easy tip on the question which Metaclass to extend.
If you remove the stereotype of an element then only the Metclass remains. That is the metaclass to extend.
Geert
Geert, many thanks.
Do you know, why EA creates the meta class, I create in a diagram by using Toolbox > Profile > Metaclass, also in the Project Browser? I expect just a link resp. a reference to the original one, which should be part of the system (so somewhere in the system resp. another folder, which is not accessible by the user). It seems to me that I get a copy.
There are no hidden system folders in EA, just some hard coded stuff.
Geert

Is it not misleading that I get a copy or something else in my folder? EA says "extend metaclass". So what do I get? An extension (o.k., than I would undertand the copy) or a reference to the original metaclass?

75
I can give you an easy tip on the question which Metaclass to extend.
If you remove the stereotype of an element then only the Metclass remains. That is the metaclass to extend.
Very helpful. Tank you.

Pages: 1 ... 3 4 [5] 6 7 ... 16