Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Service Oriented Architecture Tools Platform (STP) » programmatic creation of the diagram
programmatic creation of the diagram [message #619007] Fri, 05 September 2008 10:00 Go to next message
faroun is currently offline farounFriend
Messages: 41
Registered: July 2009
Member
Hi Everybody ,

i'm now trying to hard code the creation of a bpmn diagram.
how can i start ? i'm trying with the bpmnProcessgenerator() Method under
org.eclipse.stp.diagram.generation.impl but i don't now where to start .

Best Regards ,

Dali.
Re: programmatic creation of the diagram [message #619014 is a reply to message #619007] Fri, 05 September 2008 11:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: atoulme.intalio.com

Hey Dali,

try taking a look at this sample:
http://wiki.eclipse.org/STP/BPMN_Component/Samples#BPEL_to_B PMN_generation

It's quite advanced, but if you remove the SAX handling you should be fine.

Thanks,

Antoine

dali wrote:
> Hi Everybody ,
>
> i'm now trying to hard code the creation of a bpmn diagram.
> how can i start ? i'm trying with the bpmnProcessgenerator() Method
> under org.eclipse.stp.diagram.generation.impl but i don't now where to
> start .
>
> Best Regards ,
>
> Dali.
>
Re: programmatic creation of the diagram [message #619023 is a reply to message #619014] Fri, 05 September 2008 13:38 Go to previous messageGo to next message
faroun is currently offline farounFriend
Messages: 41
Registered: July 2009
Member
Hi Antoine ,

Must generation to be based in a file ? in my case , i have a description
(semantic + graphics ) of the diagram stored in a database and i have to
generate the diagramme dynamicly from this description.

thanks a lot for ur help.

Dali.
Re: programmatic creation of the diagram [message #619027 is a reply to message #619023] Fri, 05 September 2008 13:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: atoulme.intalio.com

Yes, I think that the generated model uses a file for persistence.
However the file doesn't have to exist.

So if you use the default constructor for BPMNVisual2ProcessGenerator,
no file will be created.

faroun wrote:
> Hi Antoine ,
>
> Must generation to be based in a file ? in my case , i have a
> description (semantic + graphics ) of the diagram stored in a database
> and i have to generate the diagramme dynamicly from this description.
>
> thanks a lot for ur help.
>
> Dali.
>
>
>
Re: programmatic creation of the diagram [message #619513 is a reply to message #619027] Wed, 10 September 2008 13:21 Go to previous messageGo to next message
faroun is currently offline farounFriend
Messages: 41
Registered: July 2009
Member
Hi Antoine ,

thanx a lot for ur help .

i'm now creating the virtual diagram by subclassing the
BPMNVisual2ProcessGenerator.

i'm trying now to display the generated diagram . how can i pass the
generated diagram as an editor input to my bpmneditor ??

Best Regards ,


Dali
Re: programmatic creation of the diagram [message #619515 is a reply to message #619513] Wed, 10 September 2008 14:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: atoulme.intalio.com

faroun wrote:
> Hi Antoine ,
>
> thanx a lot for ur help .
>
> i'm now creating the virtual diagram by subclassing the
> BPMNVisual2ProcessGenerator.
>
> i'm trying now to display the generated diagram . how can i pass the
> generated diagram as an editor input to my bpmneditor ??
>
> Best Regards ,
>
>
> Dali
>
Dali, if you look at the previous thread you will find your solution.

Encapsulate the diagram you created into a IEditorInput implementation
and set it on the editor.

Then override the setDocumentProvider method to set your own document
provider that will load the diagram without trying to open it as a file.

Thanks,

Antoine
Re: programmatic creation of the diagram [message #619517 is a reply to message #619515] Thu, 11 September 2008 08:41 Go to previous messageGo to next message
faroun is currently offline farounFriend
Messages: 41
Registered: July 2009
Member
Hi Antoine ,

i don't understand what you mean by "Encapsulate the diagram you created
into an IEditorInput" .

one more question : How can i pass a diagram to the setDocumentProvider to
be loaded , is it the result of the generateView Method of the Bpel2bpmn
generator ?


Best Regards,

Dali.
Re: programmatic creation of the diagram [message #619519 is a reply to message #619517] Thu, 11 September 2008 09:09 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: atoulme.intalio.com

faroun wrote:
> Hi Antoine ,
>
> i don't understand what you mean by "Encapsulate the diagram you created
> into an IEditorInput" .
Well, what do you don't understand ?
>
> one more question : How can i pass a diagram to the setDocumentProvider
> to be loaded , is it the result of the generateView Method of the
> Bpel2bpmn generator ?
In an IEditorInput object.
>
>
> Best Regards,
>
> Dali.
>
>
Re: programmatic creation of the diagram [message #619521 is a reply to message #619519] Thu, 11 September 2008 09:21 Go to previous messageGo to next message
faroun is currently offline farounFriend
Messages: 41
Registered: July 2009
Member
Hi antoine ,

I'm following the Bpel2Bpmn Sample . My problem is how to get the diagram
Object to then pass it to the document provider ?.
I mean after the generateView Call , how can i get the diagram ?


Best Regards ,

Dali.
Re: programmatic creation of the diagram [message #619524 is a reply to message #619521] Thu, 11 September 2008 09:49 Go to previous messageGo to next message
faroun is currently offline farounFriend
Messages: 41
Registered: July 2009
Member
Hi antoine ,

i used the getGraphicalModel() form BpmnProcessgenerator to get the
diagram .

Now how can i encapsulate in an IEditorInput ??


Best Regards ,

Dali
Re: programmatic creation of the diagram [message #619527 is a reply to message #619524] Thu, 11 September 2008 10:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: atoulme.intalio.com

Since you are in a particular case where you want to feed the editor
with your very own data, you have to implement your own IEditorInput, or
maybe you could reuse DiagramEditorInput
(org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorInput ).

I hope it helps.

Antoine


faroun wrote:
> Hi antoine ,
>
> i used the getGraphicalModel() form BpmnProcessgenerator to get the
> diagram .
>
> Now how can i encapsulate in an IEditorInput ??
>
>
> Best Regards ,
>
> Dali
>
>
Re: programmatic creation of the diagram [message #619528 is a reply to message #619527] Thu, 11 September 2008 11:56 Go to previous messageGo to next message
faroun is currently offline farounFriend
Messages: 41
Registered: July 2009
Member
Hi Anttoine ,

when i pass a diagrameditorinput i'm getting the following exception :

org.eclipse.core.runtime.CoreException: ERROR
at
org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.Di agramDocumentEditor.createPartControl(DiagramDocumentEditor. java:1458)
at
org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:661)
at
org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:426)
at
org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:592)
at
org.eclipse.ui.internal.EditorReference.getEditor(EditorRefe rence.java:263)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2739)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2651)
at
org.eclipse.ui.internal.WorkbenchPage.access$13(WorkbenchPag e.java:2643)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2595)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:67)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2590)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2574)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2565)
at
ekipbpm.DB2BPMNGenerator.ParseAndGenerateFromDb(DB2BPMNGener ator.java:136)
at ekipbpm.TestHandler.execute(TestHandler.java:30)
at
org.eclipse.ui.internal.handlers.HandlerProxy.execute(Handle rProxy.java:239)
at org.eclipse.core.commands.Command.executeWithChecks(Command. java:475)
at
org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(ParameterizedCommand.java:429)
at
org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(HandlerService.java:165)
at
org.eclipse.ui.internal.handlers.SlaveHandlerService.execute Command(SlaveHandlerService.java:247)
at
org.eclipse.ui.menus.CommandContributionItem.handleWidgetSel ection(CommandContributionItem.java:555)
at
org.eclipse.ui.menus.CommandContributionItem.access$8(Comman dContributionItem.java:541)
at
org.eclipse.ui.menus.CommandContributionItem$3.handleEvent(C ommandContributionItem.java:531)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3682)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3293)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2389)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 19)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:289)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at ekipbpm.Application.start(Application.java:20)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:169)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(EclipseAppLauncher.java:106)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:76)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:363)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
at org.eclipse.equinox.launcher.Main.main(Main.java:1148)

i don't define any document provider , is it the reason.
can u help fix this ,


Best Regards ,

Dali.
Re: programmatic creation of the diagram [message #619531 is a reply to message #619528] Thu, 11 September 2008 12:53 Go to previous message
Eclipse UserFriend
Originally posted by: atoulme.intalio.com

Yep. You can get the GMF sources and see that for yourself.
Previous Topic:Using own EditorInput for generated (Bpmn)DiagramEditor
Next Topic:JBI instead of SCA Runtime
Goto Forum:
  


Current Time: Mon Dec 22 12:01:13 GMT 2014

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

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