Specifying derivation rules

Discussions about Domain Specific Language customizations

Moderator: Moderators

Specifying derivation rules

Postby dchristensen » Tue Nov 13, 2018 1:24 pm

I've been trying to extend the SysML Requirement class, which has multiple derived properties that are defined in the stereotype itself. As part of the extension, I want to add more derived properties, but I haven't been able to figure out how the derivation rules for those properties are defined. The documentation for OCL (https://docs.nomagic.com/display/MD185/ ... t+Language) describes derivation rules, but does not explain how to define them. Is there a way to define the derivation rule in the stereotype itself and not in a customization?

I have attached an example project for the sake of illustration.
dchristensen
Forum Newbie
Forum Newbie
 
Posts: 4
Posts Rating:0
Joined: Tue Nov 22, 2016 11:50 am

Re: Specifying derivation rules

Postby dchristensen » Wed Dec 05, 2018 10:27 am

Oops. I forgot to upload the model I referenced in my last post. See attached.
You do not have the required permissions to view the files attached to this post.
dchristensen
Forum Newbie
Forum Newbie
 
Posts: 4
Posts Rating:0
Joined: Tue Nov 22, 2016 11:50 am

Re: Specifying derivation rules

Postby rjhudson@mitre.org » Tue Mar 12, 2019 4:50 pm

This answer is most likely too late to be helpful for you, but I still wanted to answer for anybody else that may get stuck with this. The correct way to specify derived properties without using <<customization>> is to set the Default Value field to an opaque expression of type OCL2.0. Took me forever to find this, but it seems to work. Hope this helps.
rjhudson@mitre.org
Forum Newbie
Forum Newbie
 
Posts: 13
Posts Rating:5
Joined: Thu Jun 29, 2017 3:40 pm


Return to DSL

Who is online

Users browsing this forum: No registered users and 0 guests