Is it possible to have two business variables in one just process?

1
0
-1

I have two BDMs, each to receive the respective records from different tables, I generated a script that worked perfectly to add the records in a BDM, however if I try to add two Business Variables to my process, I can not save the records in the second BDM , My question at the end is, I can have two business variables in a single pool?

My log Error:

2017-02-06 18:32:17.984 -0200 INFORMAÇÕES: org.bonitasoft.engine.api.impl.transaction.process.DisableProcess THREAD_ID=62 | HOSTNAME=1773-INF05 | TENANT_ID=1 | The user <walter.bates> has disabled process <Fabricantes | Transportadoras> in version <1.0> with id <6355031436710791858>
2017-02-06 18:32:18.360 -0200 INFORMAÇÕES: org.bonitasoft.engine.api.impl.ProcessManagementAPIImplDelegate THREAD_ID=61 | HOSTNAME=1773-INF05 | TENANT_ID=1 | The user <walter.bates> has deleted process with id = <6355031436710791858>
2017-02-06 18:32:19.279 -0200 INFORMAÇÕES: org.bonitasoft.engine.bar.BusinessArchiveServiceImpl THREAD_ID=62 | HOSTNAME=1773-INF05 | TENANT_ID=1 | The user <walter.bates> has installed process <Fabricantes | Transportadoras> in version <1.0> with id <8230701561971885330>
2017-02-06 18:32:19.473 -0200 INFORMAÇÕES: org.bonitasoft.engine.api.impl.transaction.process.EnableProcess THREAD_ID=62 | HOSTNAME=1773-INF05 | TENANT_ID=1 | The user <walter.bates> has enabled process <Fabricantes | Transportadoras> in version <1.0> with id <8230701561971885330>
2017-02-06 18:32:22.471 -0200 INFORMAÇÕES: org.bonitasoft.engine.api.impl.ProcessStarter THREAD_ID=60 | HOSTNAME=1773-INF05 | TENANT_ID=1 | The user <walter.bates> has started the process instance <26034> of process <Fabricantes | Transportadoras> in version <1.0> and id <8230701561971885330>
2017-02-06 18:32:22.704 -0200 INFORMAÇÕES: org.bonitasoft.connectors.database.jdbc.JdbcConnector username postgres
2017-02-06 18:32:22.707 -0200 INFORMAÇÕES: org.bonitasoft.connectors.database.jdbc.JdbcConnector password ******
2017-02-06 18:32:22.707 -0200 INFORMAÇÕES: org.bonitasoft.connectors.database.jdbc.JdbcConnector script select * from public.fabricante order by codigo
2017-02-06 18:32:22.707 -0200 INFORMAÇÕES: org.bonitasoft.connectors.database.jdbc.JdbcConnector separator null
2017-02-06 18:32:22.707 -0200 INFORMAÇÕES: org.bonitasoft.connectors.database.jdbc.JdbcConnector driver org.postgresql.Driver
2017-02-06 18:32:22.707 -0200 INFORMAÇÕES: org.bonitasoft.connectors.database.jdbc.JdbcConnector url jdbc:postgresql://localhost:5432/BancoDados
2017-02-06 18:32:22.707 -0200 INFORMAÇÕES: org.bonitasoft.connectors.database.jdbc.JdbcConnector outputType null
2017-02-06 18:32:23.174 -0200 INFORMAÇÕES: org.bonitasoft.connectors.database.jdbc.JdbcConnector username postgres
2017-02-06 18:32:23.174 -0200 INFORMAÇÕES: org.bonitasoft.connectors.database.jdbc.JdbcConnector password ******
2017-02-06 18:32:23.174 -0200 INFORMAÇÕES: org.bonitasoft.connectors.database.jdbc.JdbcConnector script select * from public.transportadora order by codigo
2017-02-06 18:32:23.174 -0200 INFORMAÇÕES: org.bonitasoft.connectors.database.jdbc.JdbcConnector separator null
2017-02-06 18:32:23.175 -0200 INFORMAÇÕES: org.bonitasoft.connectors.database.jdbc.JdbcConnector driver org.postgresql.Driver
2017-02-06 18:32:23.175 -0200 INFORMAÇÕES: org.bonitasoft.connectors.database.jdbc.JdbcConnector url jdbc:postgresql://localhost:5432/BancoDados
2017-02-06 18:32:23.175 -0200 INFORMAÇÕES: org.bonitasoft.connectors.database.jdbc.JdbcConnector outputType null
2017-02-06 18:32:23.423 -0200 INFORMAÇÕES: org.bonitasoft
2017-02-06 18:32:23.429 -0200 INFORMAÇÕES: org.bonitasoft Codigo Transportadora: 1
2017-02-06 18:32:23.430 -0200 INFORMAÇÕES: org.bonitasoft Nome Transportadora: HSS
2017-02-06 18:32:23.430 -0200 INFORMAÇÕES: org.bonitasoft Status Transportadora: Ativo
2017-02-06 18:32:23.430 -0200 INFORMAÇÕES: org.bonitasoft
2017-02-06 18:32:23.430 -0200 INFORMAÇÕES: org.bonitasoft TESTE: 1
2017-02-06 18:32:23.436 -0200 GRAVE: org.bonitasoft.engine.execution.work.FailureHandlingBonitaWork THREAD_ID=98 | HOSTNAME=1773-INF05 | TENANT_ID=1 | The work [ExecuteConnectorOfActivity: flowNodeInstanceId = 520089, connectorDefinitionName = script] failed. The failure will be handled.
2017-02-06 18:32:23.450 -0200 GRAVE: org.bonitasoft.engine.execution.work.FailureHandlingBonitaWork THREAD_ID=98 | HOSTNAME=1773-INF05 | TENANT_ID=1 | org.bonitasoft.engine.core.connector.exception.SConnectorException : "PROCESS_DEFINITION_ID=8230701561971885330 | PROCESS_NAME=Fabricantes | Transportadoras | PROCESS_VERSION=1.0 | PROCESS_INSTANCE_ID=26034 | ROOT_PROCESS_INSTANCE_ID=26034 | FLOW_NODE_DEFINITION_ID=4778622056951523753 | FLOW_NODE_INSTANCE_ID=520089 | FLOW_NODE_NAME=Fabricantes | Transportadoras | CONNECTOR_IMPLEMENTATION_CLASS_NAME=script | CONNECTOR_INSTANCE_ID=400101 | org.bonitasoft.engine.connector.exception.SConnectorException: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke method setCodigo() on null object"
org.bonitasoft.engine.core.connector.exception.SConnectorException: PROCESS_DEFINITION_ID=8230701561971885330 | PROCESS_NAME=Fabricantes | Transportadoras | PROCESS_VERSION=1.0 | PROCESS_INSTANCE_ID=26034 | ROOT_PROCESS_INSTANCE_ID=26034 | FLOW_NODE_DEFINITION_ID=4778622056951523753 | FLOW_NODE_INSTANCE_ID=520089 | FLOW_NODE_NAME=Fabricantes | Transportadoras | CONNECTOR_IMPLEMENTATION_CLASS_NAME=script | CONNECTOR_INSTANCE_ID=400101 | org.bonitasoft.engine.connector.exception.SConnectorException: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke method setCodigo() on null object
at org.bonitasoft.engine.core.connector.impl.ConnectorServiceImpl.executeConnectorInClassloader(ConnectorServiceImpl.java:275)
at org.bonitasoft.engine.core.connector.impl.ConnectorServiceImpl.executeConnector(ConnectorServiceImpl.java:148)
at org.bonitasoft.engine.connector.ConnectorServiceDecorator.executeConnector(ConnectorServiceDecorator.java:114)
at org.bonitasoft.engine.execution.work.ExecuteConnectorWork.work(ExecuteConnectorWork.java:138)
at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:42)
at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:42)
at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:42)
at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:42)
at org.bonitasoft.engine.execution.work.FailureHandlingBonitaWork.work(FailureHandlingBonitaWork.java:66)
at org.bonitasoft.engine.work.BonitaWork.run(BonitaWork.java:56)
at org.bonitasoft.engine.work.SequenceRunnableExecutor.innerRun(SequenceRunnableExecutor.java:47)
at org.bonitasoft.engine.work.BonitaRunnable.run(BonitaRunnable.java:35)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.bonitasoft.engine.connector.exception.SConnectorException: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke method setCodigo() on null object
at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl.execute(ConnectorExecutorImpl.java:125)
at org.bonitasoft.engine.core.connector.impl.ConnectorServiceImpl.executeConnectorInClassloader(ConnectorServiceImpl.java:269)
... 14 more
Caused by: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke method setCodigo() on null object
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl.getValue(ConnectorExecutorImpl.java:149)
at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl.execute(ConnectorExecutorImpl.java:122)
... 15 more
Caused by: java.lang.NullPointerException: Cannot invoke method setCodigo() on null object
at org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:91)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:35)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at Script1.run(Script1.groovy:61)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:591)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:629)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:600)
at org.bonitasoft.connectors.scripting.GroovyScriptConnector.executeBusinessLogic(GroovyScriptConnector.java:48)
at org.bonitasoft.engine.connector.AbstractConnector.execute(AbstractConnector.java:77)
at org.bonitasoft.engine.core.connector.impl.SConnectorAdapter.execute(SConnectorAdapter.java:73)
at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl$ExecuteConnectorCallable.call(ConnectorExecutorImpl.java:205)
at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl$ExecuteConnectorCallable.call(ConnectorExecutorImpl.java:176)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
... 3 more

1 answer

1
+2
-1
This one is the BEST answer!

Yes you can have multiple bdm objects in the same process.

Make sure the bdm object you are trying to use has been initialized before calling the setCodifgo() method :
Cannot invoke method setCodigo() on null object"

How did you initialize those objects ?

Comments

Submitted by romualdo.s.rs on Tue, 02/07/2017 - 11:46

Thanks for the help and attention, I discovered now what was the error, I had not created the contract for my second BDM, after creating it the error did not occur any more and everything went well. Thanks for everything.

Testing
Notifications