oracle workflow 使用plsql推送代办

使用 wf_notification.respond 来完成消息的批准,转发,拒绝等操作。
   这种方法只适用于对消息节点的操作。
   它的好处是会完整地按照如下funcmode 顺序重复调用审批函数:
   a. VALIDATE
   b. RESPOND
   c. CANCEL
   d. RUN
 
   而WF_ENGINE.COMPLETEACTIVITY的funcmode 永远是 RUN .
 
  对funcmode 做一下解释:
  以下是Oracle给出的标准工作流函数的格式:
  (1) procedure
(itemtype in varchar2,
itemkey in varchar2,
actid in number,
funcmode in varchar2,
resultout out varchar2) is
(2)(3) begin
if ( funcmode = 'RUN' ) then


resultout := 'COMPLETE:';
return;
end if;
(4) if ( funcmode = 'CANCEL' ) then


resultout := 'COMPLETE';
return;
end if;
(5) if ( funcmode = 'SKIP' ) then


resultout := 'COMPLETE:';
return;
end if;
(6) if ( funcmode = 'RETRY' ) then


resultout := 'COMPLETE:';
return;
end if;
(7) if ( funcmode = 'VALIDATE' ) then


resultout := 'COMPLETE';
return;
end if;
(8) if ( funcmode = 'RESPOND' ) then


resultout := 'COMPLETE';
return;
end if;
(9) if ( funcmode = 'FORWARD' ) then


resultout := 'COMPLETE';
return;
end if;
(10) if ( funcmode = 'TRANSFER' ) then


resultout := 'COMPLETE';
return;
end if;
(11) if ( funcmode = 'QUESTION' ) then


resultout := 'COMPLETE';
return;
6-4 Oracle Workflow Developer's Guide
end if;
(12) if ( funcmode = 'ANSWER' ) then


resultout := 'COMPLETE';
return;
end if;
(13) if ( funcmode = 'TIMEOUT' ) then


if () then
resultout := 'COMPLETE';
else
resultout := wf_engine.eng_timedout;
end if;
return;
end if;
(14) if ( funcmode = '' ) then
resultout := ' ';
return;
end if;
(15) exception
when others then
WF_CORE.CONTEXT ('', '',
, ,
to_char(), );
raise;
(16) end ;
 
可以看到,工作流函数会根据funcmode 不同做出不同的响应。
当使用WF_ENGINE.COMPLETEACTIVITY的时候,调用函数的funcmode值永远是RUN.
当使用 wf_notification.respond的时候,工作流会重复调用4次函数,funcmode 分别为 VALIDATE,RESPOND,CANCEL,RUN.以便完全执行工作流函数的每一部分。
 
其他funcmode是什么情况传入,还不清楚,欢迎补充。
 
wf_notification.respond的函数原型
procedure Respond(nid in number, --notice id,通知id
                  respond_comment in varchar2, --完成通知附注
                  responder in varchar2,--通知回复人
                  action_source in varchar2)--Source from where the action is performed
 
举例:
BEGIN
 wf_notification.SetAttrText(10399,'RESULT','REJECTED'); --设置notice id 为10399的消息的审批意见为拒绝
  wf_notification.respond(10399
                          ,null
                          ,'刘斌'
                          ,null);
END;

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值