06-30-2015 05:51 PM
<serviceTask id="longRunningTask" name="Run Camel Route" activiti:async="true" activiti:type="camel"></serviceTask>
<sequenceFlow id="flow2" sourceRef="longRunningTask" targetRef="receiveTask"></sequenceFlow>
<receiveTask id="receiveTask" name="Wait for confirmation of camel route finishing"></receiveTask>
this.from("activiti://asyncTest:longRunningTask?copyVariablesFromProperties=true")
.routeId("asyncTest:longRunningTask")
// Do some long running type task here!
.log(LoggingLevel.DEBUG, "Releasing process")
// Release the receive task now….
.to("activiti://asyncTest:receiveTask?copyVariablesFromProperties=true");
Stacktrace
—————————————————————————————————————————————
java.lang.RuntimeException: Couldn't find activity receiveTask for processId 7 in defined timeout.
at org.activiti.camel.ActivitiProducer.signal(ActivitiProducer.java:123)
at org.activiti.camel.ActivitiProducer.process(ActivitiProducer.java:65)
at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:113)
07-01-2015 10:14 AM
07-01-2015 10:40 AM
07-01-2015 02:10 PM
@Override
public void configure() throws Exception {
- from("activiti:asyncCamelProcessRevisited:serviceTaskAsync1").to("bean:sleepBean?method=sleep").to("seda:continueAsync1");
- from("seda:continueAsync1").to("activiti:asyncCamelProcessRevisited:receive1");
+ from("activiti:asyncCamelProcessRevisited:serviceTaskAsync1").to("bean:sleepBean?method=sleep").to("activiti:asyncCamelProcessRevisited:receive1");
- from("activiti:asyncCamelProcessRevisited:serviceTaskAsync2").to("bean:sleepBean?method=sleep").to("bean:sleepBean?method=sleep").to("seda:continueAsync2");
- from("seda:continueAsync2").to("activiti:asyncCamelProcessRevisited:receive2");
+ from("activiti:asyncCamelProcessRevisited:serviceTaskAsync2").to("bean:sleepBean?method=sleep").to("bean:sleepBean?method=sleep").to("activiti:asyncCamelProcessRevisited:receive2");
}
});
Instead of sending the exchange to seda endpoints and having separate routes for the seda queues, I have ended the service task routes by sending them directly to the activiti endpoint to signal the receive tasks.
01:04:15,654 [Thread-8] INFO org.activiti.engine.impl.asyncexecutor.AcquireTimerJobsRunnable - {} starting to acquire async jobs due
01:04:15,654 [Thread-9] INFO org.activiti.engine.impl.asyncexecutor.AcquireAsyncJobsDueRunnable - {} starting to acquire async jobs due
01:04:18,657 [main] INFO org.activiti.engine.impl.asyncexecutor.DefaultAsyncJobExecutor - Shutting down the default async job executor [org.activiti.engine.impl.asyncexecutor.DefaultAsyncJobExecutor].
01:04:18,659 [Thread-8] INFO org.activiti.engine.impl.asyncexecutor.AcquireTimerJobsRunnable - {} stopped async job due acquisition
01:04:18,659 [Thread-9] INFO org.activiti.engine.impl.asyncexecutor.AcquireAsyncJobsDueRunnable - {} stopped async job due acquisition
01:04:21,256 [pool-1-thread-1] ERROR org.apache.camel.processor.DefaultErrorHandler - Failed delivery for (MessageId: ID-xx-1 on ExchangeId: ID-xx-3). Exhausted after delivery attempt: 1 caught: java.lang.RuntimeException: Couldn't find activity receive1 for processId 4 in defined timeout.
java.lang.RuntimeException: Couldn't find activity receive1 for processId 4 in defined timeout.
at org.activiti.camel.ActivitiProducer.signal(ActivitiProducer.java:123)
at org.activiti.camel.ActivitiProducer.process(ActivitiProducer.java:65)
at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
It seems very strange that we have to use asynchronous Camel via the seda component to make activiti:async="true" work for a service task.
10-01-2015 02:25 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.