Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » how can get all business object from diagram(how can get all business object from diagram)
how can get all business object from diagram [message #1101336] Wed, 04 September 2013 10:16 Go to next message
xiao yu zhou is currently offline xiao yu zhouFriend
Messages: 20
Registered: August 2013
Junior Member
Hi gays

Now I have a problem,I just want to know whether there are apis to get business object from diagram in graphiti.I look forward for your help.
Re: how can get all business object from diagram [message #1101362 is a reply to message #1101336] Wed, 04 September 2013 11:09 Go to previous messageGo to next message
PALANI SANKAR is currently offline PALANI SANKARFriend
Messages: 35
Registered: April 2013
Member
Hi Xiao

Try these methods getFeatureProvider().getBusinessObjectForPictogramElement(getDiagram());
getFeatureProvider().getAllBusinessObjectsForPictogramElement(getDiagram())

Hope this helps.

Thanks
Palani


Thanks
Palani
Re: how can get all business object from diagram [message #1102922 is a reply to message #1101362] Fri, 06 September 2013 07:48 Go to previous messageGo to next message
xiao yu zhou is currently offline xiao yu zhouFriend
Messages: 20
Registered: August 2013
Junior Member
Hi,PALANI SANKAR
Thank you for your advice for these methods ,but these methods did not give me a help.I can only get an empty array. I do not know why. I also tried getPictogramLinks() method on diagram,this method can help me to get all links and then get all business objs,but by this I get more than what I need. I know get the objs by filtering, but I think there should be a method provided by Graphiti to get domain model objs in an elegant way.

[Updated on: Fri, 06 September 2013 07:51]

Report message to a moderator

Re: how can get all business object from diagram [message #1104592 is a reply to message #1102922] Sun, 08 September 2013 16:51 Go to previous message
Hallvard Traetteberg is currently offline Hallvard TraettebergFriend
Messages: 601
Registered: July 2009
Location: Trondheim, Norway
Senior Member
On 06.09.13 09.48, xiao yu zhou wrote:
> Thank you for your adv
> getFeatureProvider().getBusinessObjectForPictogramElement(getDiagram()) and
> getFeatureProvider().getAllBusinessObjectsForPictogramElement(getDiagram()),but
> these methods did not give me a help.I can only get an empty array.

This code gives you the business object(s) directly related to the
diagram itself, which is a PictogramElement. Sometimes this is the root
object of your model, but not always. You must use a PictogramElement
further down the Shape containment hierarchy.

I do
> not know why. I also tried getPictogramLinks() method on diagram,this
> method can help me to get all links and then get all business objs,but
> by this I get more than what I need. I know get the objs by filtering,
> but I think there should be a method provided by Graphiti to get domain
> model objs in an elegant way.
>
Previous Topic:Selection Listener
Next Topic:Property View - not refreshed after undo
Goto Forum:
  


Current Time: Sun Dec 21 15:51:28 GMT 2014

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

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