cancel
Showing results for 
Search instead for 
Did you mean: 

NullPointerException when sending signal to recieve task

erensimsek
Champ in-the-making
Champ in-the-making
Hi.
There is a recieve task and in our BMP diagram and a timer boundary is connected it.
We set TimerBoundary 's time duration to  PT3M .

When we send signal to process instance of this diagram we get NullPointerException..

diagram.png:[img]http://imageupload.org/thumb/thumb_153558.png[/img]


Thank you.
6 REPLIES 6

trademak
Star Contributor
Star Contributor
Hi,

Can you tell me what input you use to signal the process instance?
Did the 3 minutes already pass? Do you have a stack trace?

Best regards,

erensimsek
Champ in-the-making
Champ in-the-making
Hi again,

Thank you for reply.
Actually we need a bpm design: process instanse must wait until a date..
but when we send signal it, it must going on to processing.

Did the 3 minutes already pass?: No.  We dont want to wait when a action in our business. 


We send signal like that:
ProcessInstance processInstance = runtimeService
    .createProcessInstanceQuery()
    .processInstanceId(procInstId)
    .singleResult();
   
Execution execution = runtimeService.createExecutionQuery()
    .processInstanceId(processInstance.getId()).list().get(0);
   
runtimeService.signal(execution.getId());


StackTrace:

Dec 23, 2011 12:52:56 PM org.activiti.engine.impl.interceptor.CommandContext close
SEVERE: Error while closing command context
java.lang.NullPointerException
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.signal(ExecutionEntity.java:313)
at org.activiti.engine.impl.cmd.SignalCmd.execute(SignalCmd.java:53)
at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42)
at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
at org.activiti.engine.impl.RuntimeServiceImpl.signal(RuntimeServiceImpl.java:131)
at tr.com.innova.ats.surec.service.impl.business.activiti.ActivitiIslemleriImpl.borcundanDolayiIptal(ActivitiIslemleriImpl.java:670)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy934.borcundanDolayiIptal(Unknown Source)

erensimsek
Champ in-the-making
Champ in-the-making
I think, l found the solution.

The BPM diagram must be like this:

diagramSignal.png:[img]http://imageupload.org/thumb/thumb_153638.png[/img]

erensimsek
Champ in-the-making
Champ in-the-making
Hi,

The BPM digaram must like that, but when we call signal mehod of runtime service, we get NullPointerException…

We call that method like this:

ProcessInstance processInstance = runtimeService
.createProcessInstanceQuery()
.processInstanceId(procInstId)
.singleResult();

Execution execution = runtimeService.createExecutionQuery()
.processInstanceId(processInstance.getId()).list().get(0);

runtimeService.signal(execution.getId());


How can we send signal to process inctance safely and correct..?

Thank you for answers..

Best regards.

lior1
Champ in-the-making
Champ in-the-making
Is there a solution for this? I see that the timer attached to a Receive Task causes another execution to be created, and sets many fields to null on the original execution (see AtomicOperationTransitionCreateScope::execute()). Specifically the problem is with  execution.setActivity(null), which causes the NPE when signalling for the original execution.

I don't know why there is another execution created, but the execution isn't usable in my case since it doesn't inherit the variables from the parent execution so I cannot query for it as I query for the original execution.

I'm using Actitivi 5.10. Problem also exists in 5.9.

dognose
Champ in-the-making
Champ in-the-making
After your Grubu task, start 2 paths, one pointing to an IntermediateTimer,
and one pointing to an IntermediateSignal Catching Event.

After the signal Catching, add a service task, setting a "flag" indicating that the
process continued.

The outgoing flow of the timer event should only be executed, when the flag is still false.

dunno if this is what you need:

[img]http://www.abload.de/img/altckr9f.png[/img]