1
0

调整metadata的结构,使用更方便

This commit is contained in:
2025-01-03 15:27:40 +08:00
parent 57bc3fb2a8
commit 45ce5a2615
10 changed files with 134 additions and 37 deletions

View File

@@ -1,12 +1,12 @@
package com.lanyuanxiaoyao.flowable.jpa.entity;
import com.lanyuanxiaoyao.flowable.core.model.FlowableMetadata;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.time.LocalDateTime;
import java.util.Map;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
@@ -82,7 +82,7 @@ public class FlowableInstance {
return new com.lanyuanxiaoyao.flowable.core.model.FlowableInstance(
instanceId,
currentNodeId,
(Map<String, Object>) bytesToObject(this.metadata),
(FlowableMetadata) bytesToObject(this.metadata),
status,
createdTime,
updatedTime

View File

@@ -5,7 +5,6 @@ import com.lanyuanxiaoyao.flowable.core.model.FlowableAction;
import com.lanyuanxiaoyao.flowable.core.model.FlowableHandler;
import com.lanyuanxiaoyao.flowable.core.model.FlowableInstance;
import com.lanyuanxiaoyao.flowable.core.model.FlowableNode;
import java.util.Map;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
@@ -19,7 +18,7 @@ public class SimpleAutoAction implements FlowableHandler {
private FlowableManager flowableManager;
@Override
public FlowableAction handle(FlowableAction action, FlowableInstance instance, FlowableNode node, Map<String, Object> metadata) {
public FlowableAction handle(FlowableInstance instance, FlowableNode node, FlowableAction action) {
log.info("Initial with spring: {}", flowableManager.listNodes());
return FlowableAction.APPROVE;
}