You are on page 1of 10

Oracle Workflow Builder:

Oracle Workflow Builder is a graphical tool for creating, viewing, and modifying
workflow process definitions. It contains a Navigator window that you use to define the
activities and components of your business process. You then assemble the activities in a
process window to create a process diagram.
At any time you can add, remove, or change workflow activities, or set
up new prerequisite relationships among activities. Oracle Workflow manages business
processes according to rules that you define.

Workflow Engine:
The Workflow Engine embedded in the Oracle database server implements process
definitions at runtime. The Workflow Engine monitors workflow states and coordinates
the routing of activities for a process. The Workflow Engine supports sophisticated
workflow rules, including looping, branching, parallel flows, and sub flows.

Business Event System:


The Business Event System consists of the Event Manager, which lets you register
subscriptions to significant events, and event activities, which let you model business
events within workflow processes.

 Attributes—lists the attributes for the current item type. Item type attributes
describe features of an item type. For example, if an item type is a purchase order
requisition, then an item type Attribute can be the requisition amount or the
requisition ID.

 Processes—lists the process activities or workflow process definitions for the


current item type. See: Process Window

 Notifications—lists the notification activities associated with the current item


type. A notification activity sends a message to a user or role. The message may
prompt for a response or may Simply provide information

 Functions—lists the function activities associated with the current item type. A
function activity represents a PL/SQL stored procedure that the Workflow Engine
executes automatically. A function activity can also have activity attributes
associated with it

 Events—lists the event activities associated with the current item type. An event
activity represents a business event that the process receives, raises, or sends

 Messages—lists the messages that a notification activity associated with the


current item type can send to a user or role. A message can have message
attributes associated with it.
 Lookup Types—lists the lookup types associated with the current item type. A
lookup type has one or more values called lookup codes associated with it. A
lookup type is a list of values that can be referenced by a message, or by a
notification, function, or process as its possible result type.

Access Level A numeric value ranging from 0 to 1000. Every workflow user operates at a
specific access level. The access level defines whether the user can modify certain
workflow data. You can only modify data that is protected at a level equal to or higher
than your access level.

Activity A unit of work performed during a business process.

Process A set of activities that need to be performed to accomplish a business goal.

Workflow Engine The Workflow Engine manages the state of all activities for an item,
automatically executes functions and sends notifications, maintains a history of
completed activities, and detects error conditions and starts error processes. The
Workflow Engine is implemented in server PL/SQL and activated when a call to an
engine API is made.

Performer A user or role assigned to perform a human activity (notification).


Notification activities that are included in a process must be assigned to a performer.

Role One or more users grouped by a common responsibility or position.

Notification An instance of a message delivered to a user.

Lookup Code An internal name of a value defined in a lookup type.

Lookup Type A predefined list of values. Each value in a lookup type has an internal and
a display name.

Item Type A grouping of all items of a particular category that share the same set of item
attributes. For example, PO Requisition is an item type used to group all requisitions
created by Oracle Internet Commerce’s Web Requisitions page. Item type is also used as
a high level grouping for processes.

Event An occurrence in an internet or intranet application or program that might be


significant to other objects in a system or to external agents.

Background Engines A supplemental Workflow Engine that processes deferred or timed


out activities.

Message The information that is sent by a notification activity. A message must be


defined before it can be associated with a notification activity. A message contains a
subject, a priority, a body, and possibly one or more message attributes.
Synchronous or Asynchronous Processes:
A workflow process can be either synchronous or asynchronous.

A synchronous process is a process that can be executed without interruption from start to
finish.
 The Workflow Engine executes a process synchronously when the process
includes activities that can be completed immediately, such as function activities
that are not deferred to the background engine.
 With a synchronous process, you can immediately check for process results that
were written to item attributes or directly to the database. However, the user must
wait for the process to complete.

An asynchronous process is a process that the Workflow Engine cannot complete


immediately because it contains activities that interrupt the flow.
 Examples of activities that force an asynchronous process include deferred
activities, notifications with responses, blocking activities, and wait activities.
 With an asynchronous process, the user does not have to wait for the process to
complete to continue using the application. However, the results of the process are
not available until the process is completed at a later time.

Item type: The internal name for the item type. Item types are defined in the Oracle
Workflow Builder.
Item key: The string uniquely identifies the item within an item type.
Actid : The ID number of the activity from which this procedure is called.

Funcmode : The execution mode of the activity. If the activity is a function activity, the
mode is either 'RUN' or 'CANCEL'. If the activity is a notification activity, with a post-
notification function, then the mode can be 'RESPOND', 'FORWARD', 'TRANSFER',
'TIMEOUT', or 'RUN'. Other execution modes may be added in the future.

Resultout: COMPLETE: activity completes with the indicated result code. The result
code must match one of the result codes specified in the result type of the function
activity.

WAITING activity is pending, waiting on another activity to complete before it


completes. An example is the Standard 'AND' activity.

DEFERRED: activity is deferred to a background engine for execution until a given


date. Must be of the format: to_char, f_engine.date_format)

NOTIFIED: an external entity is notified that an action must be performed. A


notification ID and an assigned user can optionally be returned with this result. Note that
the external entity must call Complete Activity () to inform the Workflow Engine when
the action completes.
ERROR: activity encounters an error and returns the indicated error code.
WF_CORE.CONTEXT (‘<Package name>',
'<Procedure name>',
<Item type>,
<Item key>,
To_char (<actid>),
<Command>);

Wf_engine.AddItemAttr(itemtype,
itemkey,
‘<new_attribute_name>’);

Wf_engine.SetItemAttrText( itemtype,
itemkey,
‘<new_attribute_name>’,
‘<New attribute value>’);

Creates a new runtime process for an application item.


Procedure CreateProcess
(itemtype in varchar2,
itemkey in varchar2,
process in varchar2 default ’’,
user_key in varchar2 default null,
owner_role in varchar2 default null);

Procedure StartProcess
(itemtype in varchar2,
itemkey in varchar2);

Procedure LaunchProcess
(itemtype in varchar2,
itemkey in varchar2,
process in varchar2 default '',
userkey in varchar2 default '',
owner in varchar2 default '');

Procedure SetItemAttrText
(itemtype in varchar2,
itemkey in varchar2,
aname in varchar2,
avalue in varchar2);

Procedure SetItemAttrNumber
(itemtype in varchar2,
itemkey in varchar2,
aname in varchar2,
avalue in number);
Procedure SetItemAttrDate
(itemtype in varchar2,
itemkey in varchar2,
aname in varchar2,
avalue in date);

Function GetItemAttrText
(itemtype in varchar2,
itemkey in varchar2,
aname in varchar2) return varchar2;

Function GetItemAttrNumber
(itemtype in varchar2,
itemkey in varchar2,
aname in varchar2) return number;

Function GetItemAttrDate
(itemtype in varchar2,
itemkey in varchar2,
aname in varchar2) return date;

Procedure Background
(itemtype in varchar2,
minthreshold in number default null,
maxthreshold in number default null,
process_deferred in boolean default TRUE,
process_timeout in boolean default FALSE,
process_stuck in boolean default FALSE);
Procedure ItemStatus
(itemtype in varchar2,
itemkey in varchar2,
status out varchar2,
result out varchar2);
1) What are the major components of the workflow system?
Workflow Engine,
Business Event System,
The Notification Service,
He Workflow Builder,
And administrative and monitoring tools.

The Workflow Engine is a set of tables and PL/SQL stored procedures that manage the
execution of workflow processes and tracks work-in- process.

2) What platform is workflow currently available on?


 Oracle Workflow embedded in Oracle Applications is available on all platforms
that Oracle Applications is available on.
 The builder of course is a client product running on Windows 95/98/2000/NT.

3) Can workflow work on a distributed database?


Yes - Oracle Workflow 2.6 includes a major new feature called the Business Event
System which supports the sending and receiving of messages between databases.

4) How does Oracle Workflow differ from Oracle Alert?


 Oracle Alert is a database event detection tool.
 Oracle Workflow technology enables automation and continuous improvement to
business processes, routing information according to user-defined business rules.

5) What electronic mail systems can I use in conjunction with Oracle Workflow
Notifications?
The Oracle Workflow Notification Mailer can be used (WFMAIL).

6) How do I verify the version of Oracle Workflow that I have installed?


For Workflow versions prior to 2.5:
SQL> select TEXT from WF_RESOURCES where NAME='WF_VERSION';

7) How do I select the 'File, Load Roles' option when it is grayed out?
To use the 'File, Load Roles' option you must store your workflow definition in
the database so that you have a database connection through which you can bring back
records from the database.

8) What Access Level should I be using in Oracle Workflow Builder?


You should be running the Workflow Builder with an Access Level of 100.

9)How do I trace errors in my Workflow processes?


 using the Workflow Monitor and/or wfstatus.sql script.
 Use wfstatus.sql to display an end user status report for an indicated item. The
output is 132 characters per line. Use the script as follows:
sqlplus <user/pwd> @wfstatus <item_type> <item_key>
10) How do I customize the Account Generator Workflow process for my company?
Customers are expected to customize the Account Generator process. You can
do this by editing the existing process or creating your own process, but this MUST be
within the seeded 'Item Type'. You should NOT create a NEW 'Item Type' as this would
NEVER be run by Account Generator.
If you create a new process, you must ensure it is "Runnable".
You must then assign the appropriate process to the Accounting Flex field structure in the
Account Generator Process window in Oracle Applications (login as System
Administrator, Application -> Flex fields -> Key -> Accounts and query up the required
Accounting flex field structure).

11) Whats new about Oracle Workflow 2.6?

 Executing custom code on the event information


 Sending event information to a workflow process

Concurrent programs can be run from the command line as well:


 WFRESGEN <apps/password> 0 Y FILE <res filespec> <source filespec>...
WFRESGEN <apps/password> 0 Y DATABASE <source filespec>...
WFLOAD <apps/password> 0 Y DOWNLOAD <output filespec> <item type>
WFLOAD <apps/password> 0 Y UPLOAD <input filespec>
WFLOAD <apps/password> 0 Y UPGRADE <input filespec>
WFMAIL <apps/password> 0 Y <config filespec>

for example
 WFLOAD apps/apps 0 Y UPGRADE @fnd:install/data/wferror.wft
 WFLOAD apps/apps 0 Y UPLOAD @po:install/data/poreq.wft
 WFLOAD apps/apps 0 Y DOWNLOAD myprocess.wft POREQ
 WFLOAD apps/apps 0 Y UPGRADE c:\orant\wf20\res\US\wfstd.wft

12) What is the difference between WFLOAD and wfload?

 UPPERCASE executable names usually refer to the Concurrent Manager variant


of the program.
 Lowercase executable names usually refer to the stand-alone unix version.
These two programs do the same thing, but take different arguments.

13) Can a workflow process be restarted from the point of failure?


Yes, Wf_Engine.HandleError is designed for this. When the cause of the error has
been corrected, the HandleError procedure can be called with the 'RETRY' option which
will attempt to re-execute the specified activity.

14) How can I tell if a work item already exists?


There is an API for this: WF_ITEM.ITEM_EXISTS
15) Does workflow always execute according to the latest definition for an itemtype?
No. Running processes use the activity definitions that were in effect when the process
was started.

16) How do I completely wipe out workflow definitions from the database?
There are scripts that directly delete workflow definition data from the database.
wfrmita.sql -- Delete all definitions for an ITem Attribute
wfrmitt.sql -- Delete all definitions for an ITem Type
wfrmall.sql -- Delete all definitions

17) What does wf_purge.total actually do?


WF_PURGE.TOTAL deletes obsolete runtime data which includes:
Items
Item activity statuses
Notifications
Expired activity versions

18) How do I raise errors in my application? DO I have to add errors to the


workflow resource table?
standard message dictionary APIs :
fnd_message.set_name(...);
fnd_message.set_token(...);
app_exception.raise_exception;

19) How do you retrieve the actual Performer's user name?


Use the API
username := wf_notification.Responder(nid)

20) How does the DOCUMENT type attribute work?

The DOCUMENT type attribute permits you to execute a pl/sql package procedure
which you may use to build the message body dynamically at run time. For example, if
you have an unlimited number of lines to display, rather than hardcoding an attribute for
each line and setting a limit, use the DOCUMENT type. This allows you to call a
package with the following parameters
procedure MY_PROCEDURE
( document_id in varchar2, -- your parameter list
display_type in varchar2, -- either text/plain of text/HTML set by WF
document in out varchar2, -- out string inserted into mesage body by WF
document_type in out varchar2) -- usually set this equal to display_type
is ...

SetItemAttrText(item_type,item_key,
'NEW_ITEM_ATTR_NAME',
'plsql:my_package.my_procedure/'||item_type||':'||item_key);
21) How to identify what type of events are in the WF_DEFFERED queue?
select corrid,
decode(state,0, '0 = Ready',1, '1 = Delayed',2, '2 = Retained', 3, '3 = Exception',
to_char(state)) State,
count(*) COUNT
from WF_DEFERRED
group by corrid, state;

The next statements will show how many events of each type are in the
WF_DEFERRED queue:
column EVENT_NAME format a40;

select w.user_data.event_name EVENT_NAME,


count(*) COUNT
from WF_DEFERRED w
group by w.user_data.event_name

22) How do you determine the WF Item Key value to run wfstatus.sql for Account 
Generator workflows?
Select item_key, begin_date, end_date
from wf_items
where item_type = 'PAAPINVW'
and begin_date between '&low_start' and '&high_start';

You might also like