Oracle Workflow
Oracle Workflow
Routing Information
Oracle Workflow lets you provide each person with all the information they
need to take action. Oracle Workflow can route supporting information to
each decision maker in a business process.
Personal Inbox Users who connect to Oracle Applications can see all the
notifications awaiting their attention in a common Notification Viewer form,
or Personal Inbox. Choosing a notification takes users to a Notification Details
window that describes any actions they need to take. The Notification Details
window can take users directly to an Oracle Applications form where they
can perform the necessary action.
Workflow Processes
Oracle Workflow manages business processes according to rules that you
define. The rules, which we call a workflow process definition, include the
activities that occur in the process and the relationship between those
activities. An activity in a process definition can be an automated function
defined by a PL/SQL stored procedure, a notification to a user or role that
may optionally request a response, or a subflow that itself is made up of a
more granular set of activities.
A workflow process is initiated when an application calls a set of Oracle
Workflow Engine APIs. The Workflow Engine takes over by driving the
relevant work item defined by the application, through a specific workflow
process definition. According to the workflow process definition, the
Workflow Engine performs automated steps and invokes appropriate agents
when external processing is required.
Step 10: You can modify the templates for your electronic mail notifications.
Step 11: You can include additional icons to your Oracle Workflow Icons
subdirectory to customize the diagrammatic representation of your workflow
processes. Use custom icons to provide meaningful symbols for each activity
you define.
[If you ever need to determine the version of the Oracle Workflow server you
are running, you can connect to your Workflow server account using
SQLPLUS and run a script called wfver.sql.]
Step 1: Setting Up an Oracle Workflow Directory
Service
Oracle Workflow offers you flexibility in defining who your workflow users
and roles are. You determine the directory repository you want Oracle
Workflow to reference for users and roles information by creating three
views based on the database tables that make up that repository. The views
are: WF_USERS, WF_ROLES, and WF_USER_ROLES.
Oracle Workflow provides three local tables called WF_LOCAL_USERS,
WF_LOCAL_ROLES, and WF_LOCAL_USER_ROLES which you can use to add
information about users and roles not included in your existing directory
repository.
[Note: Currently you must use SQL*PLUS or create your own custom
application interface to enter data into these WF_LOCAL tables.]
The Name column must be sourced from a column that is less than 30
characters long and is all uppercase. If your source table does not have a
column that meets these criteria, DO NOT use string functions to force these
restrictions. Instead, define the Name column to be : so that Oracle Workflow
can reference the original base table where users are stored and a unique
user in that table. For example, "PER_PEOPLE:009" represents a user whose
employee ID is 009 and is stored in the personnel table called PER_PEOPLE.
The Name column must be sourced from a column that is less than 30
characters long and is all uppercase. If your source table does not have a
column that meets these criteria, DO NOT use string functions to force these
restrictions. Instead, define the Name column to be : so that Oracle Workflow
can reference the original base table where roles are stored and a unique
role in that table. For example, "PER_POSITION:009" represents a position
whose ID is 009 and is stored in the personnel table called PER_POSITION.
To take advantage of unique indexes when querying users, make sure you
initially enter the usernames in your database in uppercase only. Forcing the
usernames to uppercase in your view definition results in poor performance
when accessing these views.
Warning: Avoid making a join to a view that contains a union as this results
in poor database performance. Oracle7 is currently unable to preserve the
indexes in that view when you make such a join. The workflow directory
services views you create will most likely contain unions, therefore you
should not join to them directly. If you need to retrieve data from any of the
three directory services views, use the appropriate directory services API.
Overview of Notification Handling
Oracle Workflow sends a notification to a role when the Workflow Engine
executes a notification activity in a workflow process. The notification activity
may designate the role as being responsible for performing some human
action or may simply relay process-related information to the role. To
successfully deliver a notification to a role, the role must be defined in the
Oracle Workflow directory service.
As a member of a role, you can view a notification using any one of four
interfaces depending on your role's notification preference setting in the
Oracle Workflow directory service. You can receive an E-mail for each
individual notification, receive a single E-mail summarizing all your
notifications, query the Workflow Notifications Web page or query the
Workflow Notification Viewer form (for Oracle Applications users only) for
your notifications.
Each notification message can include context-sensitive information about
the process and directions on how to respond to the notification, if a
response is required. The message can also include pointers to Web URLs
and references to Oracle Applications forms that allow the user to get
additional information related to the notification.
As a notification recipient, there may be occasions when you will not be able
to view or respond to your notifications in a timely manner. Rather than
create a bottleneck in a workflow process, you can take advantage of the
Automatic Notification Handler to define rules that direct Oracle Workflow to
automatically handle the notifications for you.
Step 2: Creating the WF_LANGUAGES View
The field values in the property pages of Oracle Workflow Builder and the
workflow notifications delivered to your users can be translated to the
languages defined in your Oracle installation. However, in order for this to be
possible, you must create a view called WF_LANGUAGES that identifies the
languages defined in your Oracle installation. Oracle Workflow uses this view
to create in its translatable tables, a row for each language that maps to a
row found in its non-translated base table.
The WF_LANGUAGES view must include the following columns:
Code--The language code.
Display_Name--The display name of the language.
NLS_Language--The value of the Oracle NLS_LANGUAGE initialization
parameter that specifies the default language-dependent behavior of a
session.
NLS_Territory--The value of the Oracle NLS_TERRITORY initialization
parameter that specifies the default territory-dependant date and numeric
formatting of a session.
NLS_Codeset--The code set for the language.
Installed_Flag--Flag to indicate if the language is installed and available for
use.A sample WF_LANGUAGES view is included in the script of each of the
predefined directory services that Oracle Workflow provides.
[Note: If you are using the version of Oracle Workflow embedded in Oracle
Applications, the file wfcfg.msg is located in the resource/ subdirectory under
$FND_TOP. If you are using the standalone version of Oracle Workflow, the
file is located in the Oracle Workflow server res/ subdirectory.]
Replace with the username, password and SQL*Net connect string or alias to
your database and with the full path and name of the source file you want to
upload. The optional -v flag causes the program to validate the source file
against the database.
For Oracle Workflow embedded in Oracle Applications:
1. The Workflow Resource Generator program is registered as a concurrent
program. You can run the Workflow Resource Generator concurrent program
from the Submit Requests form or from the command line.
2. To run the concurrent program from the Submit Requests form, navigate
to the Submit Requests form.
Note: Your system administrator needs to add this concurrent program to a
request security group for the responsibility that you want to run this
program from.
3. Submit the Workflow Resource Generator concurrent program as a
request.
4. In the Parameters window, enter values for the following parameters:
Destination Type
Specify "Database", to upload seed data to the database table
WF_RESOURCES from a source file (.msg), or "File", to generate a resource
file from a source file.
Destination
If you specify "File" for Destination Type, then enter the full path and name
of the resource file you wish to generate. If you specify "Database" for
Destination Type, then the program automatically uses the current database
account as its destination.
Source
Specify the full path and name of your source file.
5. Choose OK to close the Parameters window.
6. When you finish modifying the print and run options for this request,
choose Submit to submit the request.
7. Rather than use the Submit Requests form, you can also run the Workflow
Resource Generator concurrent program from the command line using one of
two commands.
- To generate a resource file from a source file, type: WFRESGEN apps/pwd
0 Y FILE res_file source_file
- To upload seed data to the database table WF_RESOURCES from a source
file, type: WFRESGEN apps/pwd 0 Y DATABASE source_file
Replace apps/pwd with the username and password to the APPS schema,
replace res_file with the file specification of a resource file, and replace
source_file with the file specification of a source file (.msg). A file
specification is specified as:
@:[
/.../]file.ext
2. If you want all users and roles to have workflow administration privileges,
such as in a development environment, replacewith an asterisk (*) as
follows:
WFTKN WF_ADMIN_ROLE 0 *
3. Run the Workflow Resource Generator to load the contents of wfcfg.msg
into the table WF_RESOURCES.
Workflow Open Mail Message The Notification system uses the Workflow
Open Mail message as a template for all E-mail notifications that require a
response. The template includes generic instructions on how to respond to a
notification. It also includes the following information about a message:
message priority, date that a response is due, or if the notification is
forwarded from another user, and any comments from the sender or
forwarder of the message.
The Workflow Open Mail message has the following message attributes. The
values are drawn from the message definition associated with a notification
activity.
START_DATE -The date the message is sent.
TO -The role the notification is sent to; the performer.
SUBJECT -The subject line defined in the message.
BODY -The text of the body defined in the message.
COMMENT -Comments added by the sender or the forwarder.
PRIORITY -The priority of the notification message.
DUE_DATE -The date by which a response is required, specified in the
notification activity.
NOTIFICATION -Required notification code used to identify the information
in the notification.
RESPONSE -The user response section as defined by the Respond message
attributes in the actual notification message definition.
You can customize the boilerplate text that appears in the body of the
Workflow Open Mail template. The body of the Workflow Open Mail template
contains the following default text, where attributes preceded by an
ampersand (&) are token substituted with runtime values when the
notification is sent:
Oracle Workflow Notification
&COMMENT
-------------------------------------------
Response Instructions for &NOTIFICATION
To submit your response, reply to this message, including this note with your
reply. The first lines of your reply must be your responses to the notification
questions. Instructions below detail exactly what should be placed on each
line of your reply.
&RESPONSE
-------------------------------------------
Notification Details:
&BODY
Due Date: &DUE_DATE
Workflow Open FYI Mail Message The Notification system uses the
Workflow Open FYI Mail message as a template for all E-mail notifications
that do not require a response. The template indicates that the notification is
for your information (FYI) and does not require a response. In addition to the
message, the template also includes any comments from the sender or
forwarder of the message.
The Workflow Open FYI Mail message has the following message attributes.
The values are drawn from the message definition associated with a
notification activity.
START_DATE -The date the message is sent.
TO -The role the notification is sent to; the performer.
SUBJECT -The subject line defined in the message.
BODY -The text of the body defined in the message.
COMMENT -Comments added by the sender or the forwarder.
PRIORITY -The priority of the notification message.
DUE_DATE -The date by which a response is required, specified in the
notification activity.
NOTIFICATION -Required notification code used to identify the information in
the notification.
You can customize the text that appears in the body of the Workflow Open
Mail template. The body of the Workflow Open Mail template initially
contains the following default text, where attributes preceded by an
ampersand (&) are token substituted with runtime values when the
notification is sent:
Oracle Workflow Notification (FYI)
&COMMENT
-------------------------------------------
&BODY
Workflow Invalid Mail Message The Workflow Invalid Mail message gets
sent to a user when a user responds incorrectly to a notification. The
message describes how to respond to the notification correctly. The message
attributes are as follows:
START_DATE -The date the original message was sent.
TO -The role the notification is sent to; the performer.
SUBJECT -The subject line of the original message.
BODY -The text of the original message.
COMMENT -Comments added by the sender or the forwarder.
PRIORITY -The priority of the notification message.
DUE_DATE -The date by which a response is required, specified by the
notification activity.
NOTIFICATION -Required notification code used to identify the information in
the notification.
RESPONSE -The user response section as defined by the Respond message
attributes in the original message definition.
MAIL_ERROR_MESSAGE -An error message that the mail program generates
if an error occurs upon processing the response.
MAIL_ERROR_ STACK -An error stack of arguments that the mail program
generates if an error occurs upon processing the response. You can provide
this information to your support representative if the problem cannot be
resolved with a corrected response.
The body of the Workflow Invalid Mail template initially contains the
following customizable text:
Oracle Workflow Notification
&COMMENT
NOTE: Your previous response to this message was
invalid (see error message below). Please resubmit your
response.
Error Message: &MAIL_ERROR_MESSAGE
Error Stack: &MAIL_ERROR_STACK
--------------------------------------------------
Response Instructions for &NOTIFICATION
To submit your response, reply to this message, including this original with
your reply. This note contains a special NID string that is required to process
the response. The first lines of your reply must be your responses to the
notification questions. You should enter one line for each response required
by the notification, any additional lines will be ignored. You may leave a line
blank to accept the default value for that specific response. You must supply
a value or a blank line for each question asked. Instructions below detail
exactly what should be placed on each line of your reply.
&RESPONSE
-------------------------------------------
Notification Details:
&BODY
Due Date: &DUE_DATE
Reviewing Notifications via Electronic Mail You can have your workflow
notifications delivered to you as E-mail messages if your notification
preference is set to 'MAILTEXT' or 'MAILHTML' in the Oracle Workflow
directory service views. If your E-mail tool supports attachments, an E-mail
notification may include an HTML attachment with the content and response
fields of the notification formatted in a Web page. The user may respond
either by replying to the E-mail as specified by the directions included in the
E-mail, or by activating the HTML attachment and filling in the requested
information in the resulting Web page.
You can receive E-mail notifications using any mail application that is MAPI-
compliant running on Windows NT or that Oracle Office/InterOffice or UNIX
Sendmail can provide a gateway to. The following example shows a
notification received through Oracle Office.
The E-mail notification is based on a standard template defined in Oracle
Workflow Builder. It describes the syntax the reply should follow, and lists
the information needed to confirm the notification. The message also
identifies any custom site information, specifies the due date of the
message, and details any information necessary to process the response.
Step 11: Adding Custom Icons to Oracle WorkflowOracle
Workflow
Builder looks for icons in the Icon subdirectory of the Oracle Workflow area
on your PC. The Icon subdirectory is defined in the registry of Oracle
Workflow Builder. The Oracle Workflow area is typically the WF20
subdirectory within your ORACLE_HOME for Windows 95 or NT directory
structure.
Workflow provides a variety of icons that you can use with your activities and
processes. You can add any icon files to this area as long as they are
Windows icon files with the .ico suffix.
If you want the custom icons that you include in your Oracle Workflow
Builder process definition to appear in the Workflow Monitor when you view
the process, you must do the following:
Convert the custom icon files (.ico) to gif format (.gif).
Copy the .gif files to a directory where the Workflow Monitor can access
them:
For the standalone version of Oracle Workflow -- //wf/java/oracle/wf/icons
For the Oracle Applications-embedded version of Oracle Workflow
-- /oracle/wf/icons
[Note: The Workflow Definitions Loader program references the access level
stored in the environment variable called WF_ACCESS_LEVEL, which you
must define when you install Oracle Workflow on your server. If you do not
define this environment variable, the Workflow Definitions Loader simply
assumes a default access level of 100. ]
[Note: When you install the standalone version of Oracle Workflow on your
server, you need to define this variable in an environment file. The default
environment file is APPLSYS.env. If you do not define this environment
variable, the Workflow Definitions Loader simply assumes a default access
level of 100.]
Protection Level
Whenever you create a workflow object in Oracle Workflow Builder, you
have the option of protecting the object at a certain level. An object's
protection level controls whether other users can modify the object based on
their access levels.
To change the protection level of an object, display the Access tab of the
object's property page. The protection level that you set for an object is
dependent on your current access level. You can control access to an object
in one of four ways:
Allow access to everyone--By default, all users are allowed access to an
object if both "Preserve Customizations' and 'Lock at this Access Level' are
unchecked in the Access tab, that is the protection level is equal to 1000.
Limit access to users with access levels equal to your own or higher--If you
check 'Preserve Customizations' in the Options region of the Access tab, you
designate the object as being customizable by anyone with an access level
equal to or higher than your current access level. You should only mark
objects as customizable if you are sure that you will not be providing
upgraded versions of this object in the future that would overwrite other
user's customizations to it.
Limit access to users with access levels equal to your own or lower--If you
check 'Lock at this Access Level', you protect the object and ensure that the
object may only be modified by users with an access level equal to or lower
than your current access level. Users operating at a higher access level will
see a small lock on the workflow object's icon, indicating that the object can
be used but not modified. Protect any objects that you want to define as
standard components that will not change unless you provide a global
upgrade. For this reason, it is important that you always operate at the same
consistent access level.
Limit access to users with access levels equal to your own--If you check both
'Lock at this Level' and 'Preserve Customizations' you ensure that the object
cannot be modified by anyone other than users operating at your current
access level.
Preserve Customizations
Lock at this Access Level
Access Level applied to Object
Object may only be updated by users with access levels equal to or higher
than your current access level.
X
Object may only be updated by users with access levels equal to or lower
than your current access level.
X
X
Object cannot be updated by any access level except for your current access
level.
Mode - Data Transfer - Data Protected at Access Level Less Than Loader
Access Level -Customized Data
UPGRADE --------File to Database ----Preserved ----Preserved
UPLOAD ----------File to Database ----Preserved ----Overwritten
FORCE ------------File to Database ----Overwritten ----Overwritten
DOWNLOAD ------Database to File ----Not Applicable ----Not Applicable
GetRoleUsers
Syntax:
procedure GetRoleUsers
(role in varchar2,
users out UserTable);
Description: Returns a table of users for a given role.
Arguments (input) role: A valid role name.
GetUserRoles
Syntax:
procedure GetUserRoles
(user in varchar2,
roles out RoleTable);
Description: Returns a table of roles that a given user is assigned to.
Arguments (input):user: A valid username.
GetRoleInfo
Syntax :
procedure GetRoleInfo
(Role in varchar2,
Display_Name out varchar2,
Email_Address out varchar2,
Notification_Preference out varchar2,
Language out varchar2,
Territory out varchar2);
IsPerformer
Syntax :
function IsPerformer
(user in varchar2,
role in varchar2);
Description : Returns true or false to identify whether a user is a performer
of a role.
Arguments (input):
user: A valid username.
role: A valid role name.
CurrentUser
Syntax :
function CurrentUser
return varchar2;
UserActive
Syntax :
function UserActive
(username in varchar2)
return boolean;
GetUserName
Syntax :
procedure GetUserName
(p_orig_system in varchar2,
p_orig_system_id in varchar2,
p_name out varchar2,
p_display_name out varchar2 );
Description : Returns a Workflow display name and username for a user
given the system information from the original user and roles repository.
Arguments (input) :
p_orig_system: Code that identifies the original repository table.
p_orig_system_id : ID of a row in the original repository table.
GetRoleName
Syntax :
procedure GetRoleName
(p_orig_system in varchar2,
p_orig_system_id in varchar2,
p_name out varchar2,
p_display_name out varchar2 );
Description :Returns a Workflow display name and role name for a role
given the system information from the original user and roles repository.
Arguments (input) :
p_orig_system: Code that identifies the original repository table.
p_orig_system_id : ID of a row in the original repository table.
Response Processing
You must create three folders or files in your response mail account before
starting the Notification Mailer to process responses. The three folders or
files serve to hold discarded, unprocessed, and processed messages.
The Notification Mailer does the following to check for response messages:
Logs into the response mail account.
Checks for messages. If a message exists, it reads the message, checking for
the notification ID and node identifier.
If the message is not a notification, it moves it to the discard folder.
If the message is a notification for the current node, it moves the message to
the unprocessed folder.
If the message is a notification, but for the wrong node, it does not move the
message so that the Notification Mailer for the correct node can read it
later.The Notification Mailer then opens the unprocessed folder to process
each response. For each message, it:
Retrieves the notification ID.
Checks to see if the message bounced by referring to a specified tag file, if
any. If the message bounced, it reroutes it or updates the notification's
status and stops any further processing depending on the specifications of
the tag file.
Checks the Oracle Workflow database for this notification.
If the notification does not exist, it moves it to the discard folder.
If the notification exists, but is closed or canceled, it moves it to the discard
folder.
If the notification exists and is open, it verifies the response values with the
definition of the message's response attributes in the database. If a response
is invalid, it sends an Workflow Invalid Mail message to the recipient role. If
the responses are valid, it calls a Respond function to complete the
notification response and saves the change to the database.
Moves the message for the completed notification to the processed folder
and closes the unprocessed folder.The Notification Mailer then truncates the
discard and processed folders, if a '-' precedes the discard and process
parameters specified in the configuration file, and logs out of the mail and
database accounts.
Workflow Monitor
The Workflow Monitor is a tool that allows you to view and administer the
status of a specific instance of a workflow process. You can use the point-
and-click interface to display detailed status information about activities in
the process as well as about the process as a whole. The Workflow Monitor
can be run in 'USER' or 'ADMIN' mode, where 'ADMIN' mode provides
additional details and functionality pertinent only to a workflow
administrator.