cancel
Showing results for 
Search instead for 
Did you mean: 

Boundary timer event on script task

mathiasd
Champ in-the-making
Champ in-the-making
Hi,

Does the boundary timer event work when attached to a script task ? I would like to ensure that a script task doesn't run more than 1 second, so i put the following boundary event :

<boundaryEvent attachedToRef="telnetScript" cancelActivity="true" id="timer">
         <timerEventDefinition id="_theTimer">
            <timeDuration id="_theTimerDuration" xsi:type="tFormalExpression">PT1S</timeDuration>
         </timerEventDefinition>
      </boundaryEvent>

The telnetScript sends a telnet request to a fake server. This server answers after 5 seconds, so the timer should normally fires before the server answer, but it fires after ! oO
Moreover, when it fires, the process instance is over (because the telnet answer has been received), so I got a NullPointerException…

It seems that the timer can't fire when the script is executing a blocking instruction. Is it a bug ?
If I put a "while(true);" in the script task, the timer never fires.
2 REPLIES 2

frederikherema1
Star Contributor
Star Contributor
It does not work on a script-task in activiti (it only works on userTass, signal-tasks, … -> all wait-states) because the timers need to be persisted.

mathiasd
Champ in-the-making
Champ in-the-making
Ok thanks, I made my own script task timer