Petals SE Flowable

Intermediate catch event message in a loop

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.2.0
  • Fix Version/s: 1.2.1
  • Component/s: Process service
  • Security Level: Public
  • Description:
    Hide

    With the given process definition where an intermediate catch event message is used in a loop, we can get the following error under following circumstances:

    • service tasks are set as asynchronous,
    • a service task fails because of a technical error. Retries will be done until the job is put as dead letter job.

    Once the job is put as dead letter job, if a service invocation is sent to submit the event, an error should occurs because no subscription is in progress but we get the following error:

    org.flowable.engine.common.api.FlowableException: Query return 2 results instead of max 1
                at org.flowable.engine.common.impl.AbstractQuery.executeSingleResult(AbstractQuery.java:165)
                at org.flowable.engine.common.impl.AbstractQuery.execute(AbstractQuery.java:145)
                at org.flowable.engine.impl.interceptor.CommandInvoker$1.run(CommandInvoker.java:51)
                at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperation(CommandInvoker.java:93)
                at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperations(CommandInvoker.java:72)
                at org.flowable.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:56)
                at org.flowable.engine.impl.interceptor.BpmnOverrideContextInterceptor.execute(BpmnOverrideContextInterceptor.java:25)
                at org.flowable.engine.common.impl.interceptor.TransactionContextInterceptor.execute(TransactionContextInterceptor.java:53)
                at org.flowable.engine.common.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:72)
                at org.flowable.engine.common.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)
                at org.flowable.engine.common.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56)
                at org.flowable.engine.common.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:51)
                at org.flowable.engine.common.impl.AbstractQuery.singleResult(AbstractQuery.java:104)
                at org.ow2.petals.flowable.incoming.operation.IntermediateMessageCatchEventOperation.investigateMissingExecution(IntermediateMessageCatchEventOperation.java:192)
                at org.ow2.petals.flowable.incoming.operation.IntermediateMessageCatchEventOperation.doExecute(IntermediateMessageCatchEventOperation.java:134)
                at org.ow2.petals.flowable.incoming.operation.FlowableOperation.execute(FlowableOperation.java:211)
                at org.ow2.petals.flowable.incoming.FlowableJBIListener.onJBIMessage(FlowableJBIListener.java:144)
                at org.ow2.petals.component.framework.process.MessageExchangeProcessor.invokeJBIListener(MessageExchangeProcessor.java:525)
                at org.ow2.petals.component.framework.process.MessageExchangeProcessor.processAsProvider(MessageExchangeProcessor.java:493)
                at org.ow2.petals.component.framework.process.MessageExchangeProcessor.process(MessageExchangeProcessor.java:283)
                at org.ow2.petals.component.framework.process.MessageExchangeProcessor.run(MessageExchangeProcessor.java:181)
                at org.ow2.petals.component.framework.process.JBIProcessorThreadPoolExecutor$ExchangeRunnable.run(JBIProcessorThreadPoolExecutor.java:90)
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
                at java.lang.Thread.run(Thread.java:748)
                at org.ow2.petals.component.framework.process.JBIProcessorThreadFactory$JBIProcessorThread.run(JBIProcessorThreadFactory.java:99)
    Show
    With the given process definition where an intermediate catch event message is used in a loop, we can get the following error under following circumstances:
    • service tasks are set as asynchronous,
    • a service task fails because of a technical error. Retries will be done until the job is put as dead letter job.
    Once the job is put as dead letter job, if a service invocation is sent to submit the event, an error should occurs because no subscription is in progress but we get the following error:
    org.flowable.engine.common.api.FlowableException: Query return 2 results instead of max 1
                at org.flowable.engine.common.impl.AbstractQuery.executeSingleResult(AbstractQuery.java:165)
                at org.flowable.engine.common.impl.AbstractQuery.execute(AbstractQuery.java:145)
                at org.flowable.engine.impl.interceptor.CommandInvoker$1.run(CommandInvoker.java:51)
                at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperation(CommandInvoker.java:93)
                at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperations(CommandInvoker.java:72)
                at org.flowable.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:56)
                at org.flowable.engine.impl.interceptor.BpmnOverrideContextInterceptor.execute(BpmnOverrideContextInterceptor.java:25)
                at org.flowable.engine.common.impl.interceptor.TransactionContextInterceptor.execute(TransactionContextInterceptor.java:53)
                at org.flowable.engine.common.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:72)
                at org.flowable.engine.common.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)
                at org.flowable.engine.common.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56)
                at org.flowable.engine.common.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:51)
                at org.flowable.engine.common.impl.AbstractQuery.singleResult(AbstractQuery.java:104)
                at org.ow2.petals.flowable.incoming.operation.IntermediateMessageCatchEventOperation.investigateMissingExecution(IntermediateMessageCatchEventOperation.java:192)
                at org.ow2.petals.flowable.incoming.operation.IntermediateMessageCatchEventOperation.doExecute(IntermediateMessageCatchEventOperation.java:134)
                at org.ow2.petals.flowable.incoming.operation.FlowableOperation.execute(FlowableOperation.java:211)
                at org.ow2.petals.flowable.incoming.FlowableJBIListener.onJBIMessage(FlowableJBIListener.java:144)
                at org.ow2.petals.component.framework.process.MessageExchangeProcessor.invokeJBIListener(MessageExchangeProcessor.java:525)
                at org.ow2.petals.component.framework.process.MessageExchangeProcessor.processAsProvider(MessageExchangeProcessor.java:493)
                at org.ow2.petals.component.framework.process.MessageExchangeProcessor.process(MessageExchangeProcessor.java:283)
                at org.ow2.petals.component.framework.process.MessageExchangeProcessor.run(MessageExchangeProcessor.java:181)
                at org.ow2.petals.component.framework.process.JBIProcessorThreadPoolExecutor$ExchangeRunnable.run(JBIProcessorThreadPoolExecutor.java:90)
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
                at java.lang.Thread.run(Thread.java:748)
                at org.ow2.petals.component.framework.process.JBIProcessorThreadFactory$JBIProcessorThread.run(JBIProcessorThreadFactory.java:99)
  • Environment:
    -

Activity

Hide
Christophe DENEUX added a comment - Tue, 7 Jan 2020 - 11:38:53 +0100 - edited

The problem is due to the investigation about the reason why no event subscription exists. A test accepts only one execution of the intermediate catch event per process instance but it can be executed several times in such use-cases with loop.

The investigation must be limited to:

  • the process instance does not exist,
  • the process instance is ended,
  • no event subscription exists.
Show
Christophe DENEUX added a comment - Tue, 7 Jan 2020 - 11:38:53 +0100 - edited The problem is due to the investigation about the reason why no event subscription exists. A test accepts only one execution of the intermediate catch event per process instance but it can be executed several times in such use-cases with loop. The investigation must be limited to:
  • the process instance does not exist,
  • the process instance is ended,
  • no event subscription exists.
Hide
Christophe DENEUX added a comment - Tue, 14 Jan 2020 - 17:12:02 +0100

Fixed in branch petals-se-flowable-junit-1.2.x

Merged in branches petals-se-flowable-1.3.x and master

Show
Christophe DENEUX added a comment - Tue, 14 Jan 2020 - 17:12:02 +0100 Fixed in branch petals-se-flowable-junit-1.2.x Merged in branches petals-se-flowable-1.3.x and master

People

Dates

  • Created:
    Tue, 7 Jan 2020 - 11:05:42 +0100
    Updated:
    Tue, 14 Jan 2020 - 17:12:02 +0100
    Resolved:
    Tue, 14 Jan 2020 - 17:12:02 +0100