Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BPMN 2.0 Modeler » Question about the org.eclipse.bpmn2.modeler.runtime extension point
Question about the org.eclipse.bpmn2.modeler.runtime extension point [message #793304] Wed, 08 February 2012 01:33 Go to next message
loic Missing name is currently offline loic Missing nameFriend
Messages: 6
Registered: December 2011
Junior Member
Hi,

I would like to create my own flavor of the bpmn2-modeler. My modeler would actually be simpler, and will only show a subset of all possible BPMN 2.0 elements. Typically, only 2 events (StartEvent and EndEvent), only one task (SimpleTask), etc.

The only extension point (org.eclipse.bpmn2.modeler.runtime) seems to provide a way to do this. I am just not sure exactly how Smile

Here is an example of what I tried:
<plugin>
   <extension
         point="org.eclipse.ui.editors">
      <editor
            class="com.example.ide.editors.editors.XMLEditor"
            contributorClass="org.eclipse.ui.texteditor.BasicTextEditorActionContributor"
            default="false"
            extensions="xml"
            icon="icons/sample.gif"
            id="com.example.ide.editors.editors.XMLEditor"
            name="Sample XML Editor">
      </editor>
   </extension>
   <extension
         point="org.eclipse.bpmn2.modeler.runtime">
      <runtime
            class="com.example.ide.editors.Bpmn2RuntimeExtension"
            description="My Modeler Description"
            id="com.example.ide.editors.runtime"
            name="MyModeler">
      </runtime>
      <modelEnablement
            runtimeId="com.example.ide.editors.runtime"
            type="Process">
        <disable object="all"/>
        <enable object="Process"/>
	<enable object="StartEvent"/>
	<enable object="EndEvent"/>
	<enable object="ExclusiveGateway"/>
	<enable object="InclusiveGateway"/>
	<enable object="ParallelGateway"/>
      </modelEnablement>
   </extension>

</plugin>


Testing this and I get a NPE when I try to create a new BPMN2 file. The wizard starts like expected, but when I hit the Finish buton, I get:
java.lang.NullPointerException
	at org.eclipse.bpmn2.modeler.core.runtime.BaseRuntimeDescriptor.getEPackage(BaseRuntimeDescriptor.java:37)
	at org.eclipse.bpmn2.modeler.core.runtime.ModelEnablementDescriptor.getEClass(ModelEnablementDescriptor.java:121)
	at org.eclipse.bpmn2.modeler.core.runtime.ModelEnablementDescriptor.setEnabled(ModelEnablementDescriptor.java:135)
	at org.eclipse.bpmn2.modeler.core.runtime.ModelEnablementDescriptor.setEnabled(ModelEnablementDescriptor.java:111)
	at org.eclipse.bpmn2.modeler.core.runtime.ModelEnablementDescriptor.setEnabled(ModelEnablementDescriptor.java:103)


So it seems that a "model" is required in my extension configuration, but I am not sure what it is used for, and what my ResourceFactoryImpl should be.

Any pointers I should look at for the "model" configuration ? or quick explanation ? Thanks.

Re: Question about the org.eclipse.bpmn2.modeler.runtime extension point [message #808627 is a reply to message #793304] Tue, 28 February 2012 00:40 Go to previous messageGo to next message
loic Missing name is currently offline loic Missing nameFriend
Messages: 6
Registered: December 2011
Junior Member
Forgot to post the solution. My understanding is that we need to specify a <model>. But since in my case, I don't want to add new features/artifacts in the model, I can simply reuse the original BPMN20. So the plugin.xml will look like:

<plugin>
   <extension
         point="org.eclipse.ui.editors">
      <editor
            class="com.example.ide.editors.editors.XMLEditor"
            contributorClass="org.eclipse.ui.texteditor.BasicTextEditorActionContributor"
            default="false"
            extensions="xml"
            icon="icons/sample.gif"
            id="com.example.ide.editors.editors.XMLEditor"
            name="Sample XML Editor">
      </editor>
   </extension>
   <extension
         point="org.eclipse.bpmn2.modeler.runtime">
      <runtime
            class="com.example.ide.editors.Bpmn2RuntimeExtension"
            description="My Modeler Description"
            id="com.example.ide.editors.runtime"
            name="MyModeler">
      </runtime>
      <model
            resourceFactory="org.eclipse.bpmn2.modeler.core.model.Bpmn2ModelerResourceFactoryImpl"
            runtimeId="com.example.ide.editors.runtime"
            uri="h_t_t_p://www.omg.org/spec/BPMN/20100524/MODEL">
      </model>
      <modelEnablement
            runtimeId="com.example.ide.editors.runtime"
            type="Process">
        <disable object="all"/>
        <enable object="Process"/>
	<enable object="StartEvent"/>
	<enable object="EndEvent"/>
	<enable object="ExclusiveGateway"/>
	<enable object="InclusiveGateway"/>
	<enable object="ParallelGateway"/>
      </modelEnablement>
   </extension>

</plugin>


I am not sure if it is the best/optimum way to simply filter the palette, if you have other suggestions feel free to post them.

Thanks.

NOTE: The URL is obviously malformed. This is to workaround a rule on this forum, that prevents me to post an URL...
Re: Question about the org.eclipse.bpmn2.modeler.runtime extension point [message #834898 is a reply to message #808627] Mon, 02 April 2012 14:35 Go to previous message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

Yep, sorry about that. Your runtime extension plugin should not have to provide an additional model. This has been fixed recently.

Bob
Previous Topic:BPMN2 Modeler now available for Helios
Next Topic:Question about variables in properties view
Goto Forum:
  


Current Time: Sat Oct 19 04:10:22 GMT 2019

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

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

Back to the top