update - 调整待办消息状态的处理逻辑

This commit is contained in:
wangli 2023-12-09 13:36:24 +08:00
parent 74e7bf1d0f
commit 7186ed1f64
3 changed files with 8 additions and 4 deletions

View File

@ -19,7 +19,7 @@ public class TimeBasedIdGenerator implements IdGenerator {
private static final long MAX_SEQUENCE = ~(-1L << SEQUENCE_BITS);
private static final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmm");
private static final AtomicLong sequence = new AtomicLong(0);
private static final AtomicLong sequence = new AtomicLong(1);
private static volatile String lastTimestamp = "";
@Override

View File

@ -24,7 +24,6 @@ import cn.axzo.workflow.core.common.utils.BpmnMetaParserHelper;
import cn.axzo.workflow.core.engine.event.MessagePushEventBuilder;
import cn.axzo.workflow.core.engine.event.MessagePushEventImpl;
import cn.axzo.workflow.core.engine.event.MessagePushEventType;
import cn.axzo.workflow.core.engine.id.TimeBasedIdGenerator;
import cn.axzo.workflow.core.service.BpmnProcessTaskService;
import cn.axzo.workflow.core.service.converter.BpmnHistoricAttachmentConverter;
import cn.axzo.workflow.core.service.converter.BpmnHistoricCommentConverter;
@ -41,6 +40,7 @@ import org.flowable.bpmn.model.BpmnModel;
import org.flowable.bpmn.model.FlowElement;
import org.flowable.bpmn.model.UserTask;
import org.flowable.common.engine.api.delegate.event.FlowableEventDispatcher;
import org.flowable.common.engine.impl.cfg.IdGenerator;
import org.flowable.common.engine.impl.identity.Authentication;
import org.flowable.engine.HistoryService;
import org.flowable.engine.ManagementService;
@ -57,6 +57,7 @@ import org.flowable.engine.runtime.ProcessInstance;
import org.flowable.engine.task.Attachment;
import org.flowable.engine.task.Comment;
import org.flowable.form.api.FormInfo;
import org.flowable.spring.SpringProcessEngineConfiguration;
import org.flowable.task.api.Task;
import org.flowable.task.api.TaskQuery;
import org.flowable.task.api.history.HistoricTaskInstance;
@ -148,6 +149,8 @@ public class BpmnProcessTaskServiceImpl implements BpmnProcessTaskService {
private BpmnHistoricAttachmentConverter attachmentConverter;
@Resource
private ManagementService managementService;
@Resource
private SpringProcessEngineConfiguration springProcessEngineConfiguration;
@Override
public BpmPageResult<BpmnTaskTodoPageItemVO> getTodoTaskPage(BpmnTaskPageSearchDTO dto) {
@ -417,7 +420,8 @@ public class BpmnProcessTaskServiceImpl implements BpmnProcessTaskService {
TaskEntity task = null;
if (parentTask != null) {
//1.生成新的工作流子任务
task = (TaskEntity) taskService.newTask(new TimeBasedIdGenerator().getNextId());
IdGenerator idGenerator = springProcessEngineConfiguration.getIdGenerator();
task = (TaskEntity) taskService.newTask(idGenerator.getNextId());
task.setCategory(parentTask.getCategory());
task.setDescription(parentTask.getDescription());
task.setTenantId(parentTask.getTenantId());

View File

@ -278,7 +278,7 @@ public class RocketMqMessagePushEventListener implements BpmnMessagePushEventLis
return;
}
eventProducer.send(Event.builder()
.shardingKey(dto.getTemplateId())
.shardingKey(dto.getProcessInstanceId())
.eventCode(eventEnum.getEventCode())
.targetId(dto.getProcessInstanceId())
.targetType(eventEnum.getTag())