-
Notifications
You must be signed in to change notification settings - Fork 100
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
[555096] Pluggable Validation Traversal #186
base: master
Are you sure you want to change the base?
[555096] Pluggable Validation Traversal #186
Conversation
🚀 Build master-PR-186-1 started! |
😞 Build master-PR-186-1 failed! |
🚀 Build master-PR-186-2 started! |
😟 Build master-PR-186-2 is unstable! The product is available here. |
can you rebase it as both gmf commits are already available on master by #190 |
6bf339f
to
b64899c
Compare
Rebased and fixed the test |
🚀 Build master-PR-186-3 started! |
😟 Build master-PR-186-3 is unstable! The product is available here. |
b64899c
to
c457678
Compare
🚀 Build master-PR-186-4 started! |
c457678
to
996d21c
Compare
🚀 Build master-PR-186-5 started! |
😟 Build master-PR-186-4 is unstable! The product is available here. |
😟 Build master-PR-186-5 is unstable! The product is available here. |
🚀 Build master-PR-186-1 started! |
😞 Build master-PR-186-1 failed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
can you also update documentation about validation preference page.
-
the preference with choice Tree and Extended validation have a large top padding before Tree
-
does the epf file validation can handle both "Tree selection" and "Extended validation" choice ?
-
when i try to use the "Extended Validation" by RightClick > Validate Model on a Component allocating a Function , i got an error
!MESSAGE Plug-in "org.polarsys.capella.core.validation" was unable to instantiate class "org.polarsys.capella.core.validation.scope.DefaultScopedDiagnosticianProvider".
!STACK 0
java.lang.IllegalAccessException: Class org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI can not access a member of class org.polarsys.capella.core.validation.scope.DefaultScopedDiagnosticianProvider with modifiers "protected"
at sun.reflect.Reflection.ensureMemberAccess(Unknown Source)
at java.lang.reflect.AccessibleObject.slowCheckMemberAccess(Unknown Source)
at java.lang.reflect.AccessibleObject.checkAccess(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:204)
at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:934)
at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:246)
at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:63)
at org.polarsys.capella.core.model.handler.validation.DiagnosticianProviderRegistry$Descriptor.getProvider(DiagnosticianProviderRegistry.java:75)
at org.polarsys.capella.core.model.handler.validation.DiagnosticianProviderRegistry.getDiagnosticianProvider(DiagnosticianProviderRegistry.java:56)
at org.polarsys.capella.core.platform.sirius.ui.actions.CapellaValidateAction.createDiagnostician(CapellaValidateAction.java:85)
at org.polarsys.capella.core.platform.sirius.ui.actions.CapellaValidateAction.validate(CapellaValidateAction.java:223)
at org.polarsys.capella.core.platform.sirius.ui.actions.CapellaValidateAction$2.run(CapellaValidateAction.java:143)
at org.eclipse.ui.actions.WorkspaceModifyDelegatingOperation.execute(WorkspaceModifyDelegatingOperation.java:71)
at org.eclipse.ui.actions.WorkspaceModifyOperation.lambda$0(WorkspaceModifyOperation.java:110)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2295)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2322)
at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:131)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:438)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:354)
at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:469)
at org.polarsys.capella.core.platform.sirius.ui.actions.CapellaValidateAction.executeValidationAction(CapellaValidateAction.java:174)
at org.polarsys.capella.core.platform.sirius.ui.actions.CapellaValidateAction$1.run(CapellaValidateAction.java:125)
at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.runExclusive(TransactionalEditingDomainImpl.java:328)
at org.polarsys.capella.common.ef.ExecutionManager.executeReadOnlyCommand(ExecutionManager.java:79)
at org.polarsys.capella.common.ef.ExecutionManager.execute(ExecutionManager.java:66)
at org.polarsys.capella.core.platform.sirius.ui.actions.CapellaValidateAction.run(CapellaValidateAction.java:122)
and if i fix the protected to public, it doesn't seems to validate on the allocated function from the component. can you retest it? do i missed something?
@@ -454,11 +454,11 @@ | |||
mapping="org.polarsys.capella.common.re" | |||
purpose="org.polarsys.capella.common.re.scopeElements"> | |||
<scopeRetriever | |||
class="org.polarsys.capella.core.re.handlers.scope.PartTypeRetriever" | |||
class="org.polarsys.capella.core.transition.system.handlers.scope.PartTypeRetriever" | |||
id="org.polarsys.capella.core.re.handlers.scope.PartTypeRetriever"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to rename id too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIU, no, the ID stays the same. The re plugin still is the declaring source of the retriever, it only reuses an implementation provided by transition.system.
id="org.polarsys.capella.core.re.handlers.scope.PartTypeRetriever"> | ||
</scopeRetriever> | ||
<scopeRetriever | ||
class="org.polarsys.capella.core.re.handlers.scope.DeployedElementRetriever" | ||
class="org.polarsys.capella.core.transition.system.handlers.scope.DeployedElementRetriever" | ||
id="org.polarsys.capella.core.re.handlers.scope.DeployedElementRetriever"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same, the re plugin declares the scoperetriever in the given mapping, reusing the implementation class
@@ -127,6 +127,8 @@ private IStatus execute(final URI airdURI) { | |||
capellaValidateCLineAction.setSelectedObjects(semanticRootResource.getContents()); | |||
} | |||
|
|||
capellaValidateCLineAction.setDiagnosticianProviderId(((ValidationArgumentHelper)argHelper).getDiagnosticianProviderId()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
format
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
really? 🥇
@@ -117,6 +122,7 @@ protected void setUp() throws Exception { | |||
} | |||
|
|||
// create the filter and add it to the validator | |||
System.out.println(ruleDescriptor.getId()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
syso
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
|
registry.put(p, adapter); | ||
} | ||
registry.put(RePackage.eINSTANCE, adapter); | ||
registry.put(null, adapter); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that is intended. The diagnostician uses the registry to find an EValidator for a given Object by looking for a value for the EPackage of the Object, and if none is found, it uses the null key to find an adapter. This way, by default, extension packages (e.g. viewpoint extensions) will always use the capella adapter. All the put(ePackage...) above are only optimisations for faster lookup..
Philippe, thanks for your comments. I dont' know I didnt get a notification or anything from Github :/ |
996d21c
to
78995ad
Compare
I fixed all the issues except doc, will follow. |
🚀 Build master-PR-186-2 started! |
As for the EPF validation: I'm not sure how you would want to handle this.. Should the EPF file include whether to use Tree or Extended Validation? TBH, I would probably revamp the whole system: A validation can be seen as a launch configuration, we would "run" validations, where users could select/define/store even more parameters, e.g. which elements to validate, which rules to use, and which traversal option. |
SonarCloud Quality Gate failed. 0 Bugs |
😟 Build master-PR-186-2 is unstable! The product is available here. |
* Tune the DiagnosticianProvider extension point so that multiple providers can be contributed. The current active provider can then be selected via preference. Commandline validation adds an optional parameter to override the provider to use. Two providers are available by default: 1) The standard tree plus part-type validation (default) 2) An extended traversal with the following extra validations: - Allocated functions - Deployed components - Component and Functional Exchanges between validated Components - Interfaces between validated component ports * Cleanup/refactoring of Capella validation code. Signed-off-by: Felix Dorner <[email protected]>
extended - is the new extended validation legacy - is the old tree validation Signed-off-by: Felix Dorner <[email protected]>
Signed-off-by: Felix Dorner <[email protected]>
Signed-off-by: Felix Dorner <[email protected]>
Signed-off-by: Felix Dorner <[email protected]>
78995ad
to
f4027c3
Compare
🚀 Build master-PR-186-3 started! |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
😟 Build master-PR-186-3 is unstable! The product is available here. |
🚀 Build master-PR-186-1 started! |
😞 Build master-PR-186-1 failed! |
🚀 Build master-PR-186-2 started! |
😞 Build master-PR-186-2 failed! |
providers can be contributed. The current active provider can
then be selected via preference. Commandline validation adds
an optional parameter to override the provider to use.
Two providers are available by
default:
Signed-off-by: Felix Dorner [email protected]