Tables
- Workflow Definition
SQL:
-- 使用如下sql查询一个流程的连接信息:
select b.activity_name, b.instance_label, a.result_code "RESULT_CODE", 'TO',
c.activity_name, c.instance_label
from (select * from wf_activity_transitions
start with from_process_activity = (select instance_id from
wf_process_activities where
process_item_type = 'LEAVEREQ' AND PROCESS_VERSION = 5 AND
ACTIVITY_NAME =
'START') connect by prior to_process_activity = from_process_activity and
result_code <>
'#TIMEOUT') a left outer join wf_process_activities b on
a.from_process_activity =
b.instance_id left outer join wf_process_activities c on a.to_process_activity
= c.instance_id
8, wf_messages_vl
消息视图, 根据会话的语言设置返回相应的记录. 字段:
TYPE, NAME, DISPLAY_NAME, SUBJECT, BODY
Workflow API
- WF_ENGINE
• wf_engine包用于工作流控制, 活动控制, 设置/获取工作流属性:
1, 工作流控制
CreateProcess
初始化一个工作流, 使用默认值初始化工作流属性. 分别会写表
wf_items和WF_ITEM_ATTRIBUTE_VALUES. 参数:
itemtype in varchar2 指定ITEM TYPE
itemkey in varchar2 指定ITEM KEY
process in varchar2 指定启动的流程, 如果null则使用selector函数决定
user_key in varchar2 USER KEY
owner_role in varchar2 所有者
StartProcess
启动一个流程. 参数:
itemtype in varchar2,
itemkey in varchar2
LaunchProcess
相当于CreateProcess + StartProcess
SetItemOwner
设置工作流实例的所有者.
13.
Workflow API
- WF_ENGINE
CreateForkedProcess
拷贝当前工作流实例.
StartForkedProcess
启动拷贝的工作流实例
Event
接收业务事件, 参数:
itemtype in varchar2 ITEM TYPE
itemkey in varchar2 ITEM KEY
process_name in varchar2 Process Name
event_message in wf_event_t 消息内容
Background
处理timeout/deferred/stuck的流程.
AbortProcess
取消工作流的执行, 可以指定一个结果.
SuspendProcess
暂停流程的执行, 指定ITEM TYPE, ITEM KEY和PROCESS.
ResumeProcess
重新恢复流程的执行,指定ITEM TYPE, ITEM KEY和PROCESS.
ItemStatus
查看工作流实例的状态以及结果代码.
14.
Workflow API
- WF_ENGINE
2, 活动控制
BeginActivity
判断指定的活动当前能否执行, 如果否则抛出异常. 指定ITEM_TYPE, ITEM_KEY,
和ACTIVITY.
AssignActivity
将活动分配给另一个人执行.
CompleteActivity
标识指定的活动为已完成状态, 传入活动的label.
CompleteActivityInternalName
标识指定的活动为已完成状态, 传入活动的Internal Name.
HandleError
将流程重置到某个活动节点, 并从该节点重新执行. 参数:
itemtype in varchar2 ITEM TYPE
itemkey in varchar2 ITEM KEY
activity in varchar2 Activity
command in varchar2 执行的动作SKIP或者RETRY
result in varchar2 如果执行的动作是SKIP, 此参数指定该活动的结果
如果activity参数设置为流程当前出错的节点, 那么HandleError用于处理活动的
错误.
#21 Note:The three views are mapped in the following way. WF_USERS is mapped to all employees with active primary assignments. WF_ROLES is mapped to all users listed in WF_USERS and to all positions defined as workflow roles. WF_USER_ROLES is mapped to the combination of WF_ROLES and WF_USERS.http://oracleapps4u.com/blog/category/wf_local_roles/For example:OPERATIONS is a user in WF_USERS, there’s also a role in WF_ROLES. There is a mapping user_name(‘OPERATIONS ’) role_name(‘OPERATIONS ’) in WF_USER_ROLES.