mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-05-14 20:22:07 +08:00
加入节点的阀门
This commit is contained in:
@@ -51,6 +51,10 @@ public abstract class Component {
|
||||
|
||||
protected abstract void process() throws Exception;
|
||||
|
||||
protected boolean isAccess(){
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean isContinueOnError() {
|
||||
return continueOnError;
|
||||
}
|
||||
|
||||
@@ -73,7 +73,10 @@ public class FlowExecutor {
|
||||
for(Node node : nodeList){
|
||||
component = node.getInstance();
|
||||
try{
|
||||
component.setSlotIndex(slotIndex).execute();
|
||||
component.setSlotIndex(slotIndex);
|
||||
if(component.isAccess()){
|
||||
component.execute();
|
||||
}
|
||||
}catch(Throwable t){
|
||||
if(component.isContinueOnError()){
|
||||
LOG.error("component[{}] cause error,but flow is still go on",t,component.getClass().getSimpleName());
|
||||
|
||||
Reference in New Issue
Block a user