Workflow: Oracle workflow is a graphical tool that allows you to create, track and modify business process embedded in the oracle database server. It can monitor the oracle business workflow activity status.
1. Create clear business process requirements.
2. Automate the business routing.
3. Monitor the process.
4. Allow user to define own business scenario.
5. Readily change the business process definition in case of a change in business process.
WFSTD: (Standard module for workflow)
Responsibility: Workflow administrator web applications
Components of Workflow: Attributes, process, notifications, functions, events, messages and lookup types.
Pre-requisites: A workflow should have unique Item name and Item key associated to run a workflow.
Note: For initializing a workflow there are certain API’s should be set in oracle pl/sql package.
1. API used to create process of workflow: Wf_engine.createprocess(v_itemtype, v_itemkey, v_processname)
2. API used to set item attribute text :wf_engine.SetItemAttrText(v_itemtype, v_itemkey, v_Aname, v_Avalue)
3. API used to set Item user key: wf_engine.SetItemuserkey(v_itemtype, V_itemkey, v_UserKey)
4. API used to set Item Owner: wf_engine.SetItemOwner(V_itemtype, V_ItemKey, ‘V_User’)
5. API used to start Process: wf_engine.Startprocess(v_itemtype, v_itemkey)
6. API used for printing engine completed message: wf_engine_eng_completed and wf_engine.eng_null
7. API used to assign the workflow errors into error stack or to locate the source or error:wf_core.context
8. API used to get the Item Attribute text or date: wf_engine.GetitemAttrtext or wf_engine.GetItemAttrdate
Wf_core.context: Oracle workflow provides different context information that corresponds to the current notification being acted upon to the Post-Notification-Function
It includes the context information in the error stack to help to locate the source of an error.
List of context variables in workflow:
Note: Post-Notification-Function (PNF) should be a pl/sql procedure written to the same PI standard required for function activity.
Some more information of workflow
1) Any procedure that is attached with an activity (notification/ function activity) must have following input parameters ( Itemtype in varchar2, Itemkey in varchar2, Actid in number, funcmode in varchar2, result_out in out varchar2)
2) Any procedure that is attached with an activity (notification/function activity) must have an error handling section, in case of exception occurs. Wf_core.context(<package name>,<procedure name>, item type, item key, actid, funcmode)
API to get the value of document id when a attachment is involved in our notification
Wf_engine.getItemAttrDocument(v_itemtype, v_itemkey, v_Aname, v_documetId=>’PLSQLBLOB:<procedure_name>’||v_lob_id)
API used to create roles from backend
Wf_directory.CreatAdhocRoles(v_rolename, v_roleDesc, null, null, Desc, ‘MAILHTML’, ‘User1 User2’,null. Null “active, null)
API to Add user in roles
Statuses of workflow activity
Different kind of funcMode involve in workflow
Question: When starting an oracle workflow process, how do you ensure that it happens in a background mode?
Ans: If initiating a process using start process do the following:
When initiating the workflow process through an event subscribtion, set the “Execution Condtion Phase” to be equal to or above 100. It will lead the process to run in background process.
Different Tables involved in oracle workflow