useocl / use

Home of the UML-based Specification Environment (USE)
GNU General Public License v2.0
33 stars 16 forks source link

Update 'Nested Operation Calls' example documentation (" #74

Open ChuckLutz opened 6 months ago

ChuckLutz commented 6 months ago

Hi folks, I am new to USE and working through the manual's examples. I think it is a fantastic tool!

Describe the bug I am trying to work through the "Nested Operation Calls" portion of the manual, and USE is reporting an error that seems to indicate a new limitation (perhaps) or (hopefully) implies that there is some new way to invoke operations that are defined as OCL expressions.

To Reproduce Steps to reproduce the behavior:

  1. Load the model shown here
  2. Issue the commands "!create r : Rec" and "!openter r fac(3)" as shown here.
  3. The second command will fail; the command line will report "Operation 'Rec::fac' is defined by a OCL expression and cannot be entered with openter."

Expected behavior The command line should show something similar to "precondition `pre1' is true" as shown in the link from step 2 above.

Desktop (please complete the following information):

Additional context The source line showing the error appears to be here, but I didn't see any immediate hint pointing to how I should instead have tried to invoke the operation.

ChuckLutz commented 6 months ago

Hello again,

I note that, given that the "factorial" example is still loaded AND the object "r" of type "Rec" exists, then entering "r.fac(3)" in the "Evaluate OCL expression" window, it does work ("Result:" shows "6 : Integer"). I am able to click the "Browser" button in tat dialog to see the entire nested call tree.

Trying to generate a sequence diagram at the same time, however, does not produce anything. Thanks, Chuck

h-man2 commented 6 months ago

Hi Chuck, I'm glad to hear you like USE.

There are different ways to define operations in USE:

However, adding the possibility to show query operations in the sequence diagram might be a good idea. But I see some challenges: