All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.schoolwow.workflow.handler.QuickWorkFlowTryCatchFinallyHandler Maven / Gradle / Ivy

There is a newer version: 1.0.6
Show newest version
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