1
0

增加一个额外的字段用于额外的查询条件

This commit is contained in:
2025-01-07 14:31:24 +08:00
parent b56555923a
commit bf0e7e47be
2 changed files with 6 additions and 0 deletions

View File

@@ -52,12 +52,15 @@ public class FlowableInstance {
@LastModifiedDate @LastModifiedDate
private LocalDateTime updatedTime; private LocalDateTime updatedTime;
private String extra;
@SneakyThrows @SneakyThrows
public FlowableInstance(com.lanyuanxiaoyao.flowable.core.model.FlowableInstance instance) { public FlowableInstance(com.lanyuanxiaoyao.flowable.core.model.FlowableInstance instance) {
this.instanceId = instance.getInstanceId(); this.instanceId = instance.getInstanceId();
this.metadata = objectToBytes(instance.getMetadata()); this.metadata = objectToBytes(instance.getMetadata());
this.currentNodeId = instance.getCurrentNodeId(); this.currentNodeId = instance.getCurrentNodeId();
this.status = instance.getStatus(); this.status = instance.getStatus();
this.extra = instance.getExtra();
} }
private static byte[] objectToBytes(Object object) throws IOException { private static byte[] objectToBytes(Object object) throws IOException {
@@ -86,6 +89,7 @@ public class FlowableInstance {
.status(status) .status(status)
.createdTime(createdTime) .createdTime(createdTime)
.updatedTime(updatedTime) .updatedTime(updatedTime)
.extra(extra)
.build(); .build();
} }
} }

View File

@@ -26,6 +26,8 @@ public class FlowableInstance {
@Builder.Default @Builder.Default
private LocalDateTime updatedTime = LocalDateTime.now(); private LocalDateTime updatedTime = LocalDateTime.now();
private String extra;
public void addMetadata(Map<String, Object> metadata) { public void addMetadata(Map<String, Object> metadata) {
this.metadata.putAll(metadata); this.metadata.putAll(metadata);
} }