Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » The 'table creation tool' is not stable
The 'table creation tool' is not stable [message #1818533] Thu, 19 December 2019 04:08 Go to next message
Qiran Cong is currently offline Qiran CongFriend
Messages: 26
Registered: November 2019
Junior Member
I use this tool in a diagram to create table it relevant to. In the precondition property, I use 'containerView' to get the elements used in this form.
Then the weird thing happens during use: when I right-click on the available element(that's the way the creation tool works), sometimes the tool won't show up in the popped out menu, then I have to move around the mouse to other elements and right-click or things like that, and with these operations, the previous action would pop out a menu with creation tool.
I mean there seems to be a cache affect the refresh of the popped out menu. Some actions I mentioned above might force the refresh. I guess that might be caused by 'containerView' element? or any other reasons?

btw: I also use Java service in precondition property but that seems not the cause.
Re: The 'table creation tool' is not stable [message #1818555 is a reply to message #1818533] Thu, 19 December 2019 14:21 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 572
Registered: May 2011
Senior Member
Hello,

I have not been able to reproduce your issue. What is the expression that you have in the precondition using the containerView variable and a java service? What is the content of your java service? Can it return false because something is not yet initialized?

Best Regards,
Steve


Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: The 'table creation tool' is not stable [message #1819320 is a reply to message #1818555] Mon, 13 January 2020 06:42 Go to previous messageGo to next message
Qiran Cong is currently offline Qiran CongFriend
Messages: 26
Registered: November 2019
Junior Member
Hi Steve,
The expression and service is below:
Precondition:
aql:containerView.getTableUnderselectedElement().eInverse()->select(i|i.target==self).representation.eCrossReferences()->select(c|c.oclIsTypeOf(description::EditionTableDescription)).name->excludes('H234597_00153')

Service:
/** check if the element already have a table,
* arg: the containerView of the selected element */
def Collection<EditionTableDescriptionImpl> getTableUnderselectedElement(AbstractDNode arg){
var Collection<EditionTableDescriptionImpl> returnList=new ArrayList<EditionTableDescriptionImpl>();
var obj=arg as AbstractDNode;
var objc=obj.eContainer as DSemanticDiagramImpl;
var objctype =objc.description.eContainer as ViewpointImpl;
var typeList =objctype.ownedRepresentations;
for(type: typeList){
if(type.class==EditionTableDescriptionSpec){
var type1=type as EditionTableDescriptionImpl;
returnList.add(type1);
}
}
return returnList;
}

I write the service with xtend, I also noticed sometimes the service defined here would be ignored as if that file doesn't exist in the project. The solution for that is to open the file in IDE before operation.....
Re: The 'table creation tool' is not stable [message #1819344 is a reply to message #1819320] Mon, 13 January 2020 14:30 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 572
Registered: May 2011
Senior Member
Hello,

I am not familliar with xtend and I do not know how it behave if called from a service. I would advise you to have your service in java and have your whole service in it instead of having one part in the service and one part in the precondition. From the look of it, you are trying to have a precondition checking that there are no table of the description "H234597_00153" associated to your semantic element. If that's it, then you can use the "container" variable to have the semantic element and find the representations based on it usign the API : DialectManager.INSTANCE.getRepresentations(semanticRoot, session). From this list of DRepresentation, you filter the DTable and finally use the getDescription method to check if it not the "H234597_00153" TableDescription.

Best regards,
Steve


Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: The 'table creation tool' is not stable [message #1819548 is a reply to message #1819344] Fri, 17 January 2020 08:21 Go to previous messageGo to next message
Qiran Cong is currently offline Qiran CongFriend
Messages: 26
Registered: November 2019
Junior Member
thank you, changing code to java is really working for me by now, and thanks for your other advices.
Re: The 'table creation tool' is not stable [message #1819549 is a reply to message #1819344] Fri, 17 January 2020 08:24 Go to previous message
Qiran Cong is currently offline Qiran CongFriend
Messages: 26
Registered: November 2019
Junior Member
thank you, changing code to java is really working for me by now, and thanks for your other advice.
Previous Topic:Sirius Web Diagrams Support
Next Topic:operation after navigation
Goto Forum:
  


Current Time: Thu Apr 25 01:34:53 GMT 2024

Powered by FUDForum. Page generated in 0.03460 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top