cancel
Showing results for 
Search instead for 
Did you mean: 

intermediate catch events won't repeat

stephsmith
Champ in-the-making
Champ in-the-making
For backwards compatibility, we need to start a timer when a workflow process is started.
The start node is modeled to go from the start node to the timer…and from the start mode to the first user task in the flow.

The timer is basically used to send email notifications every so often.
I tried modeling a intermediate catching timer event, but the repeat never occurs.

This comment is in org.activiti.engine.impl.jobexecutor.TimerDeclarationImpl in the prepareTimerEntity() method. It mentions
// ACT-1951: intermediate catching timer events shouldn't repeat according to spec
        if(TimerCatchIntermediateEventJobHandler.TYPE.equals(jobHandlerType)) {
            repeat = false;
        }

Can you point out in the spec where it mentions this? I am having trouble finding it so your help would be appreciated.

Also, if this cannot be supported, my second question is, any suggestions on how to get around this? Cannot use a user task/boundary event as this is not a user task in this scenario.

5 REPLIES 5

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

I would say that you can model it in the BPMN


–>Timer->ExclusiveGateway +—–>
    ^——————–|
                     loop

Regards
Martin

stephsmith
Champ in-the-making
Champ in-the-making
If I could use an intermediate catch timer event, then I could just use the <timeCycle> with the ISO8601 repeat syntax.
Unless I"m missing something, the way that you suggest above doesn't allow me to do that. WE need the same type of "repeat" support such as repeat for some many occurences, or repeat every so often until a given date, etc. 
How would that work above?

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

I did not create jUnit test for the described case, but I would do the following:
let's say: repeat 10 times

counter= 10

–> timer –>  counter–  –> exclusiveGateway – counter == 0 –> end
       ^———-  counter > 0 —-+                                         

stephsmith
Champ in-the-making
Champ in-the-making
Lets say you wanted to model something like this
Repeat 5 times, starting on April 30, 2015 and repeat every 60 Minutes
<timeCycle>R4/2015-04-30T12:0/PT60M</timeCycle>

So in your example above, I'm still seeing how i can define one timer that specifies the start date, and then the 60M interval.

At the start date i expect to transition from the timer to my task to send email. And then I went this to occur 60 minutes from now for the number of repeats.

timer fires at start date–>email Task—->handle the counter as you mention above……

but if I then transition back to the timer that won't work because it is defined with a specific start date. Would i then have to use a second timer that would be used for the interval?

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

Timer in the loop has to have duration.
e.g.

<timerEventDefinition>
    <timeDuration>P10D</timeDuration>
</timerEventDefinition>

Regards
Martin