Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [bpmn2-modeler-dev] Custom task with extensionElements

Hi Bob,

Thank you very much for you example! It works like expected, however, when I created my code, following your example it did't work... I've found the cause only with debugger - I caught an exception at org.eclipse.bpmn2.modeler.ui.editor.BPMN2MultiPageEditor.createDesignEditor() line 191: java.lang.ClassCastException: sample.model.util.ModelResourceImpl cannot be cast to org.eclipse.bpmn2.util.Bpmn2ResourceImpl

Since the exception is caught and printed to the stderr, I didn't see it in the Eclipse Error log:

catch (Exception e) {
e.printStackTrace();
}

The ClassCast occurred because my ModelResourceImpl (generated from .genmodel) extends XMLResourceImpl, but not Bpmn2ResourceImpl.

I'm developing a simple workflow modeler with a set of custom tasks and I need that extension for the tasks configuration.

On Tue, Feb 5, 2013 at 1:13 AM, Bob Brodt <bbrodt@xxxxxxxxxx> wrote:
Hi Andrey,

I think the problem here may be that you haven't defined an extension model for your elements (or maybe you have and it's not quite correct?) The editor will not allow you to modify the BPMN2 metamodel directly, and so you have to define your own model with its own namespace for these extensions.

I have taken the liberty of creating a working plugin (attached) that contains the bare minimum of what is needed to get this to work.

Just out of curiosity, what is the nature of the project you are working on that requires this extension?

HTH,
Bob

________________________
Robert ("Bob") Brodt
Senior Software Engineer
JBoss by Red Hat


Hi,

I'm trying to implement a custom task with extensionElements. Something like this:

<task ...>
  <extensionElements>
    <myns:taskConfig>
      <myns:attribute name="name" value="value" />
    </myns:taskConfig>
   </extensionElements>
</task>

I tried the following extension point:

      <customTask
            id="sampe"
            runtimeId="my.runtime"
            name="Sampe Task"
            featureContainer="MyCustomTaskFeatureContainer"
            type="Task">
            
            <property name="extensionElements">
                <value>
                    <property name="taskConfig">
                        <value>
                            <property name="attribute">
                                <value>
                                    <property name="name" />
                                    <property name="value" />
                                </value>
                            </property>
                        </value>
                    </property>
                </value>
            </property>
      </customTask>

But it failed with  java.lang.IllegalArgumentException: The feature 'taskConfig' is not a valid feature

Can someone, please, point me the right way?
Thanks.

_______________________________________________
bpmn2-modeler-dev mailing list
bpmn2-modeler-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/bpmn2-modeler-dev


Back to the top