Skip to main content



      Home
Home » Modeling » Papyrus » Trouble making conditional block
Trouble making conditional block [message #1837580] Tue, 02 February 2021 13:36 Go to next message
Eclipse UserFriend
I posted this question on StackOverflow, but perhaps it would be better here.

I have a sequence diagram in Papyrus. There are two steps that I need to show as conditional, on a variable expression. I understand that I need to add a Combined Fragment, and it's probably the "opt" or perhaps "alt" Interaction Operator, but that's about all I can figure out. I don't understand what I have to drop where.

I found a StackOverflow question/answer that shows what I want it to look like: https://stackoverflow.com/questions/8114770/how-to-show-if-condition-on-a-sequence-diagram . Although I won't have an "else" block.

I have a sequence diagram in Papyrus. There are two steps that I need to show as conditional, on a variable expression. I understand that I need to add a Combined Fragment, and it's probably the "opt" or perhaps "alt" Interaction Operator, but that's about all I can figure out. I don't understand what I have to drop where.

The picture in the answer shown here: https://stackoverflow.com/questions/8114770/how-to-show-if-condition-on-a-sequence-diagram is close to what I need, except that there is no "else".

I also found this: https://www.eclipse.org/papyrus/resources/PapyrusTutorial_OnSequenceDiagrams_v0.1_d2010100.pdf , but I still can't figure this out.

I have managed to add an "opt" CombinedFragment, and I added something that looks like a constraint, which is shown in the picture in the SO posting.

Here is a snapshot of my sequence diagram, showing the CombinedFragment:
index.php/fa/39900/0/

As you can see from the picture, there is a red X on the constraint, and when I hover on that, it says:

Quote:
The required feature 'uml::Constraint::specification' of 'prescreen::prescreen::CombinedFragment34::InteractionOperand0::guard' must be set.

index.php/fa/39897/0/

I can see when I click on the InteractionOperand, there is a "Guard" property, and when I click the Edit button for that, I see that there is a "Specification" property. These are all set to something, but it's not clear to me what I have to set them to.
index.php/fa/39898/0/
index.php/fa/39899/0/

[Updated on: Tue, 02 February 2021 17:22] by Moderator

Re: Trouble making conditional block [message #1837711 is a reply to message #1837580] Thu, 04 February 2021 08:29 Go to previous message
Eclipse UserFriend
I had this error, but it vanishes when you actually add a guard constraint - as you did. A problem might be that the error appears right after creation of the combined fragment, but a re-validation is not triggered automatically when you add the constraint. Try to click on the combined fragment and use "Validation -> Validate subtree"

Concerning your 2nd question: First, add a 2nd interaction operand. One option (not sure, if there are cleaner ones) is to use an opaque expression as guard, with "natural language" as language and "else" as body.
Previous Topic:Static profile OCL expressions referring to enumeration literals cause "contains a bad value&qu
Next Topic:Issue with Papyrus CI site
Goto Forum:
  


Current Time: Wed Jul 02 17:29:07 EDT 2025

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

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

Back to the top