加入节点的阀门

This commit is contained in:
bryan.zhang
2017-11-22 16:06:11 +08:00
parent d0b91ee442
commit b0c8cc115d
2 changed files with 8 additions and 1 deletions

View File

@@ -51,6 +51,10 @@ public abstract class Component {
protected abstract void process() throws Exception;
protected boolean isAccess(){
return true;
}
public boolean isContinueOnError() {
return continueOnError;
}

View File

@@ -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());