流程类回调事件(一)

/**
 * 保存或修改流程实例数据之前调用
 * @param workflowRequest json: 流程表单请求数据
 * @param formData json: 表单数据
 * @return [Boolean] 如果是返回false,则不会继续执行请求
 */
function _beforeSaveOrUpdateWorkflow(workflowRequest, formData) {
    if (typeof beforeSaveOrUpdateWorkflow === "function") {
        return beforeSaveOrUpdateWorkflow(workflowRequest, formData);
    }
    return true;
}

/**
 * 保存或修改流程实例数据成功调用
 * @param response json: 流程实例数据
 * @return
 */
function _saveOrUpdateWorkflowSuccess(res, formData) {
    if (typeof saveOrUpdateWorkflowSuccess === "function") {
        var res = saveOrUpdateWorkflowSuccess(res, formData);
        var action = AppUtils.getQueryString().action;
        if (action == CONSTANT.ACTION_ADD && action != _pageParams.action && !_pageParams.isAfterSave){
            _pageParams.isAfterSave = true;
        }
        return res;
    }
    return true;
}

/**
 * 获取下一步骤发送的待选步骤和用户信息列表之前调用
 * @param procId string: 流程实例ID
 * @param taskId int: 流程实例步骤ID
 * @param formData json: 表单数据
 * @return [Boolean] 如果是返回false,则不会继续执行请求
 */
function _beforeQueryWorkflowNextSteps(procId, taskId, formData) {
    if (typeof beforeQueryWorkflowNextSteps === "function") {
        return beforeQueryWorkflowNextSteps(procId, taskId, formData);
    }
    return {
        isContinueFlow: true,
        message: null
    };
}

/**
 * 获取下一步骤发送的待选步骤和用户信息列表成功调用
 * @param response json: 流程实例数据
 * @return
 */
function _queryWorkflowNextStepsSuccess(res) {
    if (typeof queryWorkflowNextStepsSuccess === "function") {
        return queryWorkflowNextStepsSuccess(res);
    }
    return true;
}

/**
 * 运行流程实例之前调用
 * @param workflowRequest json: 流程表单请求数据
 * @param formData json: 表单数据
 * @param choices array[json]: 流程选择步骤数据
 * @return [Boolean] 如果是返回false,则不会继续执行请求
 */
function _beforeRunWorkflow(workflowRequest, formData, choices) {
    if (typeof beforeRunWorkflow === "function") {
        return beforeRunWorkflow(workflowRequest, formData, choices);
    }
    return true;
}

/**
 * 运行流程实例成功调用
 * @param response json: 流程实例数据
 * @return
 */
function _runWorkflowSuccess(res, choice) {
    if (typeof runWorkflowSuccess === "function") {
        return runWorkflowSuccess(res, choice);
    }
    return true;
}

/**
 * 传阅流程实例之前调用
 * @param procId string: 流程实例ID
 * @param taskId int: 流程实例步骤ID
 * @param choiceStepUsers array[json]: 传阅用户列表
 * @return [Boolean] 如果是返回false,则不会继续执行请求
 */
function _beforeCirculateWorkflow(procId, taskId, choiceStepUsers) {
    if (typeof beforeCirculateWorkflow === "function") {
        return beforeCirculateWorkflow(procId, taskId, choiceStepUsers);
    }
    return true;
}

/**
 * 传阅流程实例成功调用
 * @param response json: 流程实例数据
 * @return
 */
function _circulateWorkflowSuccess(res) {
    if (typeof circulateWorkflowSuccess === "function") {
        return circulateWorkflowSuccess(res);
    }
    return true;
}

/**
 * 撤回流程实例工作项之前调用
 * @param procId string: 流程实例ID
 * @param taskId int: 流程实例步骤ID
 * @return [Boolean] 如果是返回false,则不会继续执行请求
 */
function _beforeRollbackWorkflow(procId, taskId) {
    if (typeof beforeRollbackWorkflow === "function") {
        return beforeRollbackWorkflow(procId, taskId);
    }
    return true;
}

/**
 * 撤回流程实例工作项成功调用
 * @param response json: 流程实例数据
 * @return
 */
function _rollbackWorkflowSuccess(res) {
    if (typeof rollbackWorkflowSuccess === "function") {
        return rollbackWorkflowSuccess(res);
    }
    return true;
}

/**
* 删除流程之前调用
* @param response json: 流程实例数据
* @return
*/
function _beforeDeleteWorkflow(procId) {
    if (typeof beforeDeleteWorkflow === "function") {
        return beforeDeleteWorkflow(procId);
    }
    return true;
}

/**
 * 删除流程成功调用
 * @param response json: 流程实例数据
 * @return
 */
function _deleteWorkflowSuccess(res) {
    if (typeof deleteWorkflowSuccess === "function") {
        return deleteWorkflowSuccess(res);
    }
    return true;
}

/**
 * 退回上一步流程实例工作项之前调用
 * @param procId string: 流程实例ID
 * @param taskId int: 流程实例步骤ID
 * @param opinionContent string: 意见内容
 * @param opinionArea string: 意见区域
 * @return [Boolean] 如果是返回false,则不会继续执行请求
 */
function _beforePushbackWorkflow(procId, taskId, opinionContent, opinionArea) {
    if (typeof beforePushbackWorkflow === "function") {
        return beforePushbackWorkflow(procId, taskId, opinionContent, opinionArea);
    }
    return true;
}

/**
 * 退回上一步流程实例工作项成功调用
 * @param response json: 流程实例数据
 * @return
 */
function _pushbackWorkflowSuccess(res) {
    if (typeof pushbackWorkflowSuccess === "function") {
        return pushbackWorkflowSuccess(res);
    }
    return true;
}

/**
 * 退回拟稿人流程实例工作项之前调用
 * @param procId string: 流程实例ID
 * @param taskId int: 流程实例步骤ID
 * @param opinionContent string: 意见内容
 * @param opinionArea string: 意见区域
 * @return [Boolean] 如果是返回false,则不会继续执行请求
 */
function _beforePushbackToRootWorkflow(procId, taskId, opinionContent, opinionArea) {
    if (typeof beforePushbackToRootWorkflow === "function") {
        return beforePushbackToRootWorkflow(procId, taskId, opinionContent, opinionArea);
    }
    return true;
}

/**
 * 退回拟稿人流程实例工作项成功调用
 * @param response json: 流程实例数据
 * @return
 */
function _pushbackToRootWorkflowSuccess(res) {
    if (typeof pushbackToRootWorkflowSuccess === "function") {
        return pushbackToRootWorkflowSuccess(res);
    }
    return true;
}

/**
 * 运行流程实例成功后调用
 * 自定义提示语
 */
function customizeRunWorkflowSuccessHintInfo() { }