package com.awspaas.user.apps.donenow_sys.event;

import com.actionsoft.bpms.bpmn.engine.core.delegate.ProcessExecutionContext;
import com.actionsoft.bpms.bpmn.engine.listener.ProcessPubicListener;
import com.actionsoft.bpms.bpmn.engine.model.run.delegate.TaskInstance;
import com.actionsoft.sdk.local.SDK;
import com.actionsoft.sdk.local.api.Logger;

public class DNProcessPubicListener extends ProcessPubicListener {
    private static Logger logger = SDK.getLogAPI().getLogger(DNProcessPubicListener.class);

    /**
     *
     * @param eventName
     * @param taskInst
     * @param param
     */
    @Override
    public void call(String eventName, TaskInstance taskInst, ProcessExecutionContext param) {
        System.out.println("=============================================================================");
        System.out.println("DNProcessPubicListener");
        System.out.println("eventName-->" + eventName + ";processInst-->" + param.getProcessInstance() + ";taskInst-->" + taskInst);
        /*
        String boId = param.getParameterOfString(ListenerConst.FORM_EVENT_PARAM_BOID);
        BO formData = (BO) param.getParameter(ListenerConst.FORM_EVENT_PARAM_FORMDATA);
        String boName = param.getParameterOfString(ListenerConst.FORM_EVENT_PARAM_BONAME);

        System.out.println("表：" + boName + "表名：" + formData.getModel().getTitle());

        System.out.println("新数据：" + JSONObject.toJSONString(formData.asMap()));

        BO orgBO = SDK.getBOAPI().get(boName, boId);

        if (orgBO != null) {
            System.out.println("旧数据：" + JSONObject.toJSONString(orgBO.asMap()));
        }

        */
    }
}
