cancel
Showing results for 
Search instead for 
Did you mean: 

endDate not working as expected with timeCycle using <duration>/<end> notation

stephsmith
Champ in-the-making
Champ in-the-making
The ISO 8601 standard mentions 4 ways to specify intervals, one of which is <duration>/<end>.
From the spec, it appears that <end> identifies end of the interval.
When testing this in Activiti, I expected this to identify the end of the interval in which the timer would fire.
Once we are past the end date (due date), it would no longer fire. However that is not what I am seeing.

I created a simple test case that specified a timerEventDefinition as

<boundaryEvent id="timer" attachedToRef="task" cancelActivity="false">
    <timerEventDefinition>
            <timeCycle>R/PT15S/${EndDate}</timeCycle>
     </timerEventDefinition>
</boundaryEvent>


The timer fires as expected every 15 seconds up until the end date. At that time the duration changes to some other value. SOmetimes it is 1 second, sometimes 5….it varies.  I expected the timer to stop firing, but not only is it not stopped, but it continues to fire at a different interval.

My question is this….
When <duration>/<end> is specified, should the <end> indicate the end date (ie timer should not fire anymore).?
If not can you explain what the current behavior so I can get a better understanding.
I have included a simple test case to reproduce.

Thanks for any help!
8 REPLIES 8

jbarrez
Star Contributor
Star Contributor
So, to implement the ISO8601 cycle parsing, we actually piggyback on a class in the JDK. The code in Activiti is here: https://github.com/Activiti/Activiti/blob/master/modules/activiti-engine/src/main/java/org/activiti/...

And it seems, from looking at the javadoc, it indeed doesn't support the /endDate. I don't think it can be easily added on. But maybe it would be a good canidate for another attribute, that works on cron expressions too (something like activiti:endDate=""). What do you think?

stephsmith
Champ in-the-making
Champ in-the-making
I think an attribute is fine. I am assuming this is on "timeCycle".  Using an attribute allows us to specify a process variable which is what we we ultimately need for the end date.


lsmall
Champ in-the-making
Champ in-the-making
Something like:

&lt;timeCycle activiti:endDate='2008-05-11T15:30:00Z'&gt;R/PT15S&lt;/timeCycle&gt;

Any way we could get you to support a  reference to a process variable? 😉

&lt;timeCycle activiti:endDate='${EndDate}'&gt;R/PT15S&lt;/timeCycle&gt;

where the value of the process variable EndDate = '2008-05-11T15:30:00Z'

trademak
Star Contributor
Star Contributor
If we implement such an end date then supporting a process variable on all events except for a start event would be fine. Did someone already create a JIRA issue for this?

Best regards,

stephsmith
Champ in-the-making
Champ in-the-making
We have not entered one but will do so today.

stephsmith
Champ in-the-making
Champ in-the-making
I created a JIRA issue to track this problem. THanks!
http://jira.codehaus.org/browse/ACT-2184

trademak
Star Contributor
Star Contributor
Thanks

vasile_dirla
Star Contributor
Star Contributor
Implemented as it was discussed here.