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

#2714 Concretize function allocation #2715

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ebausson-obeo
Copy link
Contributor

No description provided.

@eclipse-capella-bot
Copy link

🚀 Build master-PR-2715-1 started!

@eclipse-capella-bot
Copy link

😞 Build master-PR-2715-1 failed!

Copy link
Contributor

@pdulth pdulth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you create dedicated two github issue for this pull request as the two commits seems separated.

and more generally, can you add the id of the commits in the begining of the commit messages. (you might have to add
image
in your gitconfig to be able to add commit identifier at begining of the commit.)

and can you add junits on your fixed issues.

@@ -1,5 +1,5 @@
/*******************************************************************************
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

semantic browser view has 3 panes / 3 content providers that are inheriting from GroupedAdapterFactoryContentProvider.
Can you look at this class in which there is already a ResourceSetListenerImpl that refresh the view when the element is changed / or shall be updated. Maybe the refreshRequired shall be updated a bit to cover those new cases. we dont want to refresh to often the view, for instance when the session is opening.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like when my accelerator is invoked, there is no call to GroupedAdapterFactoryContentProvider.processRefresh()
The notifyChanged() methods seems to be working as expected, but the following call to processRefresh() is just missing.
Did I miss something when creating the allocation? Bypassed a wrapper meant to call the refresh afterward? I am a bit stumped on how to proceed from there.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @pdulth,
I had a look on the pointed code to help Etienne. I'm not sure to fully understand the implicated code. Indeed, the ResourceSetListener that you mentioned is only used by CapellaNavigatorContentProvider. The method getListener(), that instantiate the listener, is neved called for the 3 panes of the Semantic Browser view.
Do you expect that we add the listener of the ReferencingElementCP part used in Semantic Browser view, as it is done in CapellaNavigatorContentProvider ?

diff --git a/core/plugins/org.polarsys.capella.core.ui.semantic.browser.sirius/src/org/polarsys/capella/core/ui/semantic/browser/sirius/content/provider/SiriusSemanticBrowserContentProviderFactory.java b/core/plugins/org.polarsys.capella.core.ui.semantic.browser.sirius/src/org/polarsys/capella/core/ui/semantic/browser/sirius/content/provider/SiriusSemanticBrowserContentProviderFactory.java
index 8d13b25..8e765c2 100644
--- a/core/plugins/org.polarsys.capella.core.ui.semantic.browser.sirius/src/org/polarsys/capella/core/ui/semantic/browser/sirius/content/provider/SiriusSemanticBrowserContentProviderFactory.java
+++ b/core/plugins/org.polarsys.capella.core.ui.semantic.browser.sirius/src/org/polarsys/capella/core/ui/semantic/browser/sirius/content/provider/SiriusSemanticBrowserContentProviderFactory.java
@@ -17,8 +17,10 @@
 
 import org.eclipse.emf.common.notify.Notification;
 import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
 import org.eclipse.jface.viewers.ITreeContentProvider;
 import org.eclipse.sirius.viewpoint.DRepresentationDescriptor;
+import org.polarsys.capella.common.helpers.TransactionHelper;
 import org.polarsys.capella.common.ui.toolkit.browser.content.provider.impl.CurrentElementCP;
 import org.polarsys.capella.common.ui.toolkit.browser.content.provider.impl.ReferencedElementCP;
 import org.polarsys.capella.common.ui.toolkit.browser.content.provider.impl.ReferencingElementCP;
@@ -148,6 +150,13 @@
       public void notifyChanged(Notification notification) {
         if (model.isListeningToPageSelectionEvents() && notification.hashCode() != lastNotification) {
           lastNotification = notification.hashCode();
+          Object notifier = notification.getNotifier();
+          if (notifier instanceof EObject) {
+            TransactionalEditingDomain domain = TransactionHelper.getEditingDomain((EObject) notifier);
+            if (domain != null) {
+              domain.addResourceSetListener(getListener());
+            }
+          }
           super.notifyChanged(notification);
         }
       }

With the above change, the behavior is OK. But I'm not sure if it is the right way to do it.

What do you think about that? Have you some additional advices?

AbstractFunction motherFunction = (AbstractFunction) element;
Component component = resolveMotherFunctionAllocation(motherFunction);
if (component != null) {
createAlloction(component, motherFunction);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

allocation

AbstractFunction motherFunction = (AbstractFunction) element;
Component component = resolveMotherFunctionAllocation(motherFunction);
if (component != null) {
createAlloction(component, motherFunction);
Copy link
Contributor

@pdulth pdulth Sep 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

functionally, doesn't seems arcadia legit to allocate the mother function. only leafs can be allocated to components. to be discussed. Is there a DOREMI related ?
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be acceptable if it was a config option (that was deactivated by default)?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,
It needs to be discussed.
Is there a DOREMI related describing the need to be discussed while obeo sync meeting?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello,
No, this is not DOREMI related, it is a client request.
Would a PR with the functionality deactivated by default (and activable through the preferences) have better chance to be merged?

@pdulth pdulth force-pushed the concretize-function-allocation branch from e8a2c12 to 2cbbdf6 Compare September 4, 2023 11:31
@eclipse-capella-bot
Copy link

🚀 Build master-PR-2715-2 started!

@sonarcloud
Copy link

sonarcloud bot commented Sep 4, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@eclipse-capella-bot
Copy link

😟 Build master-PR-2715-2 is unstable! The product is available here.

@pdulth
Copy link
Contributor

pdulth commented Sep 5, 2023

FYI build is ok if you rebase your branch from master

@eclipse-capella-bot
Copy link

🚀 Build master-PR-2715-4 started!

@eclipse-capella-bot
Copy link

😞 Build master-PR-2715-4 failed!

@ebausson-obeo ebausson-obeo changed the title #2714 Concretize function allocation Draft: #2714 Concretize function allocation Jan 9, 2024
@ebausson-obeo ebausson-obeo changed the title Draft: #2714 Concretize function allocation #2714 Concretize function allocation Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adding an accelerator allowing the concretization of a computed allocation.
4 participants