Using derived property to calculate weight

Discussions about Domain Specific Language customizations

Moderator: Moderators

Using derived property to calculate weight

Postby yonedal » Tue Oct 04, 2016 10:51 am

Suppose I have the following blocks:
dp1.PNG


What I want:
When I make an instance of this, I want total weight to be the sum of all of the weight values from the Sub-Blocks.

As I understand, I have to make a Customization Element whose target I set as a stereotype, and I apply that stereotype to Main Block, and then I have an OCL expression to calculate the value of the block (though I thought OCL just returned Boolean values?) which then has to have either a Java Listener put together or a Metachain.

I'm struggling to figure out what goes where to do this, so if someone could just provide a basic example that does what I'm after it would be greatly appreciated.
You do not have the required permissions to view the files attached to this post.
yonedal
Forum Beginner
Forum Beginner
 
Posts: 37
Posts Rating:1
Joined: Sun Nov 23, 2014 5:09 pm

Re: Using derived property to calculate weight

Postby ieva.n » Tue Oct 04, 2016 11:03 am

Hello,

Have you looked into using Rollup Pattern? http://docs.nomagic.com/display/SYSMLP1 ... ern+Wizard

Sincerely,
No Magic, Inc. Customer Support
ieva.n
No Magic
No Magic
 
Posts: 369
Posts Rating:33
Joined: Thu Aug 02, 2012 5:02 am
Full name: Ieva

Re: Using derived property to calculate weight

Postby yonedal » Tue Oct 04, 2016 11:06 am

I have not. I will look into that. Thanks!
yonedal
Forum Beginner
Forum Beginner
 
Posts: 37
Posts Rating:1
Joined: Sun Nov 23, 2014 5:09 pm

Re: Using derived property to calculate weight

Postby yonedal » Tue Oct 04, 2016 1:33 pm

OK, so I went through the RollUp example and, instead of using that, tried just using constraints and a parametric diagram to get what I want.

However, at the instance level the value is not being updated.

I've attached the model I'm experimenting in to this post (see under the Package Simple Addition).

Referencing the attached image, what I want to happen is for the slot totalWeight the be filled with the value (in this instance) 12.2. So what am I missing in making that happen?
dp2.PNG


Edit:
I am using Cameo Enterprise Architecture 18.4.
You do not have the required permissions to view the files attached to this post.
yonedal
Forum Beginner
Forum Beginner
 
Posts: 37
Posts Rating:1
Joined: Sun Nov 23, 2014 5:09 pm

Re: Using derived property to calculate weight

Postby marthaaustin1977@gmail.com » Thu Feb 25, 2021 3:47 pm

I could not even imagine that I would be interested in this topic. But in fact it is very interesting and exciting. ;)
Our service is great at power point presentation check out https://www.wiseessays.com/power-point-presentation and see for yourself. We are glad to help.
marthaaustin1977@gmail.com
Forum Newbie
Forum Newbie
 
Posts: 1
Posts Rating:0
Joined: Thu Feb 25, 2021 3:40 pm


Return to DSL

Who is online

Users browsing this forum: No registered users and 0 guests

cron