Passing Parameters to query in the connetor to search the Data from MySql DB.

1
0
-1

Hi Gurus,

Am completely new to this Bonita BPM, using Bonita Open Solution 5.9.2 with tomcat 6.3.5 in windows environment. I could able to connect with the MySql DB and could insert & update data into it successfully, even could able to select data and display on Bonita Console page in a grid but Now the Question is: 1. I want to Search the Database based on Values provided in the Search form created in Bonita. 2. These searched values should be in the editing mode (i.e,.Could able to modify or update them through Bonita console) 3. And then could insert back to Database table.

My query (similar to this functionality) to search based on the variable value.

select * from taskmanager where 't_id' = '${variable}'

Error: org.ow2.bonita.util.GroovyException: Error in Groovy script: unable to use element "variable"

Possible cause: - missing import - variable not found (wrong name, undefined) - ...

Script: "variable" cause: No such property: variable for class: Script1 groovy.lang.MissingPropertyException: No such property: variable for class: Script1 at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:50) at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:49) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:231) at Script1.run(Script1.groovy:2) at org.ow2.bonita.util.GroovyUtil.evaluateGroovyExpression(GroovyUtil.java:227) at org.ow2.bonita.util.GroovyUtil.evaluate(GroovyUtil.java:263) at org.ow2.bonita.util.GroovyUtil.evaluate(GroovyUtil.java:196) at org.ow2.bonita.definition.activity.ConnectorExecutor.getEvaluatedExpression(ConnectorExecutor.java:504) at org.ow2.bonita.definition.activity.ConnectorExecutor.evaluateParametersWithGroovy(ConnectorExecutor.java:492) at org.ow2.bonita.definition.activity.ConnectorExecutor.setParameters(ConnectorExecutor.java:399) at org.ow2.bonita.definition.activity.ConnectorExecutor.executeConnector(ConnectorExecutor.java:709) at org.ow2.bonita.facade.impl.RuntimeAPIImpl.executeConnectorWithClassLoaderSet(RuntimeAPIImpl.java:1362) at org.ow2.bonita.facade.impl.RuntimeAPIImpl.access$200(RuntimeAPIImpl.java:122) at org.ow2.bonita.facade.impl.RuntimeAPIImpl$2.executeInClassLoader(RuntimeAPIImpl.java:1339) at org.ow2.bonita.facade.impl.RuntimeAPIImpl$ExecuteInClassLoader.execute(RuntimeAPIImpl.java:151) at org.ow2.bonita.facade.impl.RuntimeAPIImpl.executeConnector(RuntimeAPIImpl.java:1334) at org.ow2.bonita.facade.impl.RuntimeAPIImpl.executeConnector(RuntimeAPIImpl.java:1160) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.ow2.bonita.facade.APIInterceptor$APIInterceptorCommand.execute(APIInterceptor.java:115) at org.ow2.bonita.services.impl.DefaultCommandService.execute(DefaultCommandService.java:44) at org.ow2.bonita.runtime.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:45) at org.ow2.bonita.services.impl.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40) at org.ow2.bonita.services.impl.RetryInterceptor.execute(RetryInterceptor.java:59) at org.ow2.bonita.facade.APIInterceptor.invoke(APIInterceptor.java:187) at com.sun.proxy.$Proxy20.executeConnector(Unknown Source) at org.bonitasoft.studio.common.connectors.TestConnector$1.run(TestConnector.java:129) at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372) at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:507) at org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog.run(ProgressMonitorJobsDialog.java:275) at org.eclipse.ui.internal.progress.ProgressManager.run(ProgressManager.java:1162) at org.bonitasoft.studio.common.connectors.TestConnector.test(TestConnector.java:170) at org.bonitasoft.studio.connectors.wizards.DefaultGeneratedConnectorWizardPage.testConnector(DefaultGeneratedConnectorWizardPage.java:414) at org.bonitasoft.studio.connectors.wizards.DefaultGeneratedConnectorWizardPage$4.handleEvent(DefaultGeneratedConnectorWizardPage.java:392) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657) at org.eclipse.jface.window.Window.runEventLoop(Window.java:825) at org.eclipse.jface.window.Window.open(Window.java:801) at org.bonitasoft.studio.properties.sections.connectors.ConnectorsAndDeadlinesSection.updateConnectorAction(ConnectorsAndDeadlinesSection.java:377) at org.bonitasoft.studio.properties.sections.connectors.ConnectorsAndDeadlinesSection.access$0(ConnectorsAndDeadlinesSection.java:373) at org.bonitasoft.studio.properties.sections.connectors.ConnectorsAndDeadlinesSection$2.doubleClick(ConnectorsAndDeadlinesSection.java:203) at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:824) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49) at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175) at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:822) at org.eclipse.jface.viewers.AbstractTreeViewer.handleDoubleSelect(AbstractTreeViewer.java:1421) at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1225) at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:238) at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:235) at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:296) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593) at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427) at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.bonitasoft.studio.application.BonitaStudioApplication.start(BonitaStudioApplication.java:71) 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:369) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574) at org.eclipse.equinox.launcher.Main.run(Main.java:1407) at org.eclipse.equinox.launcher.Main.main(Main.java:1383)

Please help me out on those, if possible just refer me any link or guide/approach to follow. Every suggestion would be helped out me. Thanks in advance, looking forward to your replies.

Regards, San

1 answer

1
-2
-1

As you are completely new to Bonita BPM, can I suggest you download the latest version , as version 5.9 is 2 years-old and will not be supported for as long as latest 6.3 version?

By the way, connectors have been completely rewritten, and DB connectors are much easier to use from 6.x on.

Thanks, and hope you like it.

Notifications