End Message Event

968 views
Skip to first unread message

Gopan Sugathan

unread,
Mar 25, 2014, 8:05:53 AM3/25/14
to camunda-...@googlegroups.com
Hi ,

I have sub process within a main process and from the subprocess I am trying to send a message back to the main one.

For this purpose I am using end message event in the process.As per documentation end message is similar to service Task and we just need to implement a java delegate.

Using the Java delegate how do I send a message.

Do we need to use a external system like camel or a JmS queue for this purpose or is there api to send a message already pre built in camunda

Kind regards,
Gopan

Daniel Meyer

unread,
Mar 25, 2014, 8:48:06 AM3/25/14
to camunda-...@googlegroups.com
Hi Gopan,

you have to wait for the next release (end of this week):

then you can simply access the Runtime Service from the delegate:

public class AddVariablesService implements JavaDelegate {


 
@Override
 
public void execute(DelegateExecution execution) throws Exception {
   
   
RuntimeService runtimeService = execution.getProcessEngineServices()
     
.getRuntimeService();
   
    runtimeService
.createMessageCorrelation("messageName")
     
.processInstanceId("add id-of-main-process here!")
     
.correlate();      


 
}


}

At the moment execution.getProcessEngineServices() does not work yet. So you would have to get the Runtime service from somewhere else. (you could use @Inject with CDI or Spring)

Daniel


Gopan Sugathan

unread,
Mar 26, 2014, 1:22:23 AM3/26/14
to camunda-...@googlegroups.com
Hi Daniel,

Thank You that's wonderful news.

This particular code that's listed below will go inside the end message event.Can you please explain what this line does

runtimeService.createMessageCorrelation("messageName")
      
.processInstanceId("add id-of-main-process here!")
      
.correlate();      


There is an intermediate message event that waits for a particular message in the main process.So in the main process I should again do the correlation to correlate the message thats is send from sub process end message event


Kind regards,
Gopan.

Daniel Meyer

unread,
Mar 28, 2014, 4:26:32 AM3/28/14
to camunda-...@googlegroups.com
Hi Gopan,

runtimeService.createMessageCorrelation("messageName")
      
.processInstanceId("add id-of-main-process here!")
      
.correlate();  

can be used to send a message from one process instance to another, assuming that
- catching process instance is currently waiting for a message named "messageName"
- it is only waiting for one such message

No additional work is necessary inside the waiting ṕrocess instance. 

Regards,
Daniel Meyer

Gopan Sugathan

unread,
Mar 31, 2014, 1:50:30 AM3/31/14
to camunda-...@googlegroups.com
Thank You very much Daniel!

Gopan Sugathan

unread,
Apr 3, 2014, 7:49:27 AM4/3/14
to camunda-...@googlegroups.com
Hi ,

If I used a embedded sub process and not a call activity and this particular  subprocess is in multi instance loop.The embedded sub process has a human task followed by a end message and the main process has a intermediate catch message event.

I tried the following api and I am getting an error 
org.camunda.bpm.engine.MismatchingMessageCorrelationException: Cannot correlate message TestResult: No process definition or execution matches the parameters
at org.camunda.bpm.engine.impl.cmd.CorrelateMessageCmd.execute(CorrelateMessageCmd.java:75)
at org.camunda.bpm.engine.impl.cmd.CorrelateMessageCmd.execute(CorrelateMessageCmd.java:35)
at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:90)
at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:32)
at org.camunda.bpm.engine.impl.MessageCorrelationBuilderImpl.correlate(MessageCorrelationBuilderImpl.java:96)
at com.clearfood.bpm.retail.inbound.exceution.listeners.TestSession.notify(TestSession.java:19)
at org.camunda.bpm.engine.impl.delegate.ExecutionListenerInvocation.invoke(ExecutionListenerInvocation.java:34)

Is there something wrong that I am doing.Should I use a call activity in the main process to call a sub process .

Kind regards,
Gopan

Roman Smirnov

unread,
Apr 3, 2014, 8:27:37 AM4/3/14
to camunda-...@googlegroups.com
Hi Gopan,

I am not sure whether I understand your process completely. However, it is not possible to throw a message and to catch this message internally inside a process instance. This is not BPMN spec conform. It is only possible to throw a message and catch this message by different process instance, for example: process A throws a message and process B catches this message.

What is your use case? Could you provide your process model?

Cheers,
Roman

Gopan Sugathan

unread,
Apr 4, 2014, 1:16:30 AM4/4/14
to camunda-...@googlegroups.com
Hi Roman,

I am attaching a simple  process for your reference.

while executing the correlation I am getting the following error.I am attaching the correlation code for your reference 


public void notify(DelegateExecution execution) throws Exception {
/*ExecutionEntity execEntity = ((ExecutionEntity)execution);
ExecutionEntity parent = execEntity.getParent();*/
System.out.println("Inside TestSession current ................"+execution.getProcessInstanceId());
//System.out.println("Inside TestSession parentid ................"+parent.getProcessInstanceId());
RuntimeService runtime = execution.getProcessEngineServices().getRuntimeService();
try {
runtime.createMessageCorrelation("TestMessage").processInstanceId(execution.getProcessInstanceId()).correlate();
System.out.println("Correlation successful ###########");
}
catch(Exception e) {
System.out.println("Exception ###########");
e.printStackTrace();
}
}




Correlation successful ###########
Inside TestSession current ................1f0c5d85-bbb7-11e3-b38e-40f02f573f97
Correlation successful ###########
Apr 04, 2014 10:38:17 AM org.camunda.bpm.engine.impl.interceptor.CommandContext close
SEVERE: Error while closing command context
java.lang.NullPointerException
at org.camunda.bpm.engine.impl.pvm.runtime.AtomicOperationCancelScope.execute(AtomicOperationCancelScope.java:68)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:93)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:728)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:719)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.executeActivity(ExecutionEntity.java:535)
at org.camunda.bpm.engine.impl.event.AbstractEventHandler.handleEvent(AbstractEventHandler.java:57)
at org.camunda.bpm.engine.impl.persistence.entity.EventSubscriptionEntity.processEventSync(EventSubscriptionEntity.java:82)
at org.camunda.bpm.engine.impl.persistence.entity.EventSubscriptionEntity.eventReceived(EventSubscriptionEntity.java:73)
at org.camunda.bpm.engine.impl.cmd.MessageEventReceivedCmd.execute(MessageEventReceivedCmd.java:71)
at org.camunda.bpm.engine.impl.cmd.CorrelateMessageCmd.triggerExecution(CorrelateMessageCmd.java:89)
at org.camunda.bpm.engine.impl.cmd.CorrelateMessageCmd.execute(CorrelateMessageCmd.java:78)
at org.camunda.bpm.engine.impl.cmd.CorrelateMessageCmd.execute(CorrelateMessageCmd.java:35)
at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:90)
at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:32)
at org.camunda.bpm.engine.impl.MessageCorrelationBuilderImpl.correlate(MessageCorrelationBuilderImpl.java:96)
at com.clearfood.bpm.retail.inbound.exceution.listeners.TestSession.notify(TestSession.java:20)
at org.camunda.bpm.engine.impl.delegate.ExecutionListenerInvocation.invoke(ExecutionListenerInvocation.java:34)
at org.camunda.bpm.engine.impl.delegate.DelegateInvocation.proceed(DelegateInvocation.java:39)
at org.camunda.bpm.engine.impl.delegate.DefaultDelegateInterceptor.handleInvocation(DefaultDelegateInterceptor.java:42)
at org.camunda.bpm.engine.impl.bpmn.helper.ClassDelegate.notify(ClassDelegate.java:69)
at org.camunda.bpm.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:93)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:728)
at org.camunda.bpm.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:93)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:728)
at org.camunda.bpm.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:93)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:728)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:719)
at org.camunda.bpm.engine.impl.pvm.runtime.AtomicOperationTransitionCreateScope.execute(AtomicOperationTransitionCreateScope.java:54)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:93)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:728)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:719)
at org.camunda.bpm.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerStart.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerStart.java:52)
at org.camunda.bpm.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:63)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:93)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:728)
at org.camunda.bpm.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:93)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:728)
at org.camunda.bpm.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:93)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:728)
at org.camunda.bpm.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:93)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:728)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:719)
at org.camunda.bpm.engine.impl.pvm.runtime.AtomicOperationTransitionCreateScope.execute(AtomicOperationTransitionCreateScope.java:54)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:93)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:728)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:719)
at org.camunda.bpm.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerTake.execute(AtomicOperationTransitionNotifyListenerTake.java:73)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:93)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:728)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:719)
at org.camunda.bpm.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerTake.execute(AtomicOperationTransitionNotifyListenerTake.java:58)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:93)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:728)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:719)
at org.camunda.bpm.engine.impl.pvm.runtime.AtomicOperationTransitionDestroyScope.execute(AtomicOperationTransitionDestroyScope.java:117)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:93)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:728)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:719)
at org.camunda.bpm.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerEnd.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerEnd.java:36)






Kind regards
Gopan

On Tuesday, March 25, 2014 5:35:53 PM UTC+5:30, Gopan Sugathan wrote:
TestBPM.bpmn

Gopan Sugathan

unread,
Apr 4, 2014, 2:43:27 AM4/4/14
to camunda-...@googlegroups.com
Hi Gopan,

I tried tried to do the same thing with another process and I am getting the same error.Looks like the when you execute this 

runtime.createMessageCorrelation("TestMessage").processInstanceId(execution.getProcessInstanceId()).correlate();
This is getting executed 2 times

INFO: Processing resource subprocess.png
End message --- Going to correlate ###########
End message --- Correlation sucessful  ###########
End message --- Going to correlate ###########
End message --- Correlation sucessful  ###########
Apr 04, 2014 12:09:14 PM org.camunda.bpm.engine.impl.interceptor.CommandContext close
SEVERE: Error while closing command context
java.lang.NullPointerException
at org.camunda.bpm.engine.impl.pvm.runtime.AtomicOperationCancelScope.execute(AtomicOperationCancelScope.java:68)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:93)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:728)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:719)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.executeActivity(ExecutionEntity.java:535)
at org.camunda.bpm.engine.impl.event.AbstractEventHandler.handleEvent(AbstractEventHandler.java:57)
at org.camunda.bpm.engine.impl.persistence.entity.EventSubscriptionEntity.processEventSync(EventSubscriptionEntity.java:82)
at org.camunda.bpm.engine.impl.persistence.entity.EventSubscriptionEntity.eventReceived(EventSubscriptionEntity.java:73)
at org.camunda.bpm.engine.impl.cmd.MessageEventReceivedCmd.execute(MessageEventReceivedCmd.java:71)
at org.camunda.bpm.engine.impl.cmd.CorrelateMessageCmd.triggerExecution(CorrelateMessageCmd.java:89)
at org.camunda.bpm.engine.impl.cmd.CorrelateMessageCmd.execute(CorrelateMessageCmd.java:78)
at org.camunda.bpm.engine.impl.cmd.CorrelateMessageCmd.execute(CorrelateMessageCmd.java:35)
at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:90)
at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:32)
at org.camunda.bpm.engine.impl.MessageCorrelationBuilderImpl.correlate(MessageCorrelationBuilderImpl.java:96)
at com.clearfood.bpm.listeners.EndMessageListener.correlateBoundaryEvent(EndMessageListener.java:29)
at com.clearfood.bpm.listeners.EndMessageListener.notify(EndMessageListener.java:17)
at org.camunda.bpm.engine.impl.delegate.ExecutionListenerInvocation.invoke(ExecutionListenerInvocation.java:34)
at org.camunda.bpm.engine.impl.delegate.DelegateInvocation.proceed(DelegateInvocation.java:39)
at org.camunda.bpm.engine.impl.delegate.DefaultDelegateInterceptor.handleInvocation(DefaultDelegateInterceptor.java:42)
at org.camunda.bpm.engine.impl.bpmn.helper.ClassDelegate.notify(ClassDelegate.java:69)
at org.camunda.bpm.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:93)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:728)
at org.camunda.bpm.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:93)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:728)
at org.camunda.bpm.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:93)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:728)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:719)
at org.camunda.bpm.engine.impl.pvm.runtime.AtomicOperationTransitionCreateScope.execute(AtomicOperationTransitionCreateScope.java:54)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:93)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:728)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:719)
at org.camunda.bpm.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerStart.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerStart.java:52)



Kind regards,
Gopan

Gopan Sugathan

unread,
Apr 4, 2014, 3:20:13 AM4/4/14
to camunda-...@googlegroups.com
Hi ,

I tried with call activity also and I am getting an error saying  "org.camunda.bpm.engine.MismatchingMessageCorrelationException: Cannot correlate message TestMessage: No process definition or execution matches the parameters
"


I am attaching the project for reference.

The full error 

super id50a746ec-bbc8-11e3-b38e-40f02f573f97
End message --- current process ................52f555a4-bbc8-11e3-b38e-40f02f573f97
End message --- parent process ................50a746ec-bbc8-11e3-b38e-40f02f573f97
End message --- Going to correlate ###########
End message --- Correlation sucessful  ###########
Apr 04, 2014 12:41:25 PM org.camunda.bpm.engine.impl.interceptor.CommandContext close
SEVERE: Error while closing command context
org.camunda.bpm.engine.MismatchingMessageCorrelationException: Cannot correlate message TestMessage: No process definition or execution matches the parameters
at org.camunda.bpm.engine.impl.cmd.CorrelateMessageCmd.execute(CorrelateMessageCmd.java:75)
at org.camunda.bpm.engine.impl.cmd.CorrelateMessageCmd.execute(CorrelateMessageCmd.java:35)
at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:90)
at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:32)
at org.camunda.bpm.engine.impl.MessageCorrelationBuilderImpl.correlate(MessageCorrelationBuilderImpl.java:96)
at com.clearfood.bpm.listeners.EndMessageListener.correlateParentProcess(EndMessageListener.java:49)
at com.clearfood.bpm.listeners.EndMessageListener.notify(EndMessageListener.java:19)
at org.camunda.bpm.engine.impl.delegate.ExecutionListenerInvocation.invoke(ExecutionListenerInvocation.java:34)
at org.camunda.bpm.engine.impl.delegate.DelegateInvocation.proceed(DelegateInvocation.java:39)
at org.camunda.bpm.engine.impl.delegate.DefaultDelegateInterceptor.handleInvocation(DefaultDelegateInterceptor.java:42)
at org.camunda.bpm.engine.impl.bpmn.helper.ClassDelegate.notify(ClassDelegate.java:69)
at org.camunda.bpm.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:93)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:728)
at org.camunda.bpm.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:93)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:728)
at org.camunda.bpm.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:93)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:728)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:719)
at org.camunda.bpm.engine.impl.pvm.runtime.AtomicOperationTransitionCreateScope.execute(AtomicOperationTransitionCreateScope.java:54)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:93)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:728)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:719)
at org.camunda.bpm.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerTake.execute(AtomicOperationTransitionNotifyListenerTake.java:73)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:93)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:728)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:719)
at org.camunda.bpm.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerTake.execute(AtomicOperationTransitionNotifyListenerTake.java:58)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:93)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:728)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:719)
at org.camunda.bpm.engine.impl.pvm.runtime.AtomicOperationTransitionDestroyScope.execute(AtomicOperationTransitionDestroyScope.java:117)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:93)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:728)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:719)
at org.camunda.bpm.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerEnd.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerEnd.java:36)
at org.camunda.bpm.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:63)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:93)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:728)
at org.camunda.bpm.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:93)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:728)
at org.camunda.bpm.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:93)
at org.camunda.bpm.engine.impl.interceptor.CommandContext$1.call(CommandContext.java:77)
at org.camunda.bpm.engine.impl.interceptor.CommandContext$1.call(CommandContext.java:75)
at org.camunda.bpm.application.AbstractProcessApplication.execute(AbstractProcessApplication.java:100)
at org.camunda.bpm.engine.impl.context.Context.executeWithinProcessApplication(Context.java:147)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:75)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:728)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:719)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.take(ExecutionEntity.java:525)
at org.camunda.bpm.engine.impl.bpmn.behavior.BpmnActivityBehavior.performOutgoingBehavior(BpmnActivityBehavior.java:102)
at org.camunda.bpm.engine.impl.bpmn.behavior.BpmnActivityBehavior.performDefaultOutgoingBehavior(BpmnActivityBehavior.java:51)
at org.camunda.bpm.engine.impl.bpmn.behavior.FlowNodeActivityBehavior.leave(FlowNodeActivityBehavior.java:44)
at org.camunda.bpm.engine.impl.bpmn.behavior.AbstractBpmnActivityBehavior.leave(AbstractBpmnActivityBehavior.java:47)
at org.camunda.bpm.engine.impl.bpmn.behavior.UserTaskActivityBehavior.signal(UserTaskActivityBehavior.java:108)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.signal(ExecutionEntity.java:508)
at org.camunda.bpm.engine.impl.persistence.entity.TaskEntity.complete(TaskEntity.java:170)
at org.camunda.bpm.engine.impl.cmd.SubmitTaskFormCmd.execute(SubmitTaskFormCmd.java:90)
at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:90)
at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:32)
at org.camunda.bpm.engine.impl.FormServiceImpl.submitTaskForm(FormServiceImpl.java:82)
at org.camunda.bpm.engine.rest.sub.task.impl.TaskResourceImpl.submit(TaskResourceImpl.java:93)
at sun.reflect.GeneratedMethodAccessor489.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:167)
at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:257)
at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:222)
at org.jboss.resteasy.core.ResourceLocator.invokeOnTargetObject(ResourceLocator.java:159)
at org.jboss.resteasy.core.ResourceLocator.invoke(ResourceLocator.java:107)
at org.jboss.resteasy.core.ResourceLocator.invokeOnTargetObject(ResourceLocator.java:154)
at org.jboss.resteasy.core.ResourceLocator.invoke(ResourceLocator.java:92)
at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:542)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:524)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:126)
at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.camunda.bpm.engine.rest.filter.CacheControlFilter.doFilter(CacheControlFilter.java:47)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.camunda.bpm.webapp.impl.security.filter.SecurityFilter.doFilterSecure(SecurityFilter.java:67)
at org.camunda.bpm.webapp.impl.security.filter.SecurityFilter.doFilter(SecurityFilter.java:51)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.camunda.bpm.webapp.impl.security.auth.AuthenticationFilter$1.execute(AuthenticationFilter.java:59)
at org.camunda.bpm.webapp.impl.security.auth.AuthenticationFilter$1.execute(AuthenticationFilter.java:56)
at org.camunda.bpm.webapp.impl.security.SecurityActions.runWithAuthentications(SecurityActions.java:38)
at org.camunda.bpm.webapp.impl.security.auth.AuthenticationFilter.doFilter(AuthenticationFilter.java:56)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:409)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1044)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)



The full error stack


Kind regards,
Gopan
testsubprocess.zip

Roman Smirnov

unread,
Apr 4, 2014, 8:02:42 AM4/4/14
to camunda-...@googlegroups.com
Hi Gopan,

Concerning to your TestBPM.bpmn:

It is not possible to correlate a message to the same process instance! It is not conform with the BPMN specification and we do not recommend it to do this with the process engine:


...;

String processInstanceId = execution.getProcessInstanceId();

runtime
    .createMessageCorrelation("TestMessage")
    .processInstanceId(processInstance)
    .correlate();
 

That's why you get NullPointerException!

Concerning to you testsubprocess.zip:

You get a MismatchingMessageCorrelationException because when the message end event in the sub process is reached,  there does not exist any EventSubScription for the message catch event in the main process. Would you change the process in that way, that you remove the message catch event in the main process and attach instead a to the call activity a message boundary event. Then you would be able to correlate in the subprocess the message. But you would also get a NullPointerException like in the other case.

So it is not possible to correlate a message to the main process instance from the sub process instance which has been called from the main sub process.

Cheers,
Roman

Gopan Sugathan

unread,
Apr 7, 2014, 6:25:04 AM4/7/14
to camunda-...@googlegroups.com
Hi Roman,

Thank You for response.I solved this using a combination call activity send message and catch message event.


But isn't this is a common scenario to spwan mutiple sub processes from main process and later sync it using intermediate message event.

Please let me know your views on this.

Kind regards,
Gopan

On Tuesday, March 25, 2014 5:35:53 PM UTC+5:30, Gopan Sugathan wrote:
Reply all
Reply to author
Forward
0 new messages