Error calling another Process
Hello All,
The called process has a Long variable process which is used to load a BDM object. This process works perfectly with any number, given there is a corresponding entry in the table.
Now, when the caller sets this variable to an Id we now exists, we get the following error:
2017-07-31 11:38:44.043 -0400 SEVERE: org.bonitasoft.engine.execution.work.FailureHandlingBonitaWork THREAD_ID=151 | HOSTNAME=cesar-notebook | TENANT_ID=1 | org.bonitasoft.engine.core.process.instance.api.exceptions.SActivityStateExecutionException : "PROCESS_DEFINITION_ID=9180849936950979872 | PROCESS_NAME=Recepción Factura Proveedor | PROCESS_VERSION=1.1 | PROCESS_INSTANCE_ID=28001 | ROOT_PROCESS_INSTANCE_ID=28001 | FLOW_NODE_DEFINITION_ID=6685483459158934841 | FLOW_NODE_INSTANCE_ID=560006 | FLOW_NODE_NAME=Llamada al recepción de certificados | org.bonitasoft.engine.core.process.instance.api.exceptions.SProcessInstanceCreationException: org.bonitasoft.engine.core.operation.exception.SOperationExecutionException: org.bonitasoft.engine.operation.SEntityActionExecutionException: java.lang.Long is not a valid type. Expected an Entity or a List"
org.bonitasoft.engine.core.process.instance.api.exceptions.SActivityStateExecutionException: PROCESS_DEFINITION_ID=9180849936950979872 | PROCESS_NAME=Recepción Factura Proveedor | PROCESS_VERSION=1.1 | PROCESS_INSTANCE_ID=28001 | ROOT_PROCESS_INSTANCE_ID=28001 | FLOW_NODE_DEFINITION_ID=6685483459158934841 | FLOW_NODE_INSTANCE_ID=560006 | FLOW_NODE_NAME=Llamada al recepción de certificados | org.bonitasoft.engine.core.process.instance.api.exceptions.SProcessInstanceCreationException: org.bonitasoft.engine.core.operation.exception.SOperationExecutionException: org.bonitasoft.engine.operation.SEntityActionExecutionException: java.lang.Long is not a valid type. Expected an Entity or a List
at org.bonitasoft.engine.execution.StateBehaviors.handleCallActivity(StateBehaviors.java:419)
at org.bonitasoft.engine.execution.state.InitializingActivityWithBoundaryEventsStateImpl.afterConnectors(InitializingActivityWithBoundaryEventsStateImpl.java:98)
at org.bonitasoft.engine.execution.state.OnEnterOrOnFinishConnectorState.execute(OnEnterOrOnFinishConnectorState.java:65)
at org.bonitasoft.engine.execution.state.OnEnterOrOnFinishConnectorState.execute(OnEnterOrOnFinishConnectorState.java:34)
at org.bonitasoft.engine.execution.FlowNodeExecutorImpl.executeState(FlowNodeExecutorImpl.java:123)
at org.bonitasoft.engine.execution.FlowNodeExecutorImpl.updateState(FlowNodeExecutorImpl.java:174)
at org.bonitasoft.engine.execution.FlowNodeExecutorImpl.stepForward(FlowNodeExecutorImpl.java:158)
at org.bonitasoft.engine.execution.FlowNodeExecutorImpl.executeFlowNode(FlowNodeExecutorImpl.java:331)
at org.bonitasoft.engine.execution.work.ExecuteFlowNodeWork.work(ExecuteFlowNodeWork.java:85)
at org.bonitasoft.engine.execution.work.TxBonitaWork$1.call(TxBonitaWork.java:48)
at org.bonitasoft.engine.execution.work.TxBonitaWork$1.call(TxBonitaWork.java:44)
at org.bonitasoft.engine.transaction.JTATransactionServiceImpl.executeInTransaction(JTATransactionServiceImpl.java:274)
at org.bonitasoft.engine.execution.work.TxBonitaWork.work(TxBonitaWork.java:53)
at org.bonitasoft.engine.execution.work.LockProcessInstanceWork.work(LockProcessInstanceWork.java:79)
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 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.bonitasoft.engine.core.process.instance.api.exceptions.SProcessInstanceCreationException: org.bonitasoft.engine.core.operation.exception.SOperationExecutionException: org.bonitasoft.engine.operation.SEntityActionExecutionException: java.lang.Long is not a valid type. Expected an Entity or a List
at org.bonitasoft.engine.execution.ProcessExecutorImpl.start(ProcessExecutorImpl.java:837)
at org.bonitasoft.engine.execution.ProcessExecutorImpl.start(ProcessExecutorImpl.java:792)
at org.bonitasoft.engine.execution.StateBehaviors.instantiateProcess(StateBehaviors.java:447)
at org.bonitasoft.engine.execution.StateBehaviors.handleCallActivity(StateBehaviors.java:408)
... 21 more
Caused by: org.bonitasoft.engine.core.operation.exception.SOperationExecutionException: org.bonitasoft.engine.operation.SEntityActionExecutionException: java.lang.Long is not a valid type. Expected an Entity or a List
at org.bonitasoft.engine.operation.BusinessDataAssignmentStrategy.computeNewValueForLeftOperand(BusinessDataAssignmentStrategy.java:47)
at org.bonitasoft.engine.core.operation.impl.OperationServiceImpl.calculateRightOperandValue(OperationServiceImpl.java:122)
at org.bonitasoft.engine.core.operation.impl.OperationServiceImpl.executeOperators(OperationServiceImpl.java:105)
at org.bonitasoft.engine.core.operation.impl.OperationServiceImpl.execute(OperationServiceImpl.java:94)
at org.bonitasoft.engine.execution.ProcessExecutorImpl.executeOperations(ProcessExecutorImpl.java:365)
at org.bonitasoft.engine.execution.ProcessExecutorImpl.initialize(ProcessExecutorImpl.java:395)
at org.bonitasoft.engine.execution.ProcessExecutorImpl.start(ProcessExecutorImpl.java:822)
... 24 more
Caused by: org.bonitasoft.engine.operation.SEntityActionExecutionException: java.lang.Long is not a valid type. Expected an Entity or a List
at org.bonitasoft.engine.operation.EntitiesActionsExecutor.executeAction(EntitiesActionsExecutor.java:47)
at org.bonitasoft.engine.operation.BusinessDataAssignmentStrategy.computeNewValueForLeftOperand(BusinessDataAssignmentStrategy.java:45)
... 30 more
Both processes are in the same diagram, and we are using the community version.
Best regards,
If you need a parent process and a child process (created using a call activity) to both modify a same business data you need to:
- Declare a business variable in each process definition
- Configure Execution -> Data to send on the call activity to map the parent process business variable with the business variable in the called (child) process.
In this configuration both will actually work on the same business data. No need to map back the data from the child process to the parent process.
You can find an example in my example DataExchangePoolsCallActivityDiagram diagram.
If your use case is different maybe you can share your diagram to illustrate what you are trying to achieve.
Comments
Antoine,
Thank you for your answer.
Actually, we are mapping a Process variable of type Long. That's the weird thing: the child process has a Long process variable which we are setting (mapping) in the parent call.
The child process has other process and business variables, but those are not required to start de process so we don't map them.
Best regards.
If I understand correctly, you have:
Is that correct?
Maybe you can share your diagram or a simple example to reproduce the issue?
Antoine,
How can I share the diagram with you?
Cheers.
To share the diagram simply use the Export button of the Studio to create a .bos file (including at least diagram and business data model) and share it using Google Drive, Dropbox...
Which business variable are you trying to set in the "Llamada al recepción de certificados" task? It seems that issue is actually not related to the fact that you are calling a sub-process.
Antoine,
I will share the diagram. Anyway, the process relies in external data that is cumbersome to share.
I'm not trying to set any business variable. I'm setting a **process variable** of type Long. The variable is called sInvoiceId. The map is as follows:
retInvoiceId - Assigned to - sInvoiceId
The script retInvoiceId returns a Long object and contains:
`return invoice.getPersistenceId();`
If I remove the data mapping, the child process is launched. The first task in the child process assigns a BDM instance with `SInvoiceDAO.findByPersistenceId(sInvoice.longValue(), 0, 1)[0]`. So, if I don't do any mapping, it loads the instance 1. If I do a mapping, it fails with the aforementioned error.
Thank you again.
hi everyone,
please, someone can help me in this error !
USERNAME=tassadit | org.bonitasoft.engine.core.process.instance.api.exceptions.SProcessInstanceCreationException: PROCESS_DEFINITION_ID=5688488075277303865 | PROCESS_NAME=CNEP Banque | PROCESS_VERSION=1.0 | org.bonitasoft.engine.expression.exception.SExpressionEvaluationException: The content of the expression \u0022true\u0022 is not a number :true
@Yacine, the error reports that the value "true" is not a "number", meaning that you probably get a boolean value from your process instantiation form (SProcessInstanceCreationException in the error log message) and try to store it in a business variable or contract attribute with type integer, float...
Sharing more logs (e.g. full engine log file on Google Drive, Dropbox) and/or your process definition (as .bos file exported from Bonita Studio) can help to confirm that.
Also please post a new question rather then adding a comment on an existing one (except if you face exactly the same problem).