2 Replies Latest reply on Mar 1, 2011 1:04 AM by lokeshsan

    Integrating jBPM BPMNModelEditor with eclipse RCP

    lokeshsan

      Hi,

       

      I have to integrate BPMNModelEditor with my RCP client.  I need to show the BPMNModelEditor as a page in a multipage editor.  None of the classes in the plugin "org.drools.eclipse" are exported, therefore I cannot use them.  No other means provided to plug to this editor.  When I try to open this editor (workbenchpage.openEditor...) by passing an IStorageEditorInput instance.  I get following exceptions.

       

      java.lang.IllegalArgumentException: Unknown model object null

          at org.drools.eclipse.flow.ruleflow.editor.editpart.RuleFlowEditPartFactory.createEditPart(RuleFlowEditPartFactory.java:96)

          at org.eclipse.gef.ui.parts.AbstractEditPartViewer.setContents(AbstractEditPartViewer.java:626)

          at org.drools.eclipse.flow.common.editor.GenericModelEditor.initializeGraphicalViewer(GenericModelEditor.java:177)

          at org.eclipse.gef.ui.parts.GraphicalEditor.createGraphicalViewer(GraphicalEditor.java:158)

          at org.eclipse.gef.ui.parts.GraphicalEditorWithPalette.createPartControl(GraphicalEditorWithPalette.java:63)

          at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:670)

          at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)

          at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)

          at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:289)

          at org.eclipse.ui.internal.WorkbenchPage.makeActiveEditor(WorkbenchPage.java:1268)

       

      What I could see from code is, there is an assumption that the IEditorInput to the editor will always be of type IFileEditorInput.  The createModel() function in BPMNModelEditor, does a type cast with this assumption.  If there is a failure in constructing model, then null is set as model.

       

      Can BPMNModelEditor be integrated with RCP application.  What is the best way to provide a jBPM editor in eclipse RCP.  I am not particular to open the jBPM editor as part of multi page editor.  I cannot show .jbpm files in my RCP.  I need to open jBPM editor based on stream based editor input.

       

      Any one who has integrated the BPMNModelEditor in there RCP application ?

       

      Any suggestion is hightly appreciated.

       

      Thanks and Regards,

      Lokesh

        • 1. Integrating jBPM BPMNModelEditor with eclipse RCP
          krisverlaenen

          In theory you should just be able to open up the editor.  However, the editor currently does assume you are providing a IFileEditorInput. 

           

          I would suggest you get the source code and adjust this so it works in your environment (for example add support for other input types, or export additional classes you might need).  Based on your detailed description of the issue, I assume this shouldn't take you too long.  You could then open up a JIRA with patch so we can add any changes you made to the codebase, so you can then start using the latest version.

           

          Kris

          • 2. Integrating jBPM BPMNModelEditor with eclipse RCP
            lokeshsan

            Thanks Kris,

             

            I will work towards, making the editor accept IStorageEditorInput type.

             

            Lokesh