eclipse-viatra / org.eclipse.viatra

Main components of the VIATRA framework
https://eclipse.dev/viatra
Eclipse Public License 2.0
1 stars 1 forks source link

Concept of "loosly connected constraints" not explained in documentation #117

Open eclipse-viatra-bot opened 6 months ago

eclipse-viatra-bot commented 6 months ago

| --- | --- | | Bugzilla Link | 561297 | | Status | NEW | | Importance | P3 normal | | Reported | Mar 20, 2020 08:25 EDT | | Modified | Mar 30, 2020 11:19 EDT | | Reporter | Hans van der Laan |

Description

While trying to make some patterns, I got the following error message:

The pattern body contains constraints which are only loosely\ connected. This may negatively impact performance. The weakly\ dependent partitions are: [userE, employee][userC, contractor]

I do not know what "loosly connected" constraints are. There is no mention of what exactly are loosly connected constraints in the Query Language documentation. It would be useful if this was added to the documentation.

This looks like an error message I got previously about "isolated" constraints. There is also no mention of isolated constraints in the documentation. However, from the error message I think I understood what this meant.

For context, I was trying to model a mutual exclusion pattern. I have a model where users are assigned roles. For all users, it should hold that they can either have the "Employee" role or the "Contractor" role but not both.

pattern SoDEmployeeAndContractor(userE: User, userC: User, employee : Role, contractor : Role) {\ Role.name(employee, "Employee");\ Role.name(contractor, "Contractor");\ Role.RU(employee, userE);\ Role.RU(contractor, userC);\ userE!=userC;\ }

eclipse-viatra-bot commented 6 months ago

By Gabor Bergmann on Mar 20, 2020 08:32

Thanks for the report. I agree that there could be more explanation to help the user.

In the context below, the pattern identifies all employees and all contractors, but no connection between them. If there are 1000 employees and 1000 contractors, it will return one million employee-contractor pairs. This is probably not what you want.

For all users, it should hold that they can either have the "Employee" role or the "Contractor" role but not both.

This is not what your pattern expresses though! A violation of your rule would entail a single user having both roles. So the pattern should read userE==userC instead of userE!=userC to express this.

In this case, the warning might have helped you catch a bug in your pattern code.

eclipse-viatra-bot commented 6 months ago

By Hans van der Laan on Mar 20, 2020 08:38

Ah, now I understand what the error message means. Thanks for the heads-up!

eclipse-viatra-bot commented 6 months ago

By Zoltan Ujhelyi on Mar 20, 2020 09:03

One more thing I can add here is that there should be an in-Eclipse explanation with examples for the given issue (https://www.eclipse.org/viatra/documentation/releases.html#_documentation_updates)

Basically, Eclipse should suggest a quick fix called "Explain message" when you hover over the marked part of the code that opens a help section. If it is not added automatically, you could press Ctrl+1 (or Cmd+1 on macOS) while your cursor is inside the mentioned area (or while it is selected in the Problems view).

eclipse-viatra-bot commented 6 months ago

By Hans van der Laan on Mar 20, 2020 09:32

Hmmm... That functionality doesn't seem to function correctly for me. When I click "Explain message" I get the error "topic is not found".

The topic that you have requested is not available.The link may be wrong, or you may not have the corresponding product feature installed. This online help only includes documentation for features that are installed.

After clicking this message once, pressing Ctrl+1 while hovering on the warnings (both isolated and loosely) doesn't do anything. I also don't get the "Explain message" pop-up anymore. Aditionally, when I select a warning in the Problems Overview the Quick-Fix button is greyed out. When I clean the project, I get the "Explain message" pop-up back.

eclipse-viatra-bot commented 6 months ago

By Zoltan Ujhelyi on Mar 30, 2020 11:19

(In reply to comment #4)

Hmmm... That functionality doesn't seem to function correctly for me. When I click "Explain message" I get the error "topic is not found". \

The topic that you have requested is not available.The link may be wrong, or you may not have the corresponding product feature installed. This online help only includes documentation for features that are installed.

After clicking this message once, pressing Ctrl+1 while hovering on the warnings (both isolated and loosely) doesn't do anything. I also don't get the "Explain message" pop-up anymore. Aditionally, when I select a warning in the Problems Overview the Quick-Fix button is greyed out. When I clean the project, I get the "Explain message" pop-up back.

You are right, for some reason that message indeed does not suggest the explanation, only the other related ones. We should add it as well in addition of making sure the error messages and documentation are worded consistently.