查看工作流是否有重复提交
select wm_concat(t.instance_id), wm_concat(t.document_info) from zj_wfl_workflow_instance_v t
where t.creation_date between to_date('2017-1-1','yyyy-MM-dd') and to_date('2018-1-31','yyyy-MM-dd')
and t.workflow_code <> 'CS_NOTICE'
group by t.creation_date , t.workflow_id
having count(1) > 1;
批量通过用户通知
declare
p_result varchar2(100);
p_user_id number := 2533; -- 用户ID
begin
for info in (SELECT t1.record_id, t1.document_info
FROM zj_wfl_instance_node_rcpt_v t1
where t1.user_id = p_user_id
and t1.record_type = 'NOTICE'
and rownum <= 500 -- 限制关闭通知数量
order by t1.last_update_date ) loop
p_result := zj_wfl_core_pkg.workflow_approve(p_rcpt_record_id => info.record_id,
p_node_action_id => null,
p_comment => '通知关闭。',
p_user_id => p_user_id);
dbms_output.put_line(info.record_id || '-通知关闭,内容>>>' ||
info.document_info);
end loop;
end;
查询代办对应页面
-- 查询工作流对应的页面
select zj_wfl_core_pkg.get_node_service_url(p_rcpt_record_id => z.record_id,
p_source_type => 'DISPLAY',
p_user_id => z.user_id)
from zj_wfl_instance_node_recipient z
where z.record_id = 300809; --将工作流页面的record_id填入,获得其具体对应的screen.
查询某个节点的审批人
-- 查询某工作流中,某个节点的审批人
select v.* from zj_wfl_approve_history_v v where v.instance_id = 811914 and v.node_sequence_num=8
工作流审批按钮组事件
通过这个函数可以获得工作流审批按钮组的事件
当按钮组中任意按钮下时,触发该事件.根据type属性值的不同,确定点击的按钮,进而触发函数块.最后一定要返回true/false,使后续继续执行
zjwfl5110_ApproveChecker_add('agree', function(type){
// 同意
if(type=='agree'){
代码块....
return true;
}
// 拒绝
if(type=='refuse'){
代码块....
return true;
}
return true;
});
提交审批前进行验证
该代码在工作流页面提交时执行,在弹出框[是否提交]前执行,当返回为ture时,显示弹出框,否则不显示,终止执行.
//提交审批前
zjwfl5110_ApproveChecker_add('agree', function(type){ //agree|refuse
var con_ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'csh_payment_req_hd'); //基表的名称
var con_record = $(con_ds_id).getCurrentRecord(); //获得当前数据
if (con_record.validateRecord(true)) { //执行必输验证,并通过
if (con_record.dirty) { //是否更新
Aurora.showMessage('提示', '界面数据有更新,请先保存!');
return false;
} else {
return true;
}
} else { //必输验证未通过
Aurora.showMessage('${l:PROMPT}', '必填字段不能为空,请检查!');
return false;
}
});
工作流页面中绑定参数
注意大小写
可以根据页面参数,决定渲染的哪些JS片段
<!-- 直接获取参数 -->
<a:switch test="/parameter/@credit_display_flag">
<a:case value="Y">
<script><![CDATA[
zjwfl5110_ApproveChecker_add('agree', function(type){
// js中获取参数
if('${/parameter/@credit_display_flag}'=='Y' && type=='agree'){
save_model(false);
}
if('${/parameter/@credit_display_flag}'=='Y' && type=='refuse'){
save_model(true);
}
return true;
});
]]></script>
</a:case>
</a:switch>