<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    BooleanDataType in work item definition causes ClassCastException in the BPMN2 process editor
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/osebelin">Olaf Sebelin</a> in <i>jBPM</i> - <a href="https://community.jboss.org/message/802702#802702">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Hi,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I defined a work item definition that has a boolean parameter. Entering a value for that boolean parameter in the BPMN2 process editor plugin in Eclipse, causes a ClassCastException when selecting the work item for display in the Properties tab.</p><p>This happens when I close the editor and reopen it. afterwards the selection of work items doesn't work properly. </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Stacktrace:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code jive-java">java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
&#160;&#160;&#160; at org.drools.process.core.datatype.impl.type.BooleanDataType.writeValue(BooleanDataType.java:52)
&#160;&#160;&#160; at org.drools.eclipse.flow.ruleflow.core.WorkItemWrapper.getPropertyValue(WorkItemWrapper.java:145)
&#160;&#160;&#160; at org.eclipse.ui.views.properties.PropertySheetEntry.refreshValues(PropertySheetEntry.java:611)
&#160;&#160;&#160; at org.eclipse.ui.views.properties.PropertySheetEntry.refreshChildEntries(PropertySheetEntry.java:568)
&#160;&#160;&#160; at org.eclipse.ui.views.properties.PropertySheetEntry.setValues(PropertySheetEntry.java:760)
&#160;&#160;&#160; at org.eclipse.ui.views.properties.PropertySheetViewer.setInput(PropertySheetViewer.java:973)
&#160;&#160;&#160; at org.eclipse.ui.views.properties.PropertySheetPage.selectionChanged(PropertySheetPage.java:510)
&#160;&#160;&#160; at org.eclipse.ui.views.properties.PropertySheet.selectionChanged(PropertySheet.java:363)
&#160;&#160;&#160; at org.eclipse.ui.internal.AbstractSelectionService.firePostSelection(AbstractSelectionService.java:179)
&#160;&#160;&#160; at org.eclipse.ui.internal.AbstractSelectionService$2.selectionChanged(AbstractSelectionService.java:71)
&#160;&#160;&#160; at org.eclipse.gef.ui.parts.AbstractEditPartViewer.fireSelectionChanged(AbstractEditPartViewer.java:247)
&#160;&#160;&#160; at org.eclipse.gef.ui.parts.AbstractEditPartViewer$1.run(AbstractEditPartViewer.java:131)
&#160;&#160;&#160; at org.eclipse.gef.SelectionManager.fireSelectionChanged(SelectionManager.java:144)
&#160;&#160;&#160; at org.eclipse.gef.SelectionManager.appendSelection(SelectionManager.java:83)
&#160;&#160;&#160; at org.eclipse.gef.ui.parts.AbstractEditPartViewer.appendSelection(AbstractEditPartViewer.java:190)
&#160;&#160;&#160; at org.eclipse.gef.ui.parts.AbstractEditPartViewer.select(AbstractEditPartViewer.java:599)
&#160;&#160;&#160; at org.eclipse.gef.tools.SelectEditPartTracker.performSelection(SelectEditPartTracker.java:221)
&#160;&#160;&#160; at org.eclipse.gef.tools.SelectEditPartTracker.performConditionalSelection(SelectEditPartTracker.java:167)
&#160;&#160;&#160; at org.eclipse.gef.tools.SelectEditPartTracker.handleButtonDown(SelectEditPartTracker.java:92)
&#160;&#160;&#160; at org.eclipse.gef.tools.AbstractTool.mouseDown(AbstractTool.java:1091)
&#160;&#160;&#160; at org.eclipse.gef.tools.SelectionTool.mouseDown(SelectionTool.java:514)
&#160;&#160;&#160; at org.eclipse.gef.EditDomain.mouseDown(EditDomain.java:245)
&#160;&#160;&#160; at org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMousePressed(DomainEventDispatcher.java:348)
&#160;&#160;&#160; at org.eclipse.draw2d.LightweightSystem$EventHandler.mouseDown(LightweightSystem.java:523)
&#160;&#160;&#160; at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:191)
&#160;&#160;&#160; at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
&#160;&#160;&#160; at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
&#160;&#160;&#160; at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3588)
&#160;&#160;&#160; at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3209)
&#160;&#160;&#160; at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
&#160;&#160;&#160; at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
&#160;&#160;&#160; at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
&#160;&#160;&#160; at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
&#160;&#160;&#160; at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
&#160;&#160;&#160; at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
&#160;&#160;&#160; at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
&#160;&#160;&#160; at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
&#160;&#160;&#160; at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
&#160;&#160;&#160; at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
&#160;&#160;&#160; at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
&#160;&#160;&#160; at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
&#160;&#160;&#160; at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
&#160;&#160;&#160; at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
&#160;&#160;&#160; at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
&#160;&#160;&#160; at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
&#160;&#160;&#160; at java.lang.reflect.Method.invoke(Method.java:597)
&#160;&#160;&#160; at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
&#160;&#160;&#160; at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
&#160;&#160;&#160; at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>The exception can be reproduced with the following simple example work item definition.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><pre class="jive-pre"><code class="jive-code">import org.drools.process.core.datatype.impl.type.BooleanDataType;
import org.drools.process.core.datatype.impl.type.StringDataType;
import org.drools.process.core.datatype.impl.type.ObjectDataType;

[
&#160; [
&#160;&#160;&#160; "name" : "MyTask", 
&#160;&#160;&#160; "displayName" : "My Task",
&#160;&#160;&#160; "parameters" : [ 
&#160;&#160;&#160;&#160;&#160; "MyStringParam" : new StringDataType(), 
&#160;&#160;&#160;&#160;&#160; "MyBoolParam" : new BooleanDataType() 
&#160;&#160;&#160; ], 
&#160;&#160;&#160; "results" : [ 
&#160;&#160;&#160;&#160;&#160; "Result" : new ObjectDataType("java.util.Map") 
&#160;&#160;&#160; ], 
&#160;&#160;&#160; "displayName" : "My Task", 
&#160; ]
]
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>The editor field for the "MyBoolParam" is a text field. What do I have to do ta make this a boolean editor field (e.g. a drop down box like the Terminate parameter&#160; in the End Event)?</p><p>BTW, This occurs with IntegerDataTypes, too. </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Thank you for your help</p><p>Olaf</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/802702#802702">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in jBPM at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>