Workflow Interview Questions and Answers
Workflow Interview Questions and Answers
1)
Benefits:
1)
Create a clear business process definition
2)
Automate the business routings
3)
Monitor the process
4)
Allow users to define their own business process to suit their
organization needs.
5)
Readily change the business process definitions in case of a
change business process
Workflow Advantages and Disadvantages?
Setting up workflows for your business processes can provide
several advantages:
Workflows provide good reporting metrics; by using workflows,
an audit trail can
be created of who signed off on content at various points of the
life cycle of the
Content.
Workflows help you get the right information to the relevant
person, and the
Relevant information to the right person.
Designing a workflow forces you to examine and understand
your business
Processes, helping you find areas that can be improved.
The same elements that provide advantages can also be
disadvantages: you will
be forced to examine your business processes and map out how
you want to use
workflows.This can be a time-consuming process, but the end
result is worth it.
Page 1 of 84
WORKFLOW
Types of Workflows
There are three types of workflows:
A criteria workflow is used for content that enters a workflow automatically
based on metadata that matches predefined criteria.
A basic workflow defines the review process for specific content items, and
must be initiated manually.
In addition to these two basic types, sub-workflows can be used. Subworkflows do not have an initial contribution step, but are entered via a
workflow jump. They are created in the same manner as criteria workflows.
Sub-workflows are useful for splitting large, complex workflows into
manageable pieces.
2)
Page 2 of 84
WORKFLOW
3)
4)
5)
6)
7)
8)
What are the different types of attribute and how they can
be used?
9)
WORKFLOW
2. Manual
10)
11)
YES/NO
APPROVAL
BOLLEAN
(TRUE/FALSE)
LOOP COUNTER
(EXIT/LOOP)
Routing Action
(FORWARD/ NOOP/ RESPOND/TRANSFER)
<DEFALUT>
SUCCESS/FAILURE
(APPROVE /REJECT)
WORKFLOW
WORKFLOW
16)
Page 6 of 84
WORKFLOW
Concurrent Progrm in
Workflow.docx
27) How can u display notifications in HTML format? What are the
steps?
28) How can I restrict the data base to enter the data in WF tables
which maintain
The log of launching of workflows?
29) What is event in workflow?
30) How can I set the notification format?(either text or HTML)
31) How can I run the workflow from the same position where WF
has been stuck
up because of error?
32) Launch Workflow from PLSQL Code?
declare
v_itemtype
v_itemkey
v_process
v_userkey
begin
VARCHAR2(50);
VARCHAR2(50);
VARCHAR2(50);
VARCHAR2(50);
v_itemtype := 'DEMOIT';
v_itemkey := '1233';
v_userkey := '1233';
v_process := 'DEMOPROCESS';
WF_ENGINE.Threshold := -1;
WF_ENGINE.CREATEPROCESS(v_itemtype, v_itemkey, v_process);
wf_engine.setitemuserkey(v_itemtype, v_itemkey, v_userkey );
wf_engine.setitemowner (v_itemtype, v_itemkey,'SYSADMIN');
WF_ENGINE.STARTPROCESS(v_itemtype, v_itemkey);
commit;
exception when others
then
dbms_output.put_line(SQLERRM);
end;
WORKFLOW
Roles are similar to email distribution lists. Roles holds group of users to send
email.
How do you download or upload a workflow from a server?
We can do in two ways
1. from command prompt using wfload
2. Open workflow in standalone builder and then do save as and select
database.
To Start Oracle Workflow Builder from the MSDOS Prompt:
Rather than starting Oracle Workflow Builder by doubleclicking on its
Windows icon, you can also type in a command at the MSDOS
prompt and specify the file or database to connect to.
1. In an MSDOS prompt window, type the following command to Start Oracle
Workflow Builder with a specific workflow data file, Where <filename.wft>
represents the full path and name of the data file:
wfbldr <filename.wft>
2. To start Oracle Workflow Builder with a specific database connection, type
the
following
command
at
the
MSDOS
prompt,
where
<username/password@connect>
represents
the
database
account
information to connect to:
wfbldr c <username/password@connect>
Note: If you run Oracle Workflow Builder in Microsoft Windows 98 or
Windows NT 4.0 or higher, you can also Doubleclick on a workflow data file
(.wft) from the Windows Explorer to automatically open that file and start
Oracle Workflow Builder.
Note: If you are using the version of Oracle Workflow Embedded in Oracle
Applications, use the APPS schema to Connect to the database.
3. To start Oracle Workflow Builder and open a specified item type in a data
store, append the following to the appropriate command shown in Step 1 or
2, where <item_type> represents the internal name of the item type you
want to open:
E <item_type>
For example:
wfbldr wfdemo.wft E wfdemo
4. To start Oracle Workflow Builder and open a specified process diagram in a
data store, append the following to the appropriate command shown in Step
1 or 2, where <item_type:process> represents the internal names of the
item type and process you want to open:
E <item_type:process>
For example:
wfbldr wfdemo.wft E WFDEMO:NOTIFYAPPROVER
How to retry multiple errored workflow processes?
Page 8 of 84
WORKFLOW
How do you define start and end functions in workflow? How does
they differ from normal functions?
Using the standard functions available in WFSTD Item type we define start
and end functions. They are standard to which we dont need to link any
PL/SQL function and return any value to it.
What are the activity status in workflow ?
An Activity May have the following status :
Active
-Activity is Running
Complete
-Activity Completed Normally
Waiting
-Activity is Waiting to Run
Notified
-Notification Activity is Delivered And Open
Deffered
-Activity is Deffered
Error
-Activity is Completed With Error
Suspended
-Activity is Suspended
Page 9 of 84
WORKFLOW
A workflow can be initiated from PL/SQL using 2 methods, Launch Process and Start
Process. I have given examples of both methods below
Launch Process
CREATE OR REPLACE PACKAGE launchwflow_pkg
AS
PROCEDURE launchwf;
END launchwflow_pkg;
/
CREATE OR REPLACE PACKAGE BODY launchwflow_pkg
AS
PROCEDURE launchwf
IS
l_wfsequence
NUMBER;
BEGIN
l_wfsequence := '123456';
-- Kick off the workflow
Page 10 of 84
WORKFLOW
wf_engine.launchprocess (itemtype => 'PKWFPROP',
itemkey => l_wfsequence,
process => 'PKPROPOSAL',
userkey => '3456456466',
owner
=> 'OPERATIONS'
);
COMMIT;
RETURN;
END launchwf;
END launchwflow_pkg;
/
Start Process
CREATE OR REPLACE PACKAGE BODY wflowproc
AS
PROCEDURE start_test_wf
IS
ret_stat
NUMBER;
l_wfsequence
NUMBER;
l_itemtype
VARCHAR2 (40);
l_process
VARCHAR2 (40);
l_userkey
VARCHAR2 (40);
l_owner
VARCHAR2 (40);
l_parent_itemtype
VARCHAR2 (40);
l_parent_itemkey
VARCHAR2 (40);
BEGIN
l_itemtype := 'PKWFPROP';
l_process := 'PKPROPOSAL';
l_userkey := 'ABCD1234';
l_owner := 'OPERATIONS';
l_wfsequence := '12345';
-- Create the workflow process instance
wf_engine.createprocess (itemtype => l_itemtype,
itemkey => l_wfsequence,
process => l_process,
user_key => NULL,
owner_role => NULL
);
-- Set the user key of the workflow (the user key can be set in the
-- CreateProcess step also. Then this step will not be required)
wf_engine.setitemuserkey (itemtype => l_itemtype,
itemkey => l_wfsequence,
userkey => l_userkey
);
-- Set the workflow item owner
wf_engine.setitemowner (itemtype => l_itemtype,
itemkey => l_wfsequence,
owner
=> l_owner
);
-- Set the initial values for the attributes
wf_engine.setitemattrtext (itemtype => l_itemtype,
itemkey => l_wfsequence,
Page 11 of 84
WORKFLOW
aname => 'REQUESTOR',
avalue => 'OPERATIONS'
);
wf_engine.setitemattrtext (itemtype => l_itemtype,
itemkey => l_wfsequence,
aname => 'APPROVER',
avalue => 'MANAGER'
);
-- If the workflow we are about to execute is going to be a child
process
-- for another workflow then we need to connect the running parent
process
wf_engine.setitemparent (itemtype => l_itemtype,
itemkey => l_wfsequence,
parent_itemtype
=>
l_parent_itemtype,
parent_itemkey
=>
l_parent_itemkey,
parent_context
=> NULL
);
-- Kick off the workflow
wf_engine.startprocess (itemtype => l_itemtype, itemkey =>
l_wfsequence);
COMMIT;
END start_test_wf;
END wflowproc;
/
Page 12 of 84
WORKFLOW
How can you send direct oracle form link through workflow
notifications?
How can you send a notification to multiple users? Can you change
the list dynamically?
Page 13 of 84
WORKFLOW
Activity is deferred when the activity cost is greater than the Workflow
Engine
threshold. If the activity cost = 0 or if the activity cost is less than the
Workflow Engine
threshold, the activity will become Active.
9.
Page 14 of 84
WORKFLOW
10.
How will you define the possible results of an activity in order
to drive
different transitions?
As lookup codes for a lookup type
You define the possible results of an activity to drive different
transitions using
lookup codes for a lookup type.
You cannot use item attributes. Separating the activity into two does
not make sense
since you want to drive two transactions with the same activity, but
with two result
codes. A process activity will not help in this scenario.
11.
Time-out parameters apply to which activity in Oracle
workflow?
Notification
A time-out parameter only applies to a notification activity since the timeout parameters
are used to measure when a notification expires.
It does not apply to a function activity or a process activity.
12.
WORKFLOW
WORKFLOW
1.
WORKFLOW
C.
Notification
D.
All of the above
6.
What will solicit responses from a notification activity?
A.
Having a time-out parameter
B.
Having a performer
C.
Having a Send message attribute
D.
Having a Respond message attribute
7.
Which Work Engine API should you use to begin execution of
an activity?
A.
CreateProcess
B.
StartProcess
C.
ResumeProcess
D.
BeginActivity
8.
WORKFLOW
B.
C.
D.
Issue a commit
Generate a log file
Notify the user
ExplanationAn activity is deferred when the activity cost is greater than the
Workflow Engine threshold. If the activity cost = 0 or if the activity cost is
less than the Workflow Engine threshold, the activity will become Active.
2.
C.Notification
WORKFLOW
7.
B.StartProcess
ExplanationThe StartProcess API begins the execution of an activity. The
CreateProcess API creates a new runtime process for an item. The
ResumeProcess API resumes a suspended item. The BeginActivity determines
if the specified activity may currently be performed on the item.
8.
A.Common application processes
ExplanationCommon application processes come before the product family
processes, which come before product-specific processes. Common financial
is one of the product family processes. It does not come before product
family processes.
9.
WORKFLOW
WORKFLOW
******************************************************************************
********
WORKFLOW
WORKFLOW
4) For each of the two listeners, create the Edit link in the Action column.
5) Click on Edit.
6) Erase the value in Run Date then click on Submit.
How do i see the progress of the workflow process?
1) Choose the Responsibility: Workflow Administrator Web applications
2) Choose the Function: Find Processes
3) Look for processes for your workflow (i.e. OPM Quality Sample
Creation)
4) Listed are the workflow processes; Find the one with the transaction id
or date
5) Click on the hyper link for the process.
6) Click on "View Diagram"
7) The diagram shows you the progress of the process.
I see a Form Link in my notification but it is not enabled.?
-
Make sure the user has the responsibility function to access the
Samples Form.
Page 24 of 84
WORKFLOW
WORKFLOW
Disadvantages?
Page 26 of 84
WORKFLOW
2. Name five very important base tables of oracle workflow and their
significance.
Page 27 of 84
WORKFLOW
WF_ITEM_TYPES
The WF_ITEM_TYPES table defines an item that is transitioning through a workflow
process. NAME (PK), PROTECT_LEVEL, CUSTOM_LEVEL, PERSISTENCE_TYPE
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 (PK), NAME (PK), SEQUENCE, TYPE,
PROTECT_LEVEL, CUSTOM_LEVEL
WF_ACTIVITIES
WF_ACTIVITIES table stores the definition of an activity. Activities can be processes,
notifications, functions or folders.ITEM_TYPE (PK), NAME (PK), VERSION(PK), TYPE,
RERUN, EXPAND_ROLE, PROTECT_LEVEL, CUSTOM_LEVEL, BEGIN_DATE,
RROR_ITEM_TYPE, RUNNABLE_FLAG
WF_ACTIVITY_ATTRIBUTES
The WF_ACTIVITY_ATTRIBUTES table defines attributes which behave as parameters for
an activity. Activity attributes are only used by function activities.Examples of valid
attribute types are DATE, DOCUMENT, FORM, ITEMATTR, LOOKUP, and VARCHAR2.
ACTIVITY_ITEM_TYPE (PK), ACTIVITY_NAME (PK), ACTIVITY_VERSION (PK), NAME (PK),
SEQUENCE, TYPE, VALUE_TYPE, PROTECT_LEVEL, CUSTOM_LEVEL
WF_MESSAGES
WF_MESSAGES contains the definitions of messages which may be sent out as
notifications. TYPE (PK), NAME (PK), PROTECT_LEVEL, CUSTOM_LEVEL
WF_MESSAGE_ATTRIBUTES
WF_MESSAGE_ATTRIBUTES contains message attribute definitions.
WF_NOTIFICATIONS
WF_NOTIFICATIONS holds the runtime information about a specific instance of a sent
message. A new row is created in the table each time a message is sent.
WF_NOTIFICATION_ATTRIBUTES
WF_NOTIFICATION_ATTRIBUTES holds rows created for attributes of a notification. When
each new notification is created, a notification attribute row is created for each message
attribute in the message definition. Initially, the values of the notification attributes are
set to the default values specified in the message attribute definition.
WF_ITEMS
WF_ITEMS is the runtime table for workflow processes. Each row defines one work item
within the system. ITEM_TYPE (PK), ITEM_KEY (PK), ROOT_ACTIVITY,
ROOT_ACTIVITY_VERSION, BEGIN_DATE
Page 28 of 84
WORKFLOW
WF_ITEM_ACTIVITY_STATUSES
The WF_ITEM_ACTIVITY_STATUSES TABLE is the runtime table for a work item. Each row
includes the start and end date, result code, and any error information an activity
generates. ITEM_TYPE (PK), ITEM_KEY (PK), PROCESS_ACTIVITY (PK)
WF_ITEM_ACTIVITY_STATUSES_H
The WF_ITEM_ACTIVITY_STATUSES_H table stores the history of the
WF_ITEM_ACTIVITY_STATUSES table. ITEM_TYPE, ITEM_KEY, PROCESS_ACTIVITY
WF_PROCESS_ACTIVITIES
WF_PROCESS_ACTIVITIES stores the data for an activity within a specific process.
PROCESS_ITEM_TYPE, PROCESS_NAME, PROCESS_VERSION, ACTIVITY_ITEM_TYPE,
ACTIVITY_NAME, INSTANCE_ID (PK), INSTANCE_LABEL, PERFORM_ROLE_TYPE,
PROTECT_LEVEL, CUSTOM_LEVEL
WF_ACTIVITY_TRANSITIONS
The WF_ACTIVITY_TRANSITIONS table defines the transitions from one activity to
another in a process. Each row includes the activities at the beginning and end of the
transition, as well as the result code and physical location of the transition in the
process window. FROM_PROCESS_ACTIVITY (PK), RESULT_CODE (PK),
TO_PROCESS_ACTIVITY (PK), PROTECT_LEVEL,CUSTOM_LEVEL
WF_ACTIVITY_ATTR_VALUES
The WF_ACTIVITY_ATTR_VALUES table contains the data for the activity attributes. Each
row includes the process activity id and the associated value for the attribute.
PROCESS_ACTIVITY_ID (PK), NAME (PK), VALUE_TYPE, PROTECT_LEVEL, CUSTOM_LEVEL
3. Name five oracle workflow apis and their significance and use
Page 29 of 84
WORKFLOW
6. How would you continue the workflow which is in wait and which
is in block mode, name the api which is responsible for that
10. How would you force a user to not re-assign the workflow to
other user.
Page 30 of 84
WORKFLOW
WHERE item_type = '&item_type'
AND end_date IS NULL
ORDER BY to_date(begin_date,
'DD-MON-YYYY hh24:mi:ss') DESC;
-- notifications sent by a given workflow
select
wn.notification_id nid,
wn.context,
wn.group_id,
wn.status,
wn.mail_status,
wn.message_type,
wn.message_name,
wn.access_key,
wn.priority,
wn.begin_date,
wn.end_date,
wn.due_date,
wn.callback,
wn.recipient_role,
wn.responder,
wn.original_recipient,
wn.from_user,
wn.to_user,
wn.subject
from
wf_notifications wn, wf_item_activity_statuses wias
where wn.group_id = wias.notification_id
and wias.item_type = 'WSHSUPI'
and wias.item_key = 'CMS21408'
/
--prompt **** Find the Activity Statuses for all workflow activities of a
given item type and item key
SELECT execution_time,
to_char(ias.begin_date,
'DD-MON-RR HH24:MI:SS') begin_date,
ap.display_name || '/' || ac.display_name activity,
ias.activity_status status,
ias.activity_result_code RESULT,
ias.assigned_user ass_user
FROM wf_item_activity_statuses ias,
wf_process_activities
pa,
wf_activities_vl
ac,
wf_activities_vl
ap,
wf_items
i
WHERE ias.item_type = '&item_type'
AND ias.item_key = '&item_key'
AND ias.process_activity = pa.instance_id
AND pa.activity_name = ac.name
AND pa.activity_item_type = ac.item_type
AND pa.process_name = ap.name
Page 31 of 84
WORKFLOW
AND
AND
AND
AND
AND
AND
pa.process_item_type = ap.item_type
pa.process_version = ap.version
i.item_type = '&item_type'
i.item_key = ias.item_key
i.begin_date >= ac.begin_date
i.begin_date < nvl(ac.end_date,
i.begin_date + 1)
UNION ALL
SELECT execution_time,
to_char(ias.begin_date,
'DD-MON-RR HH24:MI:SS') begin_date,
ap.display_name || '/' || ac.display_name activity,
ias.activity_status status,
ias.activity_result_code RESULT,
ias.assigned_user ass_user
FROM wf_item_activity_statuses_h ias,
wf_process_activities
pa,
wf_activities_vl
ac,
wf_activities_vl
ap,
wf_items
i
WHERE ias.item_type = '&item_type'
AND ias.item_key = '&item_key'
AND ias.process_activity = pa.instance_id
AND pa.activity_name = ac.name
AND pa.activity_item_type = ac.item_type
AND pa.process_name = ap.name
AND pa.process_item_type = ap.item_type
AND pa.process_version = ap.version
AND i.item_type = '&item_type'
AND i.item_key = ias.item_key
AND i.begin_date >= ac.begin_date
AND i.begin_date < nvl(ac.end_date,
i.begin_date + 1)
ORDER BY 2,
1
/
--Get a list of all Errored Workflow Activities for a given item type/
item key
SELECT ac.display_name
activity,
ias.activity_result_code RESULT,
ias.error_name
error_name,
ias.error_message
error_message,
ias.error_stack
error_stack
FROM wf_item_activity_statuses ias,
wf_process_activities
pa,
wf_activities_vl
ac,
wf_activities_vl
ap,
wf_items
i
WHERE ias.item_type = '&item_type'
AND ias.item_key = '&item_key'
AND ias.activity_status = 'ERROR'
AND ias.process_activity = pa.instance_id
Page 32 of 84
WORKFLOW
AND
AND
AND
AND
AND
AND
AND
AND
AND
pa.activity_name = ac.name
pa.activity_item_type = ac.item_type
pa.process_name = ap.name
pa.process_item_type = ap.item_type
pa.process_version = ap.version
i.item_type = '&item_type'
i.item_key = ias.item_key
i.begin_date >= ac.begin_date
i.begin_date < nvl(ac.end_date,
i.begin_date + 1)
ORDER BY ias.execution_time
/
--prompt *** Error Process Activity Statuses
SELECT execution_time,
to_char(ias.begin_date,
'DD-MON-RR HH24:MI:SS') begin_date,
ap.display_name || '/' || ac.display_name activity,
ias.activity_status status,
ias.activity_result_code RESULT,
ias.assigned_user ass_user
FROM wf_item_activity_statuses ias,
wf_process_activities
pa,
wf_activities_vl
ac,
wf_activities_vl
ap,
wf_items
i
WHERE ias.item_type = i.item_type
AND ias.item_key = i.item_key
AND ias.process_activity = pa.instance_id
AND pa.activity_name = ac.name
AND pa.activity_item_type = ac.item_type
AND pa.process_name = ap.name
AND pa.process_item_type = ap.item_type
AND pa.process_version = ap.version
AND i.parent_item_type = '&item_type'
AND i.parent_item_key = '&item_key'
AND i.begin_date >= ac.begin_date
AND i.begin_date < nvl(ac.end_date,
i.begin_date + 1)
UNION ALL
SELECT execution_time,
to_char(ias.begin_date,
'DD-MON-RR HH24:MI:SS') begin_date,
ap.display_name || '/' || ac.display_name activity,
ias.activity_status status,
ias.activity_result_code RESULT,
ias.assigned_user ass_user
FROM wf_item_activity_statuses_h ias,
wf_process_activities
pa,
wf_activities_vl
ac,
wf_activities_vl
ap,
wf_items
i
WHERE ias.item_type = i.item_type
Page 33 of 84
WORKFLOW
AND
AND
AND
AND
AND
AND
AND
AND
AND
AND
AND
ias.item_key = i.item_key
ias.process_activity = pa.instance_id
pa.activity_name = ac.name
pa.activity_item_type = ac.item_type
pa.process_name = ap.name
pa.process_item_type = ap.item_type
pa.process_version = ap.version
i.parent_item_type = '&item_type'
i.parent_item_key = '&item_key'
i.begin_date >= ac.begin_date
i.begin_date < nvl(ac.end_date,
i.begin_date + 1)
ORDER BY 2,
1
/
prompt **** Error Process Errored Activities
SELECT ac.display_name
activity,
ias.activity_result_code RESULT,
ias.error_name
error_name,
ias.error_message
error_message,
ias.error_stack
error_stack
FROM wf_item_activity_statuses ias,
wf_process_activities
pa,
wf_activities_vl
ac,
wf_activities_vl
ap,
wf_items
i
WHERE ias.item_type = i.item_type
AND ias.item_key = i.item_key
AND ias.activity_status = 'ERROR'
AND ias.process_activity = pa.instance_id
AND pa.activity_name = ac.name
AND pa.activity_item_type = ac.item_type
AND pa.process_name = ap.name
AND pa.process_item_type = ap.item_type
AND pa.process_version = ap.version
AND i.parent_item_type = '&item_type'
AND i.parent_item_key = '&item_key'
AND i.begin_date >= ac.begin_date
AND i.begin_date < nvl(ac.end_date,
i.begin_date + 1)
ORDER BY ias.execution_time
/
prompt **** Attribute Values
SELECT NAME attr_name,
nvl(text_value,
nvl(to_char(number_value),
to_char(date_value))) VALUE
FROM wf_item_attribute_values
WHERE item_type = upper('&item_type')
AND item_key = nvl('&item_key',
Page 34 of 84
WORKFLOW
item_key)
/
--Count of all workflow deferred activities based
SELECT COUNT(1),
was.item_type
FROM apps.wf_items
wi,
apps.wf_item_activity_statuses was,
apps.wf_process_activities
pra
WHERE wi.item_type = was.item_type
AND wi.item_key = was.item_key
AND wi.end_date IS NULL
AND was.end_date IS NULL
AND was.activity_status = 'DEFERRED'
--AND was.item_type = 'REQAPPRV'
AND was.item_type = wi.item_type
AND pra.instance_id(+) = was.process_activity
GROUP BY was.item_type;
--check the various workflow agent listeners and their statuses
SELECT t.component_name,
p.owner,
p.queue_table,
t.correlation_id
FROM applsys.fnd_svc_components t,
applsys.wf_agents
o,
dba_queues
p
WHERE t.inbound_agent_name || t.outbound_agent_name = o.name
AND p.owner || '.' || p.name = o.queue_name
AND t.component_type LIKE 'WF_%AGENT%';
--query to find records that are pending in each of the workflow agent
listener queues
SELECT 'select ''' || t.component_name || ' (queue_table: ' ||
p.queue_table ||
')''||'' Count: ''||count(*) c from ' || p.owner || '.' ||
p.queue_table ||
' where deq_time is null and nvl(delay,enq_time)<sysdate-1/24 ' ||
nvl2(t.correlation_id,
'and corrid like ''' || t.correlation_id || ''' ',
NULL) || 'having count(*)>0;'
FROM applsys.fnd_svc_components t,
applsys.wf_agents
o,
dba_queues
p
WHERE t.inbound_agent_name || t.outbound_agent_name = o.name
AND p.owner || '.' || p.name = o.queue_name
AND t.component_type LIKE 'WF_%AGENT%';
--Look for deferred events in wf_deferred. this can also be used to track
the status of notifications/business events that are waiting to be
processed/that have errored out
Page 35 of 84
WORKFLOW
SELECT a.user_data.geteventname(),
decode(a.state,
0,
'0 = Ready',
1,
'1 = Delayed',
2,
'2 = Retained/Processed',
3,
'3 = Exception',
to_char(a.state)) state,
a.user_data.PARAMETER_LIST,
a.user_data.event_data,
a.user_data.event_key,
a.*
FROM apps.wf_deferred a
WHERE corrid LIKE '%oracle.apps.wsh.sup.ssro'
AND rownum < 10;
Page 36 of 84
WORKFLOW
WORKFLOW
15. Notifications
16. Problem Spotting
17. Security
About Workflow General
1. What is Oracle Workflow Cartridge and how does this relate to earlier
Workflow products ?
2. What platforms is it available on?
3. When will translated versions be available?
4. If I create custom workflows in 2.03, how do I upgrade to 2.5?
5. If I create custom workflows in 2.5, how do I upgrade to 2.6?
6 What are the major components of the workflow system?
8 Does Workflow integrate with LDAP or NDIS compliant directory
9 Can Workflow work on a distributed database?
10 What platform is Workflow currently available on?
11 How does Oracle Workflow differ from Oracle Alert?
12 What electronic mail systems can I use in conjunction with Oracle
Workflow Notifications?
13 How do I ensure that the correct mail APIs are linked into WFMAIL?
14 What electronic mail systems can I use in conjunction with Oracle
Workflow Notifications?
15 What version of Oracle Workflow is supported with Web Apps 2.0.1? For
example, can Applications 10.7 Prod 16/16.1 and Oracle Applications for the
Web 2.0.1 run with Oracle Workflow 1.x and 2.x ?
16 How do I ensure that the correct mail APIs are linked into WFMAIL?
17 How do I verify the version of Oracle Workflow that I have installed?
18 How do I shut down the Oracle Workflow Notification Mailer in Oracle
Applications?
19 How do I send a Summary Only Notification from Oracle Workflow?
20 How do I reorder the information displayed in the Notifications screen on
the Web.
21 How do I select the 'File, Load Roles' option when it is greyed out?
22 How does 'Expand Roles' work?
23 How to force a Workflow activity to run in background.
24 How do I create a new Workflow ?
25 Why does Oracle Workflow Builder drag and drop not work the same way
as other editors and Object Navigators?
26 How do I improve performance of my Oracle Workflow Views?
27 How do I define my Workflow time-out periods in business days instead of
in hours?
28 How do I display the Internal Name of an object in the Object Navigator?
29 How do I display the Performer of a Notification in the Process Detail
screen ?
30 How do I create a shortcut to my Workflow instance?
31 How do I customize the Account Generator Workflow process for my
Page 38 of 84
WORKFLOW
company?
32 What Access Level should I be using in Oracle Workflow Builder?
33 How do I trace errors in my Workflow processes?
34 When attempting to view concurrent request output or log information in
workflow 2.0.3 with Microsoft Internet Explorer, you receive the error
Authentication failed. What do you do?
What is Oracle Workflow Cartridge and how does it relate to earlier Workflow
products?
Oracle Workflow Cartridge is the name given to Oracle Standalone and the
Workflow Option to the database. As such, it has all the same licensing
restrictions as Standalone did before. Please check the licensing page for
more details.
What platforms is it available on?
Oracle Workflow 2.6 has been released on ALL platforms.
Page 39 of 84
WORKFLOW
format again, your 2.0.3 flat files will be saved in the 2.5 flat file format.
WORKFLOW
Page 41 of 84
WORKFLOW
What electronic mail systems can I use in conjunction with Oracle Workflow
Notifications?
The Oracle Workflow Notification Mailer can be used in conjunction with
Oracle Office/Oracle InterOffice (Oracle Internet Messaging 4.2 can be used
with Workflow 2.5), UNIX Sendmail, or MAPI-compliant mail applications.
How do I ensure that the correct mail APIs are linked into WFMAIL?
Oracle Workflow Standalone can be run using WFMAIL.snd for Unix Mail or
WFMAIL.ofc for Oracle InterOffice. Within Oracle Applications, there is only
one WFMAIL executable file, so this must be linked according to the mail
system you are using.
For example, if you wish to use Oracle InterOffice as your Oracle Workflow
notification mail system, you must perform the following link:
adrelink force=Y ranlib=Y "fnd WFMAIL_OFC"
Page 42 of 84
WORKFLOW
Page 43 of 84
WORKFLOW
mv WFMAIL_OFC WFMAIL
(to replace the existing WFMAIL executable)
After you complete the above steps, when you start the Workflow
Notifications
Mailer, it will pick up the new WFMAIL file and send Notifications using
Oracle InterOffice.
Note: When you install Oracle Applications 10.7 Prod 16/Prod 16.1 (or
Release 11), the WFMAIL file is automatically linked to use the Unix
Sendmail executable, so you must only relink (using the above
instructions) if you decide to use Oracle InterOffice.
How do I verify the version of Oracle Workflow that I have installed?
For Workflow versions prior to 2.5:
----------------------------------(If you are running Oracle Workflow Embedded in Oracle Applications)
(a) Connect to SQL*Plus as APPS user
(b) Then type, select TEXT from WF_RESOURCES where
NAME='WF_VERSION';
Note: In the Prod 16 version of Oracle Workflow, the version 2.0.0
is displayed when the actual version is 2.0.1
(If you are running Oracle Workflow Standalone)
(a) Connect to SQL*Plus using the Oracle Workflow user id
(b) Then type, select TEXT from WF_RESOURCES where
NAME='WF_VERSION';
For Workflow 2.5:
----------------(If you are running Oracle Workflow Embedded in Oracle Applications)
(a) cd $FND_TOP/sql
(b) Connect to SQL*Plus as APPS user
(c) Start wfver.sql
(this script details the Workflow Server version, status and version
information for the Workflow
packages and version information for the Workflow views)
(If you are running Oracle Workflow Standalone)
Page 44 of 84
WORKFLOW
(a) cd $ORACLE_HOME/wf/admin/sql
(b) Connect to SQL*Plus using the Oracle Workflow user id
(c) Start wfver.sql
(this script details the Workflow Server version, status and version
information for the Workflow
packages and version information for the Workflow views)
How do I shut down the Oracle Workflow Notification Mailer in Oracle
Applications?
The Notification Mailer is an executable program that continually poles for
messages that must be sent to users (Notifications).
To stop this program, you must place the shutdown file in the required
directory.
If you have the environment variable $APPLCSF set, then your notification
mailer shutdown file should be placed in the $APPLCSF/$APPLLOG directory.
If $APPLCSF is NOT set, then the notification mailer shutdown file should be
placed in the $FND_TOP/$APPLLOG directory.
How do I send a Summary Only Notification from Oracle Workflow? For
example, I may want to send a message to a user listing all notifications that
are currently open (i.e. awaiting a response) instead of a message for each
notification that they have outstanding.
To do so, you must set up summary only messages by doing the following:
(a) Ensure that the NOTIFICATION_PREFERENCE field in WF_USERS for that
particular user is set to 'SUMMARY'
(in Workflow 2.5, use the 'User Preferences' link from the Workflow Home
Page)
(b) Define a notification mailer with SUMMARY_ONLY set to 'Y':
(c) Create a new mail configuration file (use $FND_TOP/resource/wfmail.cfg
as a starting point).
(d) If you already have a notification mailer running, you should set
NODE to something different than the one already defined.
How do I reorder the information displayed in the Notifications screen on the
Web.
Mouse click the underlined column heading for the column you want to
reorder
(e.g., ascending vs descending) and the notifications are reordered
automatically.
Page 45 of 84
WORKFLOW
How do I select the 'File, Load Roles' option when it is greyed 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.
How does 'Expand Roles' work?
Expand Roles = N
---------------If you have Expand Roles set to 'N' and you are sending a Notification to a
Role Name, then a message is sent to every user in that role, and each
individual user will see that Notification in their Notification queue until
a single user in the role replies to that Notification. After which time, the
Notification is wiped from each user's Notification queue.
Expand Roles = Y
---------------If you have Expand Roles set to 'Y' and you are sending a Notification
to a Role Name, then a message is sent to every user in that role, and each
individual user will see that Notification in their Notification queue until
they reply or close that notification.
You will generally want to have Expand Roles set to 'Y' if you want to be sure
that every user in a particular role sees the message.
How to force a Workflow activity to run in background.
The workflow background engine threshold is set to 50 by default.
If you do not want the current job to run on-line then call
WF_ENGINE.THRESHOLD:=n; (where n is less than the cost setting for the
current job/activity), hence the workflow engine runs the job in background.
You should set the threshold limit back to 50 in SQL*Plus or in the next
function activity so that other activities are processed as expected.
How do I create a new Workflow ?
See Note:47711.1 for a step-by-step guide to creating
a new Workflow.
Why does Oracle Workflow Builder drag and drop not work the same way as
other editors and Object Navigators?
For Workflow 2.0.3:
------------------You need to use the 'split window' function to be able to drag
and drop.
Page 46 of 84
WORKFLOW
WORKFLOW
----------------------------------Choose View, Show Label, Performer in Designer (from the pull-down menu)
(the Performer will be displayed alongside the notification icon instead of the
display name of the notification itself)
For Workflow 2.5:
----------------Choose View, Show Label in Designer, Choose Performer (from the pull-down
menu).
How do I create a shortcut to my Workflow instance?
Open up the Oracle Workflow Builder
Choose File, Open (from the pull-down menu)
Click on the 'Database' radio button
Enter the relevant database connection information
Choose which Item Types you want to display in the Object Navigator
Choose File, Create Shortcut (from the pull-down menu)
Enter a shortcut name if you do not wish to use the default (default is
username<database connect string> e.g. apps@R11DEMO)
You can then use this shortcut to open up the Oracle Workflow Builder and
connect to that database automatically (you will be prompted to enter the
password to then connect to the database).
If you need to see more item types than you initially selected when you
created
the shortcut, choose File, Show/Hide Item Types (from the pull-down menu)
and
select the item types to show from the list.
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
Page 48 of 84
WORKFLOW
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 Flexfield
structure in the Account Generator Process window in Oracle Applications
(login
as System Administrator, Application -> Flexfields -> Key -> Accounts and
query
up the required Accounting flexfield structure).
What Access Level should I be using in Oracle Workflow Builder?
You should be running the Workflow Builder with an Access Level of 100
(viewable from Help -> About Workflow Builder), if you lower the access level
you run the risk of overwriting SEED workflow and applications workflow
data,
which cannot be supported. If this should happen it will be necessary for you
to reinstall the original SEEDED workflow process, using the WFLOAD
concurrent
program in UPGRADE mode.
How do I trace errors in my Workflow processes?
If a customized workflow process errors you should check the error
stack (using the Workflow Monitor and/or wfstatus.sql script), if the
procedure
in error does NOT begin with WF_.. OR <app_short_name>_... then you need
to
debug your own pl/sql procedures.
If standards in the Workflow Guide for exception handling have not been
followed,
you can still tell whether the problem is with your code, because Oracle
Workflow
traps external exceptions and reports these as
Activity Status: ERROR
Activity Result: #EXCEPTION
This is what would show up in the workflow monitor or any status report or
form
inquiry for the failing activity.
Page 49 of 84
WORKFLOW
Page 50 of 84
WORKFLOW
Distributed applications
messaging--Applications can supply Generate and Receive event
message handlers for
Page 51 of 84
WORKFLOW
when business events occur. In this way, you can use the Event
Manager to implement
Page 52 of 84
WORKFLOW
Can custom Java code be integrated in with Oracle Workflow 2.6? <BR>YES.
class=""
Can Oracle Workflow 2.0.3 be upgraded to Oracle Workflow 2.6 in one step?
No. Oracle
Workflow 2.0.3 standalone customers must first upgrade to Oracle Workflow
2.5.1 or
Page 53 of 84
WORKFLOW
WORKFLOW
Event datatype. After they have done this, they could either rebuild their
complex business rules in Oracle Workflow, or minimally, they could wrap
their old
code in our Event Subscription Rule Function API.
WORKFLOW
Page 56 of 84
WORKFLOW
Background Engine
1 How do I defer a process to the background engine?
2 How is WF_STANDARD.Wait implemented? is there any cost involved?
3 Background process is stuck. Can I kill it?
4 Why can I not find WFRESGEN on my pc in the Submit Requests form?
5 What is the difference between WFLOAD and wfload?
How do I defer a process to the background engine?
When launching a process, you can do this immediately by lowering
the threshold level.
-- Set engine to defer everything to the bg-engine for this session
-- This provides faster user response time, at the expense of
-- delaying workflow progress until the background engine runs.
save_threshold := wf_engine.threshold;
wf_engine.threshold := -1;
-- Launch the process
wf_engine.CreateProcess(...);
wf_engine.SetAttr...(...);
wf_engine.StartProcess(...);
-- Reset the threshold
Page 57 of 84
WORKFLOW
wf_engine.threshold:=save_threshold;
exception
-- ensure threshold is reset
wf_engine.threshold:=save_threshold;
Page 58 of 84
WORKFLOW
process and starting another one. The process will simply be rolled
back and picked up again by the next background engine.
In order to run these programs through the Submit Requests form, you
will need to add them to the request group of the responsibility under
which you wish to run them. To do this, under System Administrator
responsibility, go to /Security/Responsibility/Requests, query the
group assigned to the desired responsibility, and add the programs.
Page 59 of 84
WORKFLOW
0
0
0
0
Y
Y
Y
Y
UPGRADE @fnd:install/data/wferror.wft
UPLOAD @po:install/data/poreq.wft
DOWNLOAD myprocess.wft POREQ
UPGRADE c:\orant\wf20\res\US\wfstd.wft
Builder
1 Cant save to the database: it says "activity ABC has no transition defined
for it"?
2 Q: I get error 1602: cant save to the database? but I can save to a flat file?
Q: I get error 1300: could not load? when loading from the database.
Page 60 of 84
WORKFLOW
WORKFLOW
Attribute name
Attribute type
value name
value type
The attribute name/type are already set. The user must input the value
name/type. The value type must EITHER be a constant so that the value will
be of the same type as the attribute type (so a constant value = 22 may
either be character 22 or numeric 22 depending on the activity attribute
type) OR it can be "item attribute", in which case the value is the name of an
item attribute which must
be of the same type as the attribute type.
Page 62 of 84
WORKFLOW
In the case of the ASSIGN activity, this is complicated because the activity
attribute is actually of type "attribute". This means it is already expecting an
item attribute name so you should input a CONSTANT type and the name of
the item attribute you want to reference.
A common mistake is to set the value type to "item attribute" because you
want to reference an item attribute. However because
attribute_type=attribute, it is already expecting an item attribute name.
Then, because of the OR rule noted above, you are limited to reference an
item attribute which is of type "attribute" which in turn is a substitution.
What this ends up meaning is "get the value you are expecting (in this case
the item attribute name) from the item attribute which refernces another
item attribute (because it is of type attribute)". This is a double reference
which is probably not required. So remember, whenever you use type
"[item] attribute", substitution occurs.
Commit Issues
1 Can I commit in PL/SQL packages? Why not?
2 What constitutes a single commit cycle in Workflow?
3 Can a workflow process be restarted from the point of failure?
4 How do we send the same item through the same work flow process more
than once?
5 How can I tell if a work item already exists?
6 I have a workflow with 2 activities. Are both activities executed in the same
SQL session?
7 Can I rollback beyond the activity I am in?
8 Are there any restrictions with starting a WF process from a DB-trigger?
Can I commit in PL/SQL packages? Why not?
You CANNOT commit inside a PL/SQL procedure which is called by the
workflow engine.
Page 63 of 84
WORKFLOW
If you issue a commit you are committing the workflow state as well as your
application state. If you do commit and your pl/sql function fails
subsequently the workflow engine will not be able to rollback
to a consistent state.
Example:
SP SP
SP
SP
SP
start ---> activity A -----> activity B ---> activity C ---> end
The workflow engine issues a savepoint (SP) before executing each activity.
It marks the activity as active and proceeds to execute the underlying pl/sql
If you commit in the middle of an activity and the activity subsequently fails,
the engine cannot rollback to it's savepoint. Therefore the work done in both
the engine and the application before
the commit cannot be rolled back.
More over, even if the activity does not fail, another process (such as a
background engine) gains visibility to the status information just committed
and may start processing prematurely leading to conflicts and unusual
errors. Similarly, you cannot ROLLBACK across pl/sql procedures. If you do,
REALLY strange things happen when an error occurs. Either the activity
status line wont exist (because its rolled back) so WF cant write the error, or
it may succeed in writing the error but then continues along the process
rather than stopping because other status info has been rolled back.
If you must undo something then ensure you rollback to a save point within
your own package and not to one in a previous function activity.
Page 64 of 84
WORKFLOW
Here are some facts about the Workflow Engine activity execution and
commits:
1. The Workflow engine does not perform any internal commits.
2. The caller of the Workflow API should always perform the actual
commit.
3. Exceptions that occur in activity functions are not propagated back to
the original Workflow API caller. If an activity function
4.
5.
6.
eligible for execution, the engine will continue with those activities.
Page 65 of 84
WORKFLOW
Our users have the ability to modify the Work Item which then needs to be
resubmitted through the workflow. How do we send the same item through
the same work flow process more than once?
When you submit a work item to Oracle Workflow you must identify it by an
item key. Item keys must be unique within an item type. If you need to
submit a document to workflow twice you must pass
unique item keys each time.
If you original process hasnt ended, then you can ask the user if they wish to
resubmit the document which will loop back to the start of the process. Many
workflows are actually built like this. For example, an approval process may
permit modification of the work item throughout the approval process. After
each approval step, a function checks if the work item has been modified
and if it has then it checks if the approver has authorization to approve this
new item and send it on a new path accordingly. Alternatively you can set up
a 1:many relationship between your application item (app_id) and the
workflow (wf_id) using a table. An active_flag can identify which of the
workflows is active for the parent item (only one wf-id would ever be active
for that app_id)
I have a workflow with 2 activities. Are both activities executed in the same
SQL session?
Only if both activities are part of a synchronous thread (eg flexbuilder).
However, even with synchronous flows, you cannot rely on all activities being
executed in the same session
because the user may modify them and break them into asynchronous flows:
1. A customer may introduce a notification activity which causes the
2. process flow to stop as it waits for a response. When it starts up again
it will be in different commit cycle.
3. A customer may change the cost of any activity which causes the
activity to be deferred so executed in a different commit cycle.
Page 66 of 84
WORKFLOW
Can I rollback beyond the activity I am in? For example, after several
activities, I need to rollback to the beginning?
Rollbacks are only permitted within a function activity to rollback a specific
unit of work using savepoints. We do not permit rollbacks across activities
because this would also rollback Workflow's processing data which includes
all audit trails. If you foresee the possibility that you may need to rollback to
an earlier function, then incorporate this into you business rules and model
as a branch back. Then you can incorporate Cancel-logic to rollback any
changes either in each activity under cancel-mode or all together in a single
API which is only ever called when rolling back. This
solution is acceptable to all flows and not just limited to synchronous flows as
a rollback would be (you cannot rollback to a savepoint set in another sql
session but you can branch back to
something executed in an earlier session).
Are there any restrictions with starting a WF process from a DB-trigger?
You are NOT allowed to issue savepoints or rollbacks in database triggers
and the WF engine does exactly that when (it issues a savepoint before
executing each function activity in the event that it needs to rollback on an
error). Therefore, to initiate a workflow process from a database trigger you
must ensure that the initial process threads are deferred to a background
engine.
This is best achieved by setting the engine threshold absurdly low before
initiating the process to ensure it is deferred.
begin
save_threshold := wf_engine.threshold;
wf_engine.threshold := -1;
wf_engine.createprocess('<ItemType>','<ItemKey>','<Process>');
wf_engine.startprocess('<ItemType>','<ItemKey>');
wf_engine.threshold := save_threshold;
exception
when others then
-- remember to reset the threshold
if
wf_engine.threshold < 0 then
wf_engine.threshold := save_threshold;
end if;
-- continue with normal error handling
wf_core.context('My_package_name', 'My_proc_name', to_char(nid));
raise;
end;
Page 67 of 84
WORKFLOW
A limitation is that you cannot use the selector function to determine your
start process and instead must always specify the start process. This is
because the selector function is executed like any other function activity in
which savepoints are set. If you must use a selector function, then call your
selector function API directly prior to CreateProcess.
Delete Issues
1 Get a lot of validation errors when trying to save because of reference to
obsolete items. How do I delete these?
2 When maintaining our workflow, what happens if we update a process or
replace a PL/SQL procedure?
3 Does workflow always execute according to the latest definition for an
itemtype?
4 If you use Workflow builder to design a workflow, and save it multiple times
into database, it seems to me that there would be multiple versions of
workflow definition in database. Are there any tools that could delete the
older versions and keep the newest version?
5 How do I completely wipe out workflow definitions from the database?
6 What does wf_purge.total actually do?
7 On aborting a process, how do I delete all the data so that I can restart the
process with the same itemkey?
Get a lot of validation errors when trying to save because of reference to
obsolete items. How do I delete these?
Workflow maintains data integrity in its datamodel, so you cannot delete any
objects that are referenced. Runtime status information from workflow
process instances also contains
references to design objects so even though the Builder lets you delete
something (because there are no other references to it in the builder), that
deletion will not take effect in the database if the "deleted" object is
referenced by runtime data.
Page 68 of 84
WORKFLOW
You can remove all runtime data for a particular item type with the
WF_PURGE API (see doc for more details).
WF_PURGE.TOTAL(itemtype)
Then you should be able to delete obsolete object in the builder. Note! In WF
2.0.2, you cannot delete item attributes that have been saved to the
database. Item attributes are always merged with existing attributes (this
allows customers to add their own attributes and keep them through
upgrades).
all workflow instances started before the change was saved will run the
old procedure.
all workflow instances started after the change was saved will run the
new procedure.
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. This is related to the concept of versioning in which
Oracle Workflow maintains different versions based on effective dates.
Page 69 of 84
WORKFLOW
If you use Workflow builder to design a workflow, and save it multiple times
into database, it seems to me that there would be multiple versions of
workflow definition in database. Are there any tools that could delete the
older versions and keep the newest version?
The builder doesn't delete old activity versions. You can manually delete
obsolete versions using wf_purge.activities (or wf_purge.total). This will only
delete activity versions older than the oldest item in the system to be sure it
won't be used again; if you think it's not purging enough, try deleting
obsolete items first. It is not necessary to ever purge old activities, but you
may want to do so periodically to prevent tables from growing too large.
Items
Notifications
Page 70 of 84
WORKFLOW
That match the itemtype and date filters passed in. Data without an enddate (indicating it is not yet complete) or that is still referenced by
something is not deleted by any of the wf_purge routines.
On aborting a process, how do I delete all the data so that I can restart the
process with the same itemkey?
You can delete all runtime data for a completed item using wf_purge.items
(or wf_purge.total). If you want to force removal of an item that is
incomplete or has gone astray regardless of status,
use the script in admin/sql/wfrmitms.sql. be aware that this will remove all
status information that the item ran in the first place.
Alternatively, instead of Aborting it in the first place you could rerun it using
wf_engine.HandleError with the RETRY option.
Install problems
1 Is Oracle Workflow 2.0.3 Cerified with Oracle Application Server 4.0?
2 On installing the server packages I get an error messagewf.ins(163):
unregistered product
3 On installing Workflow Embedded in Oracle Apps, the package wfsecicb.sql
produces compilation errors.
4 After installing I get Error 3402: no valid session exists for this user.
5 During an install on NT, I get an error RunTimeError 367 - Cant load or
register custom control 'wfnvg20.ocx'
6 NT Workflow Server install displays error Cannot find file wfrundemo.sql
7 Is iAS certified with Oracle Workflow 2.5?
Is Oracle Workflow 2.0.3 Cerified with Oracle Application Server 4.0?
Yes. Existing customers who have already installed Oracle Workflow
Cartridge 2.0.3 can upgrade to Oracle Application Server 4.0 immediately.
New customer must get patch 773373 before installing Oracle Workflow
Cartridge. This patch be downloaded from Metalink patch page.
Page 71 of 84
WORKFLOW
Page 72 of 84
WORKFLOW
Also, if you are installing on an NT machine, ensure you have logged on with
local administrator's privilege. You can check this by going to Start Menu>Programs->Administrative Tools->User Manager. If you still experience
problems, manually register the ocx file as follows:
Run an MS/DOS command shell
cd C:\WINNT\SYSTEM
for NT: regsvr32 C:\ORANT\WF20\wfnvg20.ocx
for W95: regsvr32 C:\ORAWIN95\WF20\wfnvg20.ocx
NT Workflow Server install displays error Cannot find file wfrundemo.sql
This only happens if you install from a temporary stage area which is not
what is recommended in the install guide. The error can be ignored since the
wfrundemo.sql script is not a required file for the install to complete
successfully (its only for the optional demo). The user should click on Ignore
Button in the Installer and continue with the Workflow Install. You can run the
script manually
after completion. We have fixed this on new versions of the CD.
Error Handling
1 What is WF_CORE.RAISE()?
2 Does WF_CORE.RAISE('UNEXPECTED_ERROR') return a null value from
PL/SQL?
3 How do I handle WF errors in the package procedures I want to call ?
4 How do you handle WF error using Oracle forms?
5 How do you handle WF error using a WEB front end?
Page 73 of 84
WORKFLOW
WORKFLOW
Print_My_Error;
end My_Procedure;
Raise the exception to a higher level. This example adds your procedure to
the call stack, and re-raises the exception. If you do this, you MUST trap the
exception and print it at a higher level. This technique is used by all the
WF_STANDARD package procedures. It is not only useful for debugging, but is
essential for determing who is responsible for the maintenace. This way you
can tell if the error occured in WF, a product groups package or a custom
piece of code.
procecure My_Procedure is
begin
...
Wf_Xxx.Yyy();
...
exception
when others then
Wf_Core.Context('My_Pkg', 'My_Procedure',
arg1, arg2, arg3, arg4, arg5||extra_info);
raise;
end My_Procedure;
How do you handle WF error using Oracle forms?
Any call to Workflow APIs from Forms must include an exception handler to
print any unexpected exceptions raised. The exception handler should look
something like the following example procedure. This will print a friendly
Message Dictionary error message, with the error stack available in the
"History" button for more information.
procedure Print_Forms_Error
is
errname varchar2(30);
errmsg varchar2(2000);
errstack varchar2(32000);
begin
-- Check for a wf error and print an error message if one is found.
wf_core.get_error(errname, errmsg, errstack);
-- If no wf error look for a native Oracle error
if ((errname is null) and (sqlcode != 0)) then
errname := to_char(sqlcode);
errmsg := sqlerrm;
end if;
if (errname is not null) then
fnd_message.set_string('ERROR_STACK', errstack);
Page 75 of 84
WORKFLOW
fnd_message.set_name('FND', 'WF_ERROR');
fnd_message.set_token('ERROR_MESSAGE', errmsg);
fnd_message.history;
raise form_trigger_failure;
else
-- Must be a Forms error, let it trickle up.
raise;
end if;
end;
How do you handle WF error when calling through a WEB front end?
Again you want to trap your error and call a routine to print it like the
following:
--- Print_Html_Error
-- Print an html page displaying a raised exception.
-procedure Print_Html_Error
is
begin
error_name
varchar2(30);
error_message varchar2(2000);
error_stack
varchar2(32000);
begin
htp.htmlOpen;
htp.headOpen;
htp.title(wf_core.translate('ERROR'));
htp.headClose;
begin
wfa_sec.Header(TRUE);
exception
when others then
htp.bodyOpen;
end;
htp.header(nsize=>1, cheader=>wf_core.translate('ERROR'));
wf_core.get_error(error_name, error_message, error_stack);
if (error_name is not null) then
htp.p(error_message);
else
htp.p(sqlerrm);
end if;
Page 76 of 84
WORKFLOW
htp.hr;
htp.p(wf_core.translate('WFENG_ERRNAME')||': '||error_name);
htp.br;
htp.p(wf_core.translate('WFENG_ERRSTACK')||': '||
replace(error_stack,wfa_html.chr_newline,'
'));
wfa_sec.Footer;
htp.htmlClose;
end Print_Html_Error;
--- Get_Text_Error
-- Return a text buffer with a formatted error string for printing.
-function Get_Text_Error
return varchar2
is
begin
buffer
varchar2(32000);
error_name
varchar2(30);
error_message varchar2(2000);
error_stack
varchar2(32000);
begin
buffer := htp.title(wf_core.translate('ERROR'));
wf_core.get_error(error_name, error_message, error_stack);
if (error_name is not null) then
buffer := buffer||' '||error_message);
else
buffer := buffer||' ' ||sqlerrm;
end if;
buffer := buffer||' '||
wf_core.translate('WFENG_ERRNAME')||': '||error_name;
buffer := buffer||' '||
wf_core.translate('WFENG_ERRSTACK')||': '||error_stack;
return(buffer);
end Get_Text_Error;
Is there any Debugging capability in Workflow?
There are currently no facilities in Workflow for the express purpose of
debugging PL/SQL activity functions. We do have plans to add an event
Page 77 of 84
WORKFLOW
logging facility, which is more to help trace process execution issues and act
as an error log.
To debug a workflow, make sure all function activities are working correctly
before linking them into the process. If the error remains in you process, use
all 5 arguments to wf_core.context to examine what is going on. You can
concatenate values together to display more. Finally, as with any pl/sql, you
can insert dbms_output.put_line to see more specifically what logic is being
executed
It is possible however to change the code that a function activity calls after a
work item starts. If a function activity fails you can apply a code fix and retry
the function form the workflow monitor.
The latest version of the code will then be run. It is the definition of the
process and not the code that the process calls that is fixed when a work
item starts.
Applications
1 How do I grant an application user access to the notification form?
2 How do I pass a form in a notification.
3 How do I set the application context/org?
4 How do I raise errors in my application? DO I have to add errors to the
workflow
resource table?
WORKFLOW
The Workflow Notifications function can be added to any menu in 10SC using
the System Administrator Responsibility. The name of the function is
Workflow Notifications, FND_FNDWFNOT. The function exists in AOL it just has
to be added to a menu.
WORKFLOW
WORKFLOW
RAISE; END
WORKFLOW
How does the mailer know what mail system I want to use?
The Workflow Mailer is linked with integration to a specific mail service, so
there is no setting to select this in the mail config file. The 2.5 mailer is
linked to support Sendmail and MAPI mail services
(WF 2.0.3 includes Interoffice). Simply run the desire mailer to generate
outgoing and process incoming email. Not that only one mailer is required.
Lotus notes is a MAPI compliant mail system. Use the MAPI (NT) version of
the Mailer when integrated to Lotus Notes (see notes in collateral).
Page 82 of 84
WORKFLOW
The mailer must run as the same unix user that owns the mailbox designated
for workflow mail.
For InterOffice, the ACCOUNT parameter must indicate the InterOffice user
account to be used by the mailer in the form
ACCOUNT=<user>/<password>@<database_alias>
You can verify the information in the ACCOUNT parameter by entering the
same values into the InterOffice connection dialogue. You should be able to
log into InterOffice as the specified user, view the inbox, and send messages
from the account.
IGNORE: the mail message is moved to the discard folder. Nothing else
happens.
ERROR: the mail message is moved to the discard folder. The notification in
WF_NOTIFICATIONS remains with STATUS=OPEN but mail status is updated,
MAIL_STATUS=ERROR. Additionally the activities status is updated to ERROR
which sets off the error process (if defined). It is through the error process
that the SYSADMIN (or recipient) can retry/skip the notification and continue
the
process UNAVAIL (or any other user defined tag): the mail message is moved
to the discard folder. The notification in WF_NOTIFICATIONS remains with
STATUS=OPEN but mail status is updated,
Page 83 of 84
WORKFLOW
Page 84 of 84