get the pictogram element of a created bo

12 views
Skip to first unread message

Simone Di Cola

unread,
Jun 9, 2014, 12:57:17 PM6/9/14
to spray...@googlegroups.com
Hi Joerg,
  how do I get the pictogram element linked to a created bo?

This code seems to work:

  Guard deployedGuard = (Guard) super.create(context)[_FIRST];
  PictogramElement pe =  Graphiti.getLinkService().getPictogramElements(getDiagram(), deployedGuard)) 

but, as written in the documentation, it returns  all pictogram elements which references the given business object, not the one just created. 

Any idea?

Thanks
Simone

Simone Di Cola

unread,
Jun 9, 2014, 1:15:22 PM6/9/14
to spray...@googlegroups.com
As you can see here:

ID CREATED BO:uk.man.xman.xcore.impl.GuardImpl@1c0bc9 (fullName: null, showedName: null)

ID CREATED BO:uk.man.xman.xcore.impl.GuardImpl@2e7166 (fullName: null, showedName: null)

I've created two bo, that have two different Ids. So, how is it possible that the mothod  Graphiti.getLinkService().getPictogramElements(getDiagram(), deployedGuard))  returns the pictogram elements belonging to both of them? 

Simone

Jörg Reichert

unread,
Jun 9, 2014, 4:00:19 PM6/9/14
to spray...@googlegroups.com
http://www.eclipse.org/forums/index.php/t/223133/  and the there reference now resolved bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=335828

So best solution would be to give a new created business object an initial name in the create feature (e.g. name and if there's already an element with name 'name' use a counter 'name1' to make it unique). Afterwards you can bring up an dialog to the user to enter the real name.

Joerg
--
Sie erhalten diese Nachricht, weil Sie in Google Groups E-Mails von der Gruppe "spray-user" abonniert haben.
Wenn Sie sich von dieser Gruppe abmelden und keine E-Mails mehr von dieser Gruppe erhalten möchten, senden Sie eine E-Mail an spray-users...@googlegroups.com.
Weitere Optionen finden Sie unter https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages