1.补充注释

This commit is contained in:
LeoLee
2021-12-10 17:56:40 +08:00
parent 84e204baac
commit ea9038561d

View File

@@ -278,6 +278,13 @@ public class FlowExecutor {
this.execute(chainId, param, slotClazz, slotIndex, true); this.execute(chainId, param, slotClazz, slotIndex, true);
} }
/**
* 无参执行器
* @Author LeoLee
* @Date 17:52 2021/12/10
* @param chainId 业务链id
* @return com.yomahub.liteflow.entity.data.DefaultSlot
*/
public DefaultSlot execute(String chainId) throws Exception { public DefaultSlot execute(String chainId) throws Exception {
return this.execute(chainId, DefaultSlot.class, null, false); return this.execute(chainId, DefaultSlot.class, null, false);
} }
@@ -301,9 +308,15 @@ public class FlowExecutor {
public <T extends Slot> T execute(String chainId, Class<T> slotClazz, public <T extends Slot> T execute(String chainId, Class<T> slotClazz,
Integer slotIndex, boolean isInnerChain) throws Exception { Integer slotIndex, boolean isInnerChain) throws Exception {
//默认param为null在doExecute中会被过滤
return this.execute0(chainId, null, slotClazz, slotIndex, isInnerChain); return this.execute0(chainId, null, slotClazz, slotIndex, isInnerChain);
} }
/**
* doExecute私有封装
* @Author LeoLee
* @Date 17:53 2021/12/10
*/
private <T extends Slot> T execute0(String chainId, Object param, Class<T> slotClazz, Integer slotIndex, boolean isInnerChain) throws Exception { private <T extends Slot> T execute0(String chainId, Object param, Class<T> slotClazz, Integer slotIndex, boolean isInnerChain) throws Exception {
T slot = this.doExecute(chainId, param, slotClazz, slotIndex, isInnerChain); T slot = this.doExecute(chainId, param, slotClazz, slotIndex, isInnerChain);
if (ObjectUtil.isNotNull(slot.getException())) { if (ObjectUtil.isNotNull(slot.getException())) {
@@ -338,9 +351,15 @@ public class FlowExecutor {
public <T extends Slot> LiteflowResponse<T> execute2Resp(String chainId, Class<T> slotClazz, Integer slotIndex, public <T extends Slot> LiteflowResponse<T> execute2Resp(String chainId, Class<T> slotClazz, Integer slotIndex,
boolean isInnerChain) { boolean isInnerChain) {
//默认param为null在doExecute中会被过滤
return execute2Resp0(chainId, null, slotClazz, slotIndex, isInnerChain); return execute2Resp0(chainId, null, slotClazz, slotIndex, isInnerChain);
} }
/**
* doExecute私有封装
* @Author LeoLee
* @Date 17:54 2021/12/10
*/
private <T extends Slot> LiteflowResponse<T> execute2Resp0(String chainId, Object param, Class<T> slotClazz, Integer slotIndex, boolean isInnerChain) { private <T extends Slot> LiteflowResponse<T> execute2Resp0(String chainId, Object param, Class<T> slotClazz, Integer slotIndex, boolean isInnerChain) {
LiteflowResponse<T> response = new LiteflowResponse<>(); LiteflowResponse<T> response = new LiteflowResponse<>();