Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Need up to date instructions for SysML Parametric Modelling
Need up to date instructions for SysML Parametric Modelling [message #1770665] Tue, 15 August 2017 23:46 Go to next message
Brad Crochet is currently offline Brad CrochetFriend
Messages: 32
Registered: July 2017
Member
Version: Neon (4.6.0)
Build id: 2017-01-10T18:00:02Z
SysML 1.4

Hello. I'm trying to follow the tutorial here:

https://www.youtube.com/watch?v=7PXAI3GBRvU

for building constraint blocks/properties into a model, along with the associated PAR diagrams. What I'm seeing in Papyrus diverges from that shown in the video at around 0:40, when the author drops a ContraintProperty on the PAR diagram and uses the popup wizard to create a ConstraintBlock in the model to type the Property. His Property and C-Block have a null constraint already built in...mine do not. I go into the definition of my ConstraintBlock and add a constraint, but the new constraint isn't applied to the ConstraintProperty. Could anyone point me to other instructions on this matter...or maybe just set me straight on what I'm doing wrong?

Thanks a bunch!

EDIT: I am now attempting to create the ConstraintBlock entirely within the Model Explorer, per instructions here:

https://wiki.eclipse.org/Papyrus/UserGuide/Papyrus_Constraints

However, every time I try to create a constraint property under the ConstraintBlock, Papyrus complains about the specification, saying "constraint is invalid". I'm talking about a simple constraint spec like "a = b" {natural language}. I've done this kind of modelling in other software just fine. Any help at all is much appreciated...just a clue as what I'm doing wrong here.

[Updated on: Wed, 16 August 2017 21:21]

Report message to a moderator

Re: Need up to date instructions for SysML Parametric Modelling [message #1770853 is a reply to message #1770665] Thu, 17 August 2017 22:57 Go to previous messageGo to next message
Brad Crochet is currently offline Brad CrochetFriend
Messages: 32
Registered: July 2017
Member
In case someone else has the same trouble I've had, I will post here the caveats I've discovered necessary when attempting to follow the older directions (linked in my original post) with the current version of Papyrus/SysML. Most of what's here refers to the youtube video (first of my links in the original post).

1) ConstraintParameter is no longer an option on the palette when building PAR diagrams. One should simply select Parameter (Nodes), and place that on the desired ConstraintProperty element on the diagram. This action will automatically add a ConstraintParameter to the defining ConstraintBlock.

2) ConstraintBlocks are created, by default, without any ConstraintProperty. One must manually create the ConstraintProperty by:
Model Explorer -> rightclick [ConstraintBlock] -> New Child -> Constraint

2a) MAJOR PITFALL: When one creates a new ConstraintProperty in this way, Papyrus will automatically have the user begin entering a formal ConstraintSpecification in OCL (I'm not entirely educated on this part). For me, this always resulted in errors (red icons in the Explorer) that I couldn't get rid of, even when I left the specification blank, and/or changed the language from OCL to Natural Language.
2b) SOLUTION TO 2a: After manually creating a ConstraintProperty, press ESC to get out of the default Specification entry routine. Then, select the newly created (but empty) contraintSpec in Explorer, and use the Value entry in the Properties window (note: no language option this time) and type your specification, i.e. v=dx/dt.

[NOTE: 2a and 2b should be updated by someone that knows OCL and Parametric modelling in Papyrus better than I do]

3) I could never drag ValueType definitions from Explorer onto the ConstraintParameters on the diagram. This had to be done manually in the Properties page of the Parameter. The problem may stem from Papyrus not correctly registering that the mouse pointer is positioned over the Parameter graphic, and not just the larger ConstraintProperty graphic. I say this because I also had trouble attaching Binding Connectors to Parameters.

4) Constraints DO NOT automatically show up in the ConstraintProperties elements on the PAR diagram. One must: a) rightclick [ConstraintProperty] on the diagram -> Filters -> Show/Hide Compartments -> select "constraints", AND b) drag the Constraint in question from its place under the associated ConstraintBlock in Explorer, onto the ConstraintProperty element on the diagram.

I've attached the project folder in which I successfully duplicated (partially) the model in the youtube video.
  • Attachment: Scratch.zip
    (Size: 5.03KB, Downloaded 150 times)
Re: Need up to date instructions for SysML Parametric Modelling [message #1857528 is a reply to message #1770853] Mon, 13 February 2023 23:40 Go to previous messageGo to next message
Lennox 84 is currently offline Lennox 84Friend
Messages: 3
Registered: January 2023
Junior Member
Hi,
thanks for the explanations that you did above. I am also trying to create parametric diagrams in Papyrus but did not succeed so far. I just have a little experience with Papyrus and wonder if one needs to execute the model (MOKA?) to calculate something.

In my example I have two parameters (mass1 and mass2) which I would like to sum to receive the total mass in a third parameter. I am not sure how to define the constraint block and the equation (constraintSpec).
I attached a screenshot of my test-model.

In Cameo Systems Modeler it works easy. If one starts a simulation and changes the values of mass1 or mass2, the total mass will be calculated and shown as a runtime value in the console.

How does it work in Papyrus? Do I need to make MOKA running?
Can someone help me out? Any ideas?

Thanks for help and best regards! Lennox
Re: Need up to date instructions for SysML Parametric Modelling [message #1857596 is a reply to message #1857528] Thu, 16 February 2023 13:01 Go to previous messageGo to next message
Pauline Deville is currently offline Pauline DevilleFriend
Messages: 122
Registered: November 2016
Location: Paris Saclay, France
Senior Member
Hello,

There are two parts of the modeling, the declarative part where you describe your problem and then the imperative one where your can simulate (Moka [1]) or generated code.

Next time can you please open a new topic.

Best regards,
Pauline

1] https://wiki.eclipse.org/Papyrus/UserGuide/ModelExecution

[Updated on: Thu, 16 February 2023 13:02]

Report message to a moderator

Re: Need up to date instructions for SysML Parametric Modelling [message #1857833 is a reply to message #1857596] Tue, 28 February 2023 10:09 Go to previous messageGo to next message
Lennox 84 is currently offline Lennox 84Friend
Messages: 3
Registered: January 2023
Junior Member
Hi Pauline,
thanks for your answer.
First of all, do you think that I modelled correctly the declarative part to calculate the values (see my screenshot above)?
Second, I still have not succeeded to finally calculate the values (which normally should not be a difficult task). Is there any more documentation/tutorials besides the user guide?
Third, is there any possibility to run MOKA with the latest Eclipse Version instead of using Eclipse 2019-03? I got version conflicts when opening my models with Eclipse 2019...

Thanks for your help and best regards, Lennox
Re: Need up to date instructions for SysML Parametric Modelling [message #1857869 is a reply to message #1857833] Thu, 02 March 2023 16:34 Go to previous message
Pauline Deville is currently offline Pauline DevilleFriend
Messages: 122
Registered: November 2016
Location: Paris Saclay, France
Senior Member
Hello,

1. I am sorry am not an expert of this part and I don't really know how the simulation works for the composite. So I cannot say that it is wrong or not, I would say, I think that the behavior should not be describe as a constraint but may be with the classifier behavior of the class using an activity and using the FundationModelLibrary to have some basic operation like +/* ...

2. I don't know any other documentation

3. Yes a new version of Moka has been publish very recently based on Eclipse 2022-12 [a]

HTH,
Pauline

a] https://download.eclipse.org/modeling/mdt/papyrus/components/moka/2022-12/
Previous Topic:Still no State Machine success
Next Topic:Display OpaqueBehaviour Content in State
Goto Forum:
  


Current Time: Fri Apr 19 11:32:57 GMT 2024

Powered by FUDForum. Page generated in 0.02181 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top