Hi,
I have a problem with a new object I created in the BDM.
I created an object "Autorisation" and added 2 variables of this type in an existing object "MainModel".
In a form, I return a json array of Autorisation and in the task operation, I have a script to set the variable of the MainModel :
import com.company.model.Autorisation
import java.util.logging.Logger
Logger logger = Logger.getLogger("org.bonitasoft.TOREA")
List<Autorisation> autors = new ArrayList<Autorisation>();
for( int i=0; i< contract_autorList.size(); i++ ){
Autorisation aa = new Autorisation();
Map aaIn = contract_autorList[i];
aa.name = (String) aaIn.get( "name" );
logger.info( "name : "+ aa.name );
aa.contact = (String) aaIn.get( "contact" );
logger.info( "contact : "+ aa.contact );
aa.email = (String) aaIn.get( "email" ); ;
logger.info( "email : "+ aa.email );
autors.add( aa ); // if commented, there is no exception
}
return autors;
According to the log, I get the correct values but if the list I return is not empty, I get :
SBusinessDataNotFoundException: persistenceId of business data is null
What's happening and how could I fix this?
The complete exception is :
2020-05-25 09:22:53.907 -1000 AVERTISSEMENT: com.bonitasoft.engine.work.DefaultExceptionRetryabilityEvaluator THREAD_ID=286 | HOSTNAME=LAPTOP-KRQ98MIU | TENANT_ID=1 | Will NOT retry, nothing matching exception found: Exceptions:
↳org.bonitasoft.engine.core.process.instance.api.exceptions.SActivityStateExecutionException
↳org.bonitasoft.engine.core.operation.exception.SOperationExecutionException
↳org.bonitasoft.engine.business.data.SBusinessDataNotFoundException
2020-05-25 09:22:53.907 -1000 GRAVE: org.bonitasoft.engine.execution.work.InSessionBonitaWork THREAD_ID=286 | HOSTNAME=LAPTOP-KRQ98MIU | TENANT_ID=1 | The work [ExecuteFlowNodeWork: flowNodeInstanceId: 860129] failed. The failure will be handled.
2020-05-25 09:22:53.911 -1000 GRAVE: org.bonitasoft.engine.execution.work.InSessionBonitaWork THREAD_ID=286 | HOSTNAME=LAPTOP-KRQ98MIU | TENANT_ID=1 | org.bonitasoft.engine.core.process.instance.api.exceptions.SActivityStateExecutionException : "PROCESS_DEFINITION_ID=7081415389616795948 | PROCESS_NAME=liaison TE ATA 2 ou LLO fibre dédiée | PROCESS_VERSION=1.8 | PROCESS_INSTANCE_ID=41003 | ROOT_PROCESS_INSTANCE_ID=41003 | FLOW_NODE_DEFINITION_ID=6553067091763538825 | FLOW_NODE_INSTANCE_ID=860129 | FLOW_NODE_NAME=Montage projet Cablage | org.bonitasoft.engine.core.operation.exception.SOperationExecutionException: org.bonitasoft.engine.business.data.SBusinessDataNotFoundException: persistenceId of business data is null"
org.bonitasoft.engine.core.process.instance.api.exceptions.SActivityStateExecutionException: PROCESS_DEFINITION_ID=7081415389616795948 | PROCESS_NAME=liaison TE ATA 2 ou LLO fibre dédiée | PROCESS_VERSION=1.8 | PROCESS_INSTANCE_ID=41003 | ROOT_PROCESS_INSTANCE_ID=41003 | FLOW_NODE_DEFINITION_ID=6553067091763538825 | FLOW_NODE_INSTANCE_ID=860129 | FLOW_NODE_NAME=Montage projet Cablage | org.bonitasoft.engine.core.operation.exception.SOperationExecutionException: org.bonitasoft.engine.business.data.SBusinessDataNotFoundException: persistenceId of business data is null
at org.bonitasoft.engine.execution.StateBehaviors.executeOperations(StateBehaviors.java:565)
at org.bonitasoft.engine.execution.state.ReadyActivityStateImpl.onEnterToOnFinish(ReadyActivityStateImpl.java:47)
at org.bonitasoft.engine.execution.state.OnEnterAndFinishConnectorState.execute(OnEnterAndFinishConnectorState.java:67)
at org.bonitasoft.engine.execution.state.OnEnterAndFinishConnectorState.execute(OnEnterAndFinishConnectorState.java:1)
at org.bonitasoft.engine.execution.FlowNodeExecutorImpl.executeState(FlowNodeExecutorImpl.java:133)
at org.bonitasoft.engine.execution.FlowNodeExecutorImpl.updateState(FlowNodeExecutorImpl.java:184)
at org.bonitasoft.engine.execution.FlowNodeExecutorImpl.stepForward(FlowNodeExecutorImpl.java:168)
at org.bonitasoft.engine.execution.FlowNodeExecutorImpl.executeFlowNode(FlowNodeExecutorImpl.java:348)
at org.bonitasoft.engine.execution.work.ExecuteFlowNodeWork.work(ExecuteFlowNodeWork.java:86)
at org.bonitasoft.engine.execution.work.TxBonitaWork.lambda$0(TxBonitaWork.java:42)
at org.bonitasoft.engine.transaction.JTATransactionServiceImpl.executeInTransaction(JTATransactionServiceImpl.java:274)
at org.bonitasoft.engine.execution.work.TxBonitaWork.work(TxBonitaWork.java:42)
at org.bonitasoft.engine.execution.work.LockProcessInstanceWork.work(LockProcessInstanceWork.java:63)
at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:41)
at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:41)
at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:41)
at org.bonitasoft.engine.execution.work.InSessionBonitaWork.work(InSessionBonitaWork.java:59)
at org.bonitasoft.engine.work.BonitaThreadPoolExecutor.lambda$submit$1(BonitaThreadPoolExecutor.java:98)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.bonitasoft.engine.core.operation.exception.SOperationExecutionException: org.bonitasoft.engine.business.data.SBusinessDataNotFoundException: persistenceId of business data is null
at org.bonitasoft.engine.operation.BusinessDataJavaMethodOperationExecutorStrategy.delegateBusinessValueForLeftOperand(BusinessDataJavaMethodOperationExecutorStrategy.java:68)
at org.bonitasoft.engine.operation.BusinessDataJavaMethodOperationExecutorStrategy.computeNewValueForLeftOperand(BusinessDataJavaMethodOperationExecutorStrategy.java:46)
at org.bonitasoft.engine.core.operation.impl.OperationServiceImpl.calculateRightOperandValue(OperationServiceImpl.java:124)
at org.bonitasoft.engine.core.operation.impl.OperationServiceImpl.executeOperators(OperationServiceImpl.java:106)
at org.bonitasoft.engine.core.operation.impl.OperationServiceImpl.execute(OperationServiceImpl.java:95)
at org.bonitasoft.engine.core.operation.impl.OperationServiceImpl.execute(OperationServiceImpl.java:82)
at org.bonitasoft.engine.execution.StateBehaviors.executeOperations(StateBehaviors.java:562)
... 20 more
Caused by: org.bonitasoft.engine.business.data.SBusinessDataNotFoundException: persistenceId of business data is null
at org.bonitasoft.engine.business.data.impl.BusinessDataServiceImpl.getPrimaryKeys(BusinessDataServiceImpl.java:180)
at org.bonitasoft.engine.business.data.impl.BusinessDataServiceImpl.getPersistedValues(BusinessDataServiceImpl.java:192)
at org.bonitasoft.engine.business.data.impl.BusinessDataServiceImpl.loadValueToSet(BusinessDataServiceImpl.java:168)
at org.bonitasoft.engine.business.data.impl.BusinessDataServiceImpl.callJavaOperationOnEntity(BusinessDataServiceImpl.java:142)
at org.bonitasoft.engine.business.data.impl.BusinessDataServiceImpl.callJavaOperation(BusinessDataServiceImpl.java:119)
at org.bonitasoft.engine.operation.BusinessDataJavaMethodOperationExecutorStrategy.delegateBusinessValueForLeftOperand(BusinessDataJavaMethodOperationExecutorStrategy.java:62)
... 26 more