调整一些接口参数
This commit is contained in:
@@ -2,6 +2,7 @@ package com.lanyuanxiaoyao.flowable.jpa.entity;
|
||||
|
||||
import com.lanyuanxiaoyao.flowable.core.model.FlowableAction;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.persistence.CollectionTable;
|
||||
import javax.persistence.Column;
|
||||
@@ -13,7 +14,6 @@ import javax.persistence.EnumType;
|
||||
import javax.persistence.Enumerated;
|
||||
import javax.persistence.ForeignKey;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.MapKeyColumn;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
@@ -44,13 +44,18 @@ public class FlowableNode {
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(nullable = false)
|
||||
private com.lanyuanxiaoyao.flowable.core.model.FlowableNode.Type type;
|
||||
@Column(nullable = false)
|
||||
private String handler;
|
||||
@ElementCollection(fetch = javax.persistence.FetchType.EAGER)
|
||||
@MapKeyColumn(name = "action")
|
||||
@Column(name = "nodeId")
|
||||
@CollectionTable(name = "flowable_node_targets", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
|
||||
private Map<FlowableAction, String> targets;
|
||||
|
||||
@Column(nullable = false)
|
||||
private String accessor;
|
||||
@ElementCollection(fetch = javax.persistence.FetchType.EAGER)
|
||||
@CollectionTable(name = "flowable_node_listeners", foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
|
||||
private List<String> listeners;
|
||||
|
||||
@CreatedDate
|
||||
private LocalDateTime createdTime;
|
||||
@LastModifiedDate
|
||||
@@ -63,6 +68,8 @@ public class FlowableNode {
|
||||
this.type = node.getType();
|
||||
this.handler = node.getHandler();
|
||||
this.targets = node.getTargets();
|
||||
this.accessor = node.getAccessor();
|
||||
this.listeners = node.getListeners();
|
||||
}
|
||||
|
||||
public com.lanyuanxiaoyao.flowable.core.model.FlowableNode toFlowableNode() {
|
||||
@@ -73,6 +80,8 @@ public class FlowableNode {
|
||||
.type(type)
|
||||
.handler(handler)
|
||||
.targets(targets)
|
||||
.accessor(accessor)
|
||||
.listeners(listeners)
|
||||
.createdTime(createdTime)
|
||||
.updatedTime(updateTime)
|
||||
.build();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.lanyuanxiaoyao.flowable.jpa;
|
||||
|
||||
import com.lanyuanxiaoyao.flowable.core.manager.FlowableConfiguration;
|
||||
import com.lanyuanxiaoyao.flowable.core.manager.FlowableManager;
|
||||
import com.lanyuanxiaoyao.flowable.core.model.FlowableAction;
|
||||
import com.lanyuanxiaoyao.flowable.core.model.FlowableHandler;
|
||||
@@ -18,7 +19,7 @@ public class SimpleAutoAction implements FlowableHandler {
|
||||
private FlowableManager flowableManager;
|
||||
|
||||
@Override
|
||||
public FlowableAction handle(FlowableInstance instance, FlowableNode node, FlowableAction action) {
|
||||
public FlowableAction handle(FlowableConfiguration configuration, FlowableInstance instance, FlowableNode node, FlowableAction action) {
|
||||
log.info("Initial with spring: {}", flowableManager.listNodes());
|
||||
return FlowableAction.APPROVE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user