Beruflich Dokumente
Kultur Dokumente
API
Parameters for a PL/SQL:
When the Workflow Engine calls a stored procedure for a unction activity, it
passes four parameters to the procedure and may expect a result when the
procedure completes.
Itemtype (IN) : Internal name of the item
Itemkey (IN) : A string to uniquely identify the item type instance
Actid (IN) : ID of the activity from where this procedure is called.
Funcmode (IN) : Execution mode of the activity
Resultout (OUT) : Result Type of the activity
FUNCMODE : For functions, it can be RUN or CANCEL For notifications, it can
be RESPOND, FORWARD, TRANSFER or TIMEOUT
RESULTOUT : COMPLETE:: Activity successful.
WAITING : Pending for some other activity
DEFERRED: Activity deferred till
NOTIFIED: Activity notified to with a . Externally, must be completed using
WF_ENGINE.CompleteActivity.
ERROR: Activity encounters an error
PL/SQL Coding Standards
Procedure
( itemtype in varchar2,
itemkey in varchar2,
actid in number,
funcmode in varchar2,
resultout out varchar2 )
is
;
Begin
if ( funcmode = RUN ) then
resultout := COMPLETE:;
return;
end if;
if ( funcmode = CANCEL ) then
resultout := COMPLETE;
return;
end if;
if ( funcmode = RESPOND ) then
resultout := COMPLETE;
return;
end if;
if ( funcmode = FORWARD ) then
resultout := COMPLETE;
return;
end if;
if ( funcmode = TIMEOUT ) then
resultout := COMPLETE;
return;
end if;
if ( funcmode = TRANSFER ) then
resultout := COMPLETE;
return;
end if;
Exception
When others then
WF_CORE.CONTEXT (, , , , to_char(),
);
raise;
End ;
==========================================================================
Wf_Core.context
('WF_REQDEMO','StartProcess',RequisitionNumber,RequisitionAmount,
RequestorUsername,ProcessOwner,Workflowprocess);
RAISE;
-END Req_App_Process;
========================================================================
WF_ENGINE
WF_CORE
WF_PURGE
WF_MONITOR
WF_QUEUE
WF_NOTIFICATIONS
WF_ENGINE : The state of a workflow item is defined by the various states of all activities that are part of the process for that item. The
engine changes activity states in response to an API call to update the activity family of calls.The Workflow Engine APIs can be called by an
application program or a workflow function in the runtime phase to communicate with the engine and to change the status of each of the
activities. These APIs are defined in a PL/SQL package called WF_ENGINE.
These APIs are defined in a PL/SQL package called WF_ENGINE :
* SetItemAttrText, SetItemAttrNumber, SetItemAttrDate
Used for setting a text/number/Date attribute value of a workflow instance.
* GetItemAttrText => Used for getting a text attributr value of a workflow instance.
* CreateProcess => Create a new runtime process for an application item.
* SetitemUserKey
* GetItemUserKey
* Background => Runs a background engine for processing deferred and/or timed out activities using the parameters specified.
* SetItemOwner
* StartProcess
* LaunchProcess.
WF_CORE :
PL/SQL procedures called by function activities can use a set of core Oracle Workflow APIs to raise and catch errors.When a PL/SQL
procedure called by a function activity either raises an unhandled exception, or returns a result beginning with 'ERROR:, the Workflow
Engine sets the function activitys status to ERROR and sets the columns ERROR_NAME, ERROR_MESSAGE, and ERROR_STACK in the
table WF_ITEM_ACTIVITY_STATUSES to reflect the error.The columns ERROR_NAME and ERROR_MESSAGE get set to either the
values returned by a call to WF_CORE.RAISE( ), or to the SQL error name and message if no call to RAISE( ) is found. The column
ERROR_STACK gets set to the contents set by a call to WF_CORE.CONTEXT( ), regardless of the error source.
WF_CORE Procedures :
CLEAR
GET_ERROR
TOKEN
RAISE
CONTEXT
TRANSLATE
WF_PURGE : WF_PURGE can be used to purge obsolete runtime data for completed items and processes, and to purge information for
obsolete activity versions that are no longer in use. One may want to periodically purge this obsolete data from your system to increase
performance.
WF_PURGE Procedures :
Items
Activities
Notifications
Total
TotalPERM
The WF_USER_ROLES view is an intersection of the users and roles in WF_USERS and WF_ROLES:
User_Name
User_Orig_System
User_Orig_System_id
Role_Name
Role_Orig_System
Role_Orig_System_id
WF_ITEM_TYPES : It stores all the Item_type definitions
NAME
PROTECT_LEVEL
CUSTOM_LEVEL
PERSISTENCE_TYPE
PERSISTENCE_DAYS
WF_SELECTOR
WF_ITEM_ATTRIBUTES : The WF_ITEM_ATTRIBUTES table stores definitions of attributes associated with a process. Each row includes
the sequence in which the attribute is used as well as the format of the attribute data.
ITEM_TYPE
NAME
SEQUENCE
TYPE
PROTECT_LEVEL
CUSTOM_LEVEL
SUBTYPE
FORMAT
WF_ITEMS : WF_ITEMS is the runtime table for workflow processes. Each row defines one work item within the system.
ITEM_TYPE
ITEM_KEY
ROOT_ACTIVITY
OWNER_ROLE
PARENT_ITEM_TYPE
PARENT_ITEM_KEY
BEGIN_DATE
END_DATE
USER_KEY
WF_PROCESS_ACTIVITIES : WF_PROCESS_ACTIVITIES stores the data for an activity within a specific process. A process activity is a
Modeled workflow process, which can be included as an activity in other processes to represent a subprocess
PROCESS_ITEM_TYPE
PROCESS_NAME
PROCESS_VERSION
ACTIVITY_ITEM_TYPE
ACTIVITY_NAME
WF_ACTIVITIES : WF_ACTIVITIES table stores the definition of an activity.
ITEM_TYPE , NAME , VERSION , TYPE , RERUN , EXPAND_ROLE,
PROTECT_LEVEL , CUSTOM_LEVEL , BEGIN_DATE , END_DATE
WF_ITEM_TYPES : It stores all the Item_type definitions
NAME
PROTECT_LEVEL
CUSTOM_LEVEL
PERSISTENCE_TYPE
PERSISTENCE_DAYS
WF_SELECTOR
WF_LOOKUPS -Workflow Lookups.
WF_LOOKUP_TYPES -Workflow lookup types.
WF_MESSAGES - Messages which r sent as notifications
WF_MESSAGE_ATRIBUTES : Message attributes(additional info to be sent to or received from an individual via notifications)
WF_NOTIFICATIONS , WF_NOTIFICATIONS_ATTRIBUTES.
Views Used in Workflow : Workflow uses views for effective querying of data. These views are de-normalized so as to provide a faster
you can then use any of the WF_PURGE API's to purge the item type's runtime status information.
EVENTS : A business event is an occurrence in an internet or intranet application or program thay might be to other objects in a system or to
external agents. For instance, the creation of a purchase order is an example of a business event in a purchasing application.You can define
your significant events in the Event manager.
The Workflow Engine traps errors produced by function activities by setting a savepoint before each function .If an activity produces an
unhandled exception, the engine performs a rollback to the savepoint, and sets the activity to the ERROR status.The Workflow Engine never
issues a commit as it is the responsibility of the calling application to commit.
Posted by Nilesh P at 2:18 PM No comments: Links to this post
Email ThisBlogThis!Share to TwitterShare to FacebookShare to Pinterest
Labels: Oracle WorkFlow
What is Workflow :
Training in Oracle WorkFlow :
Processes that involve multiple users and the routing of data between the users are termed as 'WORKFLOW'.
What are Workflow Components: Workflow typically consist of 4 Rs
Rules : Rules are your company's business practices captured in software. Rules determine what activities are required to process your
business data.
Roles : Roles describe how people fit into the workflow. A role is a class of users who perform the same type of work, such as clerks or
managers. Your business rules typically specify what user role needs to do a specific activity. Roles allow work to be directed to Types of
people than individuals hence allow flexible and easier to manitain Workflows.
Routings : Routings connect the activities in the workflow. They are the system's means of moving information from one place to another,
from one step to the next. Routings specify where the information goes and what form it takesbased on results at decision point or
responses to email message or completion of activity. Routings bring the flow into workflow. They get the right information to the right people
at the right time, enabling users to work together to accomplish the company's goals.
Real Time : Real Time means Workflow should be able escalate an activity to next level action or role in case a certain activity is not
executed in specific time, for example if the Department Manager doesnt approve or reject the leave request within 48 hrs then it should be
escalated to VP-HR.
WHAT CAN WORKFLOW DO : Routes information to various users based on certain rules. Tracks the responses from the users and
takes actions accordingly. Enables people to receive E-Mail notifications Allows incorporation of custom packages and procedures E-Mail
integration of choice. Internet enabled workflow allows you to view Workflow notifications through any Internet browser. One can also
monitor the processes through a browser.