Both result in the same error. Here is a stack trace:
at org.camunda.bpm.engine.impl.variable.serializer.DefaultVariableSerializers.findSerializerForValue(DefaultVariableSerializers.java:84)
at org.camunda.bpm.engine.impl.persistence.entity.util.TypedValueField.setValue(TypedValueField.java:110)
at org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity.(VariableInstanceEntity.java:122)
at org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity.create(VariableInstanceEntity.java:141)
at org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntityFactory.build(VariableInstanceEntityFactory.java:27)
at org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntityFactory.build(VariableInstanceEntityFactory.java:21)
at org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope.setVariableLocalTransient(AbstractVariableScope.java:447)
at org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope.setVariableLocalTransient(AbstractVariableScope.java:453)
at org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope.setVariable(AbstractVariableScope.java:328)
at org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope.setVariable(AbstractVariableScope.java:306)
Thanks for the reply. I’ll have to elaborate. I don’t have any problem starting a process with a transient object variable. This problem only surfaces when I attempt to add such a variable when preparing to signal a process that is in a wait state. I execute a Command (using ProcessEngineConfigurationImpl.getCommandExecutorTxRequired()) which calls RuntimeService.signalEventReceived with a variable Map argument that contains a transient object variable (of the same type defined successfully at the beginning of the process). I cleaned this up a bit and this should be a better stack trace:
org.camunda.bpm.engine.ProcessEngineException: Cannot find serializer for value 'Untyped value 'com.emc.brs.workflow.manager.WorkflowDataAccess@6c2b9318 - dataSource=null', isTransient = true'.
at org.camunda.bpm.engine.impl.variable.serializer.DefaultVariableSerializers.findSerializerForValue(DefaultVariableSerializers.java:84)
at org.camunda.bpm.engine.impl.persistence.entity.util.TypedValueField.setValue(TypedValueField.java:110)
at org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity.<init>(VariableInstanceEntity.java:122)
at org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntity.create(VariableInstanceEntity.java:141)
at org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntityFactory.build(VariableInstanceEntityFactory.java:27)
at org.camunda.bpm.engine.impl.persistence.entity.VariableInstanceEntityFactory.build(VariableInstanceEntityFactory.java:21)
at org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope.setVariableLocalTransient(AbstractVariableScope.java:447)
at org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope.setVariableLocalTransient(AbstractVariableScope.java:453)
at org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope.setVariable(AbstractVariableScope.java:328)
at org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope.setVariable(AbstractVariableScope.java:323)
at org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope.setVariable(AbstractVariableScope.java:306)
at org.camunda.bpm.engine.impl.core.variable.scope.AbstractVariableScope.setVariables(AbstractVariableScope.java:253)
at org.camunda.bpm.engine.impl.event.EventHandlerImpl.handleIntermediateEvent(EventHandlerImpl.java:48)
at org.camunda.bpm.engine.impl.event.SignalEventHandler.handleEvent(SignalEventHandler.java:61)
at org.camunda.bpm.engine.impl.persistence.entity.EventSubscriptionEntity.processEventSync(EventSubscriptionEntity.java:106)
at org.camunda.bpm.engine.impl.persistence.entity.EventSubscriptionEntity.eventReceived(EventSubscriptionEntity.java:87)
at org.camunda.bpm.engine.impl.cmd.SignalEventReceivedCmd.notifyExecutions(SignalEventReceivedCmd.java:158)
at org.camunda.bpm.engine.impl.cmd.SignalEventReceivedCmd.sendSignalToExecution(SignalEventReceivedCmd.java:126)
at org.camunda.bpm.engine.impl.cmd.SignalEventReceivedCmd.execute(SignalEventReceivedCmd.java:64)
at org.camunda.bpm.engine.impl.cmd.SignalEventReceivedCmd.execute(SignalEventReceivedCmd.java:44)
at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:104)
at org.camunda.bpm.engine.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
at org.camunda.bpm.engine.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:66)
at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)
at org.camunda.bpm.engine.impl.SignalEventReceivedBuilderImpl.send(SignalEventReceivedBuilderImpl.java:91)
at org.camunda.bpm.engine.impl.RuntimeServiceImpl.signalEventReceived(RuntimeServiceImpl.java:579)
at com.emc.brs.workflow.manager.AsyncTaskMonitor$SignalCommand.execute(AsyncTaskMonitor.java:245)
at com.emc.brs.workflow.manager.AsyncTaskMonitor$SignalCommand.execute(AsyncTaskMonitor.java:1)
at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:104)
at org.camunda.bpm.engine.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
at org.camunda.bpm.engine.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:66)
at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)
at com.emc.brs.workflow.manager.AsyncTaskMonitor.executeCommand(AsyncTaskMonitor.java:105)
I am in the process of converting from Activiti, so it could be that I’m not properly using RuntimeService.signalEventReceived?
You should avoid using the Impl packages in general. There is no guarantee these won’t change. I would need to see the BPMN and the code to help more. I think your approach may not be ideal.
I am facing the same issue when trying to set a variable that doesn’t implement Serializable within a JavaDelegate of a service task. I set the variable as transient and am facing the same exception as above.
I also tried to start a process using the the code snippet in your example and I get the exact same exception.
The question is why is the engine trying to serialize a value that’s explicitly set as transient.