Boundary timer Or intermediate timer

Hi,
I have a requirement like this: there are two tasks, A and B. If task B has not been processed after one day, a timeout notification needs to be sent, once per day. How can this be implemented using a timer in Flowable?
I tried using a boundary timer and an intermediate timer event. I found that the boundary timer can only execute once and proceeds to the service task (shown in the diagram as “msg”). As for the intermediate catch timer, after it loops three times, the delegate class corresponding to the service task fails to instantiate. The exception in act_ru_deadletter_job is:
“couldn’t instantiate class com.example.webadmin.workorder.listener.test.TestServiceTask”

The code for TestServiceTask is as follows:

@Slf4j
public class TestServiceTask implements JavaDelegate {
    @Override
    public void execute(DelegateExecution execution) {
        String taskId = execution.getCurrentActivityId();
        log.info("TestServiceTask  taskId:{}", taskId);
    }
}

here is workflow picture:

timeDuration is PT30S

How should I design the process to send timeout notifications at regular time intervals?

Please help

I think you need something like this:


(not sure if it is 100% correct, but you get the idea)

after timeout expires, flow goes to service task that sends the message, and then you should give the task B back to user, so that user can actually finish the task.

also, once you get back to user task, this is new instance of the task so the timer is ticking again and will be triggered

The suggestion by @dragan_torbica is one way to do that. The other option would be to use a Boundary Timer Event which will not cancel the activity

e.g.

And you configure the timer cycle to be “R/P1D” which means that it repeats every day.

I don’t think that it executes once, I think you are having some other problem with your service task and it goes into a dead letter.

How does the entire stacktrace look like? What is the reason for not being able to instantiate the TestServiceTask.

Cheers,
Filip

1 Like