Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ChuckLutz opened this issue Jan 12, 2024 · 2 comments
Open

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

ChuckLutz opened this issue Jan 12, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@ChuckLutz
Copy link

ChuckLutz commented Jan 12, 2024

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):

  • OS: Mac OS Ventura
  • Java Version OpenJDK 19.0.1 2022-10-18
  • USE version 7,0.1

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 ChuckLutz added the bug Something isn't working label Jan 12, 2024
@ChuckLutz
Copy link
Author

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
Copy link
Contributor

h-man2 commented Jan 15, 2024

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

There are different ways to define operations in USE:

  • Side-effect free query operations
    These are the operations defined by an OCL expression, like fac in the example. These oeprations can directly be called from other OCl expressions (like it is done in the post condition) or using the query command (startet with ? on the shell or entered directly in the OCL evaluation window.
    Called query operations to not show up in the sequence diagram. Maybe this should be changed in future releases.

  • Operations with side-effects without a body
    These operations are "simulated" by the commands !openter and opexit. Here concrete scenarios can be "executed" by changing the system state with commands like set, create, delete, ...
    The operations "called" this way show up in the sequence diagram.

  • Operations with side-effects with a body
    These operations can be defined using s tiny imperative language called SOIL.

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

  • Which calls to query operations should be shown? Only the direct ones or also calles from inside pre- and postconditions?
  • Should a query entered in the evaluation windows show up?
  • Shoul a user be able to speparate between shown und unshown queries? Like with a new command !? or something like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants