cn.schoolwow.workflow.handler.QuickWorkFlowTryCatchFinallyHandler Maven / Gradle / Ivy
package cn.schoolwow.workflow.handler;
import cn.schoolwow.quickdao.dao.DAO;
import cn.schoolwow.quickflow.domain.FlowContext;
import cn.schoolwow.quickflow.listener.TryCatchFinallyHandler;
public class QuickWorkFlowTryCatchFinallyHandler implements TryCatchFinallyHandler {
@Override
public void handleTry(FlowContext flowContext) throws Exception {
DAO dao = (DAO) flowContext.checkData("dao");
dao.startRecord();
}
@Override
public void handleException(FlowContext flowContext, Exception e) {
DAO dao = (DAO) flowContext.checkData("dao");
System.out.println(dao.stopRecord());
}
@Override
public void handleFinally(FlowContext flowContext) {
DAO dao = (DAO) flowContext.checkData("dao");
dao.stopRecord();
}
@Override
public String name() {
return "工作流全局处理器";
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy