Couldn't find waiting process instance with id '6301' for message 'AFI_GENERATED'

413 views
Skip to first unread message

Alfonso Mateos Alarcón

unread,
Feb 25, 2014, 3:30:41 AM2/25/14
to camunda-...@googlegroups.com
Hi guys,

When I use this into my camel route:

.to("camunda-bpm:message?messageName=AFI_GENERATED&&processDefinitionKey=recruitingProcess");

I get this error:

18:02:57,906 INFO  [org.apache.camel.processor.interceptor.Tracer] (http-localhost/127.0.0.1:8080-1) ID-alfonso-mbp-2-local-57649-1393261264225-0-2 >>> (route5) es.gc.epsilon.core.camel.routes.edn.EdnProcessor@3d280bf7 --> camunda-bpm://message?messageName=AFI_GENERATED <<< Pattern:InOut, Headers:{channelId=null}, BodyType:String, Body:<file id="es.gc.epsilon.core.dto.domain.FileDto@3a0e982" event="generated" />, Exception:java.lang.RuntimeException: Couldn't find waiting process instance with id '6301' for message 'AFI_GENERATED'

Could you please give me some hint on what's going on? the instance Id is 6301 and is correct. I also tried the route without including the processDefinitionKey parameter.

I don't know if it's due to a bad use of an intermediate message catch, just in case I attach a picture of my process diagram. My camel route is called from the servicetask named "Generar AFI", and I'd like to catch the message on the intermediate catch event just after that servicetask. It's on the upper flow path.




Bernd Rücker (camunda)

unread,
Feb 25, 2014, 3:41:45 AM2/25/14
to camunda-...@googlegroups.com

Hi Alfonso.

 

Can you send the BPMN XML also (or share it with camunda.org/share)? Did you define the message correctly and name it “AFI_GENERATED”? The Camel part looks correct from a first look.

 

Cheers

Bernd

--
You received this message because you are subscribed to the Google Groups "camunda BPM users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camunda-bpm-us...@googlegroups.com.
To post to this group, send email to camunda-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/camunda-bpm-users/23800bc9-0ab2-425c-819f-df8c4e855139%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Alfonso Mateos Alarcón

unread,
Feb 25, 2014, 7:20:51 AM2/25/14
to camunda-...@googlegroups.com
Hi Bernd,

I think the message it's correctly named inside the diagram, and it's selected as the message to be catched up in my intermediate event catcher...

Thanks for your attention

Bernd Rücker (camunda)

unread,
Feb 25, 2014, 7:58:30 AM2/25/14
to camunda-...@googlegroups.com

Hi Alfonso.

 

I think that the following happens: You send the message out to camel and trigger the response. This is received before the process instance is persisted in the state waiting for the message. This often happens if you do synchronous execution and directly trigger the response there. The answer is too early. Possible that this is the problem?

 

See http://docs.camunda.org/latest/guides/user-guide/#process-engine-transactions-in-processes as well.

 

Cheers

Bernd

 

Von: camunda-...@googlegroups.com [mailto:camunda-...@googlegroups.com] Im Auftrag von Alfonso Mateos Alarcón
Gesendet: Dienstag, 25. Februar 2014 13:21
An: camunda-...@googlegroups.com
Betreff: Re: [camunda-bpm-users] Couldn't find waiting process instance with id '6301' for message 'AFI_GENERATED'

 

Hi Bernd,

 

I think the message it's correctly named inside the diagram, and it's selected as the message to be catched up in my intermediate event catcher...

 

Thanks for your attention



El martes, 25 de febrero de 2014 09:41:45 UTC+1, Bernd Rücker escribió:

Hi Alfonso.

 

Can you send the BPMN XML also (or share it with camunda.org/share)? Did you define the message correctly and name it “AFI_GENERATED”? The Camel part looks correct from a first look.

 

Cheers

Bernd

 

Von: camunda-...@googlegroups.com [mailto:camunda-bpm-u...@googlegroups.com] Im Auftrag von Alfonso Mateos Alarcón
Gesendet: Dienstag, 25. Februar 2014 09:31
An: camunda-...@googlegroups.com
Betreff: [camunda-bpm-users] Couldn't find waiting process instance with id '6301' for message 'AFI_GENERATED'

 

Hi guys,

 

When I use this into my camel route:

.to("camunda-bpm:message?messageName=AFI_GENERATED&&processDefinitionKey=recruitingProcess");

I get this error:

18:02:57,906 INFO  [org.apache.camel.processor.interceptor.Tracer] (http-localhost/127.0.0.1:8080-1) ID-alfonso-mbp-2-local-57649-1393261264225-0-2 >>> (route5) es.gc.epsilon.core.camel.routes.edn.EdnProcessor@3d280bf7 --> camunda-bpm://message?messageName=AFI_GENERATED <<< Pattern:InOut, Headers:{channelId=null}, BodyType:String, Body:<file id="es.gc.epsilon.core.dto.domain.FileDto@3a0e982" event="generated" />, Exception:java.lang.RuntimeException: Couldn't find waiting process instance with id '6301' for message 'AFI_GENERATED'

Could you please give me some hint on what's going on? the instance Id is 6301 and is correct. I also tried the route without including the processDefinitionKey parameter.

 

I don't know if it's due to a bad use of an intermediate message catch, just in case I attach a picture of my process diagram. My camel route is called from the servicetask named "Generar AFI", and I'd like to catch the message on the intermediate catch event just after that servicetask. It's on the upper flow path.

 

 

 

Alfonso Mateos Alarcón

unread,
Feb 25, 2014, 10:19:02 AM2/25/14
to camunda-...@googlegroups.com
Hi Bernd, I think you are right, this could be the case, because I call my camel route by using 

camunda:expression="#{camel.sendTo('direct:generateAfiFile')}"

And then from inside the route I call .to(camunda-bpm:message...)

What would be the possible solutions here? I'm thinking on these approaches, could you help me to figure which is the best one?
1.- Replacing the intermediate catch event for a message task. But if the cause is "too early", may be this is not going to help me at all.

2.- Using a queue to implement an asynchronous mecanism: camunda calls one route which sends something to a queue, and then another route reads from it and calls Camuda. But even when it's asynchronous, may it also send that message to Camunda BPM "too early"?

Which would be your approach? Should I make sure that the process instance is in a waiting state before sending that message to camunda bpm?

Thanks in advance!

Bernd Rücker (camunda)

unread,
Feb 25, 2014, 10:23:40 AM2/25/14
to camunda-...@googlegroups.com

Hi Alfonso.

 

Since you use asynchronous BPMN constructs here the answer should be really asynchronous – even in test case environments. I think the easiest possibility is to use a queue in Camel – a in memory queue should be sufficient (SEDA?). It might still be faster than the commit of camunda – but in this case I would not even have a big problem with a small Thread.sleep within the route (for testing purposes) ;-)

 

Cheers

Bernd

Consultant & Evangelist (www.camunda.org/community/team.html)

We are hiring: http://www.camunda.org/community/jobs.html

You received this message because you are subscribed to the Google Groups "camunda BPM users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camunda-bpm-us...@googlegroups.com.
To post to this group, send email to camunda-...@googlegroups.com.

Alfonso Mateos Alarcón

unread,
Feb 26, 2014, 5:37:11 AM2/26/14
to camunda-...@googlegroups.com
Hi Bernd, thanks a lot for your advice.

I understand that's a good solution for testing purposes, but when it comes to real production scenarios, how could we ensure that the BPM engine has time enough to put the instance into wait state? Even when I make asynchronous the interaction between Camunda and Camel, the camel route can execute really fast, so I don't know how to face the problem in a more solid way...

Looking at the process I shared, could you give me any hint about what to do? May be change the process diagram? How? May be forcing an human task in the path which includes that intermediate catch event that would catch the message sent from Camunda?

I'd like to follow a path that is useful for production scenarios too...
Thanks a lot for sharing your knowledge and experience, Bernd.

Bernd Rücker (camunda)

unread,
Feb 26, 2014, 12:58:06 PM2/26/14
to camunda-...@googlegroups.com

HI Alfonso.

 

In real life I guess the answer will be received asynchronously. Otherwise the model does not make much sense.

 

So it is special for your current test code / prototype that you send the answer immediately from the camel route you call from the service task. So I would change this – as it does not correspond to the real life behavior anyway.

 

Summary: Process looks fine. Answer in Camel should be done asynchronously for testing purposes.

 

Hopefully clear what I mean?

 

Cheers

Bernd

 

Von: camunda-...@googlegroups.com [mailto:camunda-bpm-use...@googlegroups.com] Im Auftrag von Alfonso Mateos Alarcón
Gesendet: Mittwoch, 26. Februar 2014 11:37
An: camunda-...@googlegroups.com
Betreff: Re: [camunda-bpm-users] Couldn't find waiting process instance with id '6301' for message 'AFI_GENERATED'

 

Hi Bernd, thanks a lot for your advice.

--

You received this message because you are subscribed to the Google Groups "camunda BPM users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camunda-bpm-us...@googlegroups.com.
To post to this group, send email to camunda-...@googlegroups.com.

Alfonso Mateos Alarcón

unread,
Feb 27, 2014, 4:36:00 AM2/27/14
to camunda-...@googlegroups.com
Hi Bernd, let me make sure I understood, can you confirm that or correct me?

I understand that in real life, you mean make the call asynchronous by using queues:
1.- Camunda could call a route which sets a message to a queue.
2.- another route would read from that input queue and perform the tasks we want to be performed for that servicetask.
3.- from that camel route, send a message to an output queue.
4.- from another route, read that output queue and send the message AFI_GENERATED to Camunda.

May be steps 1 and 2 could be simplified by calling the camel route from Camunda and then still using the output queue? (steps 3 and 4, for the camel answer). I suppose this, after reading your answer and having a look at:
https://github.com/camunda/camunda-consulting/tree/master/showcases/camel-use-cases

Is that what you meant? 

I also saw another example where it shows how to implement an asynchronous servicetask:
https://github.com/camunda/camunda-bpm-examples/tree/master/servicetask/service-invocation-asynchronous

In this example it does not use camel, but it does use queues and callback functions. May be is this what you meant instead of my former understanding?

For tests scenarios, yes, I think I understood, it was just putting an extra wait loop.

Thanks a lot in advance Bernd, and thanks for your patience too.

Bernd Rücker (camunda)

unread,
Feb 27, 2014, 11:01:55 AM2/27/14
to camunda-...@googlegroups.com

Hi Alfonso.

 

In real life you are not forced to use queues. But if your service call is not asynchronous – then I would have expected that you use a ServiceTask (which is perfectly valid!) – not Message send and receive. So I expect you have an asynchronous answer there somewhere – I expect that to be the motivation for the whole design (and maybe even Camel) in the first place.

 

And then you have to simulate that real life behavior in testing as well. It should be done in the MOCk service you call via Camel.

 

Sorry for the short answer – hurrying from customer to customer. Maybe some consulting (workshop onsite or remote) would be best to better discuss these matters.

 

Cheers

Bernd

 

 

Von: camunda-...@googlegroups.com [mailto:camunda-...@googlegroups.com] Im Auftrag von Alfonso Mateos Alarcón
Gesendet: Donnerstag, 27. Februar 2014 10:36
An: camunda-...@googlegroups.com
Betreff: Re: [camunda-bpm-users] Couldn't find waiting process instance with id '6301' for message 'AFI_GENERATED'

 

Hi Bernd, let me make sure I understood, can you confirm that or correct me?

--

You received this message because you are subscribed to the Google Groups "camunda BPM users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camunda-bpm-us...@googlegroups.com.
To post to this group, send email to camunda-...@googlegroups.com.

Alfonso Mateos Alarcón

unread,
Feb 27, 2014, 12:43:27 PM2/27/14
to camunda-...@googlegroups.com
Thanks a lot, Bernd. Yes, my intention when using camel is to let the servicetask named "Generar AFI" to run asynchronously, because it generates a file, so it consumes disk usage and I think it will scale better being asynchronous.

Thanks again!
Reply all
Reply to author
Forward
0 new messages