class ThenCondition extends Condition {

	@Override
	public ConditionTypeEnum getConditionType() {
		return ConditionTypeEnum.TYPE_THEN;
	}

	@Override
	public void executeCondition(Integer slotIndex) throws Exception {<FILL_FUNCTION_BODY>}

	@Override
	public void addExecutable(Executable executable) {
		if (executable instanceof PreCondition) {
			this.addPreCondition((PreCondition) executable);
		}
		else if (executable instanceof FinallyCondition) {
			this.addFinallyCondition((FinallyCondition) executable);
		}
		else {
			super.addExecutable(executable);
		}
	}

	public List<PreCondition> getPreConditionList() {
		return this.getExecutableList(ConditionKey.PRE_KEY)
			.stream()
			.map(executable -> (PreCondition) executable)
			.collect(Collectors.toList());
	}

	public void addPreCondition(PreCondition preCondition) {
		this.addExecutable(ConditionKey.PRE_KEY, preCondition);
	}

	public List<FinallyCondition> getFinallyConditionList() {
		return this.getExecutableList(ConditionKey.FINALLY_KEY)
			.stream()
			.map(executable -> (FinallyCondition) executable)
			.collect(Collectors.toList());
	}

	public void addFinallyCondition(FinallyCondition finallyCondition) {
		this.addExecutable(ConditionKey.FINALLY_KEY, finallyCondition);
	}

}

		List<PreCondition> preConditionList = this.getPreConditionList();
		List<FinallyCondition> finallyConditionList = this.getFinallyConditionList();

		try {
			for (PreCondition preCondition : preConditionList) {
				preCondition.setCurrChainId(this.getCurrChainId());
				preCondition.execute(slotIndex);
			}

			for (Executable executableItem : this.getExecutableList()) {
				executableItem.setCurrChainId(this.getCurrChainId());
				executableItem.execute(slotIndex);
			}
		}
		catch (ChainEndException e) {
			// 这里单独catch ChainEndException是因为ChainEndException是用户自己setIsEnd抛出的异常
			// 是属于正常逻辑，所以会在FlowExecutor中判断。这里不作为异常处理
			throw e;
		}
		catch (Exception e) {
			Slot slot = DataBus.getSlot(slotIndex);
			//正常情况下slot不可能为null
			//当设置了超时后，还在运行的组件就有可能因为主流程已经结束释放slot而导致slot为null
			if (slot != null){
				String chainId = this.getCurrChainId();
				// 这里事先取到exception set到slot里，为了方便finally取到exception
				if (slot.isSubChain(chainId)) {
					slot.setSubException(chainId, e);
				}
				else {
					slot.setException(e);
				}
			}
			throw e;
		}
		finally {
			for (FinallyCondition finallyCondition : finallyConditionList) {
				finallyCondition.setCurrChainId(this.getCurrChainId());
				finallyCondition.execute(slotIndex);
			}
		}
	
<methods>public non-sealed void <init>() ,public void addExecutable(com.yomahub.liteflow.flow.element.Executable) ,public void addExecutable(java.lang.String, com.yomahub.liteflow.flow.element.Executable) ,public void execute(java.lang.Integer) throws java.lang.Exception,public abstract void executeCondition(java.lang.Integer) throws java.lang.Exception,public List<com.yomahub.liteflow.flow.element.Node> getAllNodeInCondition() ,public abstract com.yomahub.liteflow.enums.ConditionTypeEnum getConditionType() ,public java.lang.String getCurrChainId() ,public java.lang.String getCurrChainName() ,public Map<java.lang.String,List<com.yomahub.liteflow.flow.element.Executable>> getExecutableGroup() ,public List<com.yomahub.liteflow.flow.element.Executable> getExecutableList() ,public List<com.yomahub.liteflow.flow.element.Executable> getExecutableList(java.lang.String) ,public com.yomahub.liteflow.flow.element.Executable getExecutableOne(java.lang.String) ,public com.yomahub.liteflow.enums.ExecuteableTypeEnum getExecuteType() ,public java.lang.String getId() ,public java.lang.String getTag() ,public void setCurrChainId(java.lang.String) ,public void setExecutableList(List<com.yomahub.liteflow.flow.element.Executable>) ,public void setId(java.lang.String) ,public void setTag(java.lang.String) <variables>private java.lang.String currChainId,private final Map<java.lang.String,List<com.yomahub.liteflow.flow.element.Executable>> executableGroup,private java.lang.String id,private java.lang.String tag