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

It works for me...

On Tue, Feb 5, 2013 at 3:00 PM, Rui Domingues <rui.domingues@xxxxxxxxx> wrote:
Hi. Actually the example didnt work. When I try to create a "My Task" it gives me this stack.  It is setting something that should be a Collection but it is a single object.

Do you know why?

Thanks
rui domingues

!ENTRY org.eclipse.graphiti.ui 4 0 2013-02-05 10:55:35.060
!MESSAGE GFCommandStack.execute(Command) java.lang.ClassCastException: org.eclipse.emf.ecore.impl.EObjectImpl cannot be cast to java.util.Collection
!STACK 0
java.lang.ClassCastException: org.eclipse.emf.ecore.impl.EObjectImpl cannot be cast to java.util.Collection
    at org.eclipse.emf.ecore.util.BasicFeatureMap.set(BasicFeatureMap.java:1155)
    at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eOpenSet(BasicEObjectImpl.java:1141)
    at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eSet(BasicEObjectImpl.java:1075)
    at org.eclipse.bpmn2.modeler.core.runtime.ModelExtensionDescriptor.setValue(ModelExtensionDescriptor.java:395)
    at org.eclipse.bpmn2.modeler.core.runtime.ModelExtensionDescriptor.populateObject(ModelExtensionDescriptor.java:489)
    at org.eclipse.bpmn2.modeler.core.runtime.ModelExtensionDescriptor.populateObjectFromValues(ModelExtensionDescriptor.java:315)
    at org.eclipse.bpmn2.modeler.core.runtime.ModelExtensionDescriptor.populateObject(ModelExtensionDescriptor.java:490)
    at org.eclipse.bpmn2.modeler.core.runtime.ModelExtensionDescriptor.populateObject(ModelExtensionDescriptor.java:342)
    at org.eclipse.bpmn2.modeler.core.runtime.ModelExtensionDescriptor.populateObject(ModelExtensionDescriptor.java:329)
    at org.eclipse.bpmn2.modeler.core.features.AbstractBpmn2CreateFeature.createBusinessObject(AbstractBpmn2CreateFeature.java:98)
    at org.eclipse.bpmn2.modeler.core.features.AbstractCreateFlowElementFeature.create(AbstractCreateFlowElementFeature.java:67)
    at org.eclipse.bpmn2.modeler.ui.features.activity.task.CustomTaskFeatureContainer$CreateCustomTaskFeature.create(CustomTaskFeatureContainer.java:265)
    at org.eclipse.graphiti.features.impl.AbstractCreateFeature.execute(AbstractCreateFeature.java:100)
    at org.eclipse.graphiti.internal.command.GenericFeatureCommandWithContext.execute(GenericFeatureCommandWithContext.java:64)
    at org.eclipse.graphiti.internal.command.GFPreparableCommand.doExecute(GFPreparableCommand.java:37)
    at org.eclipse.emf.transaction.RecordingCommand.execute(RecordingCommand.java:135)
    at org.eclipse.graphiti.ui.internal.editor.GFWorkspaceCommandStackImpl.execute(GFWorkspaceCommandStackImpl.java:102)
    at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:219)
    at org.eclipse.graphiti.internal.command.CommandExec.executeCommand(CommandExec.java:86)
    at org.eclipse.graphiti.ui.internal.command.CreateModelObjectCommand.execute(CreateModelObjectCommand.java:54)
    at org.eclipse.graphiti.ui.internal.editor.EmfOnGefCommand.execute(EmfOnGefCommand.java:54)
    at org.eclipse.graphiti.internal.command.GFPreparableCommand2.doExecute(GFPreparableCommand2.java:37)
    at org.eclipse.emf.transaction.RecordingCommand.execute(RecordingCommand.java:135)
    at org.eclipse.emf.workspace.EMFCommandOperation.doExecute(EMFCommandOperation.java:119)
    at org.eclipse.emf.workspace.AbstractEMFOperation.execute(AbstractEMFOperation.java:150)
    at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:513)
    at org.eclipse.emf.workspace.impl.WorkspaceCommandStackImpl.doExecute(WorkspaceCommandStackImpl.java:208)
    at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:165)
    at org.eclipse.graphiti.ui.internal.editor.GFWorkspaceCommandStackImpl.execute(GFWorkspaceCommandStackImpl.java:83)
    at org.eclipse.graphiti.ui.internal.editor.GFCommandStack.execute(GFCommandStack.java:124)
    at org.eclipse.gef.tools.AbstractTool.executeCommand(AbstractTool.java:425)
    at org.eclipse.gef.tools.AbstractTool.executeCurrentCommand(AbstractTool.java:438)
    at org.eclipse.gef.tools.CreationTool.performCreation(CreationTool.java:269)
    at org.eclipse.gef.tools.CreationTool.handleButtonUp(CreationTool.java:189)
    at org.eclipse.gef.tools.AbstractTool.mouseUp(AbstractTool.java:1200)
    at org.eclipse.gef.EditDomain.mouseUp(EditDomain.java:301)
    at org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouseReleased(DomainEventDispatcher.java:380)
    at org.eclipse.draw2d.LightweightSystem$EventHandler.mouseUp(LightweightSystem.java:548)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:220)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1276)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3554)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3179)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1029)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:923)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:588)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1438)


2013/2/4 Bob Brodt <bbrodt@xxxxxxxxxx>
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

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




--

Rui G. Domingues
Skype id: rgdoms
Contacto: 914903721



Back to the top