Description:
We are encountering an issue with the timer boundary event in Flowable. The timer boundary event is not being triggered as expected, causing certain workflows to fail or not proceed as planned.
Steps to Reproduce:
1.Enable asynchronous mode
flowable:
async-executor-activate: true
database-schema-update: false
- Create a BPMN process with a boundary timer event attached to a user task.
- Set a time duration for the boundary event to trigger.
- The output line of the timer points to a user task, which has a listener on it. When the task is executed, this listener will be executed.
listener code is below :
@Override
public void notify(DelegateTask delegateTask) {
try {
//凑参数
String processInstanceId = delegateTask.getProcessInstanceId();
String taskId = delegateTask.getId();
JSONObject taskVariableData = new JSONObject();
JSONObject masterData = new JSONObject();
// 提交任务
Task task = flowApiService.getProcessInstanceActiveTask(processInstanceId, taskId);
TaskInfoVo taskInfo = JSON.parseObject(task.getFormKey(), TaskInfoVo.class);
taskInfo.setTaskKey(task.getTaskDefinitionKey());
//TokenData tokenData = FileReaderTokenData.getTokenDataFromFile();
TokenData tokenData = new TokenData();
tokenData.setLoginName(loginName);
tokenData.setUserId(userId);
tokenData.setDeptId(deptId);
tokenData.setShowName(showName);
taskVariableData.put(FlowConstant.MASTER_DATA_KEY, masterData);
taskVariableData.put(FlowConstant.MASTER_TABLE_KEY, masterTable);
flowApiService.completeTask(task, flowTaskComment, taskVariableData, tokenData);
} catch (RuntimeException e) {
log.error(e.getMessage(), e);
throw e;
}
}
- Start a process instance and wait for the timer to expire.
- There are abnormal records in the table act_ru_deadletter_job.
here is details:
49fa8a1f-b6d5-11ef-a6d6-e073e719e958 4 timer 1 49750669-b6d5-11ef-a6d6-e073e719e958 49746a09-b6d5-11ef-a6d6-e073e719e958 SW03:63:0a778687-b6d1-11ef-80ff-e073e719e958 Event_08wb2ub 计时器 49fa8a1e-b6d5-11ef-a6d6-e073e719e958 60d27816-b6d5-11ef-a996-1662cb73157f Cannot invoke "com.common.core.object.TokenData.getLoginName()" because "tokenData" is null 2024-12-10 17:01:50.722 trigger-timer {"activityId":"Event_08wb2ub"} 2024-12-10 17:01:44.048
Expected Behavior:
The timer boundary event should trigger after the specified time duration, the process to the next step.
Actual Behavior:
The timer boundary event has been triggered and an exception has occurred. The exception information is recorded in act_ru_deadletter_job, Exception_MSG_
Flowable Version:
7.0.1
Additional Information:
- I am unable to use breakpoint debugging with idea, and even though I have set a constant object for TokenData in the listener, a NullPointerException still occurs.Additionally, this issue occurs with a certain probability. The timer duration I have set is 15 seconds.
- Under normal circumstances, breakpoints can enter this listener, but once this exception occurs, the breakpoints in IDEA cannot catch it. It’s as if the listener is not being executed in this thread at all.