Oracle Forms 6i - Traning
Oracle Forms 6i - Traning
Forms Basics
Topics Covered:
1.
2.
3.
4.
5.
Forms Basic
Module
Libraries
Triggers
Windows
Canvases
Data Blocks
Layout
Additional Code
Module
Module
Libraries
Triggers
Windows
Canvases
Data Blocks
Layout
Addl Code
Libraries
Module
Libraries
Triggers
Windows
Canvases
Data Blocks
Layout
Addl Code
Core
Application Specific
Libraries Core
APPCORE.pll
VERT.pll
GLOBE.pll
JA.pll
JE.pll
JL.pll
CUSTOM.pll
FNDSQF.pll
APPDAYPK.pll
APPFLDR.pll
Federal Financials
Human Resources Knowledge Provider
Global Human Resources
Encumbrances
International Public Sector
International Public Sector
Public Sector Applications
Public Sector Human Resources
Public Sector Applications
Public Sector Budgeting
Process Manufacturing
Application standards (for CUSTOM.pll)
Triggers
Module
Libraries
Triggers
Windows
Canvases
Data Blocks
Layout
Addl Code
Required
Optional
Triggers Required
PRE-FORM must be modified
Window
Module
Libraries
Triggers
Windows
Canvases
Data Blocks
Layout
Addl Code
Modal
Non-Modal
Modal Windows
Property class = WINDOW_DIALOG
Center window using APP_WINDOW.SET_WINDOW_POSITION
Explicitly write code to close the window
Code OK and Cancel buttons in advance
Use dialog blocks with property class = BLOCK_DIALOG
Disable key triggers
Non-Modal Windows
Property class = WINDOW
Each window should contain one logical entity
Do not attach scroll bars to windows attach to blocks
Size between 2x2 and 7.8w x 5.0h
Size only as large as necessary
No text on top and bottom lines
Blank left and right edge character cell except for boundary lines
Unique title for each window in a form
Dont use only singular/plural forms on window titles
Dont change the word order on window titles
Dont pad window titles with spaces
Canvases
Module
Libraries
Triggers
Windows
Canvases
Data Blocks
Layout
Addl Code
Basics
Ruler
Canvas Ruler
Ruler Settings
Data Blocks
Module
Libraries
Triggers
Windows
Canvases
Data Blocks
Layout
Addl Code
Basics
Items
Layout
Module
Libraries
Triggers
Windows
Canvases
Data Blocks
Layout
Addl Code
Region
Tabs
Items
Layout Regions
Coordination
1.Coordination
2.Check Box
Check Box
Scroll Bar
Current
Record
Indicator
Region Frame
Layout Tabs
Tab Pages
Layout Items
Items
Additional Code
Module
Libraries
Triggers
Windows
Canvases
Data Blocks
Layout
Additional Code
Overview
Create a directory tree to store your application files. The location of subdirectories will depend on the
configuration
AU_TOP
TOP Directories
forms/[LANGUAGE]
The FORMS directory contains .fmx files (and .fmb files) under language
subdirectories.
Ex. forms/US/ Template.fmb
Overview
Template.fmb
The TEMPLATE form includes many referenced blocks, canvases, LOV,
parameters, windows and other objects.
Objects such as program units and triggers are built directly into TEMPLATE.
Starting your form with TEMPLATE is the only way to ensure you get
the following:
Toolbar
Menu
Calendar
Required procedures
Required parameters
Reference to object
in APPSTAND
*Referenced Objects are
identified by the red
arrow in the lower left
corner
Template form
We are required to changes at 4 places.
1.
2.
3.
4.
Pre-Form Trigger.
When-New-Form-Instance Trigger
APP_CUSTOM library.
Delete Default DATA BLOCK ,CANVAS and WINDOW
Template form
Pre Form Trigger:
FND_STANDARD.FORM_INFO('$Revision: 115.12 $', 'Template Form', 'FND',
'$Date: 2003/12/19 11:02 $', '$Author: appldev $');
app_standard.event ('PRE-FORM');
app_window.set_window_position('BLOCKNAME', 'FIRST_WINDOW');
Template form
When New Form Instance:
Template form
APP_CUSTOM.Close_window Procedure
Template form
CUSTOM Library
CUSTOM Library
PACKAGE custom IS
function zoom_available
return BOOLEAN;
function style(event_name varchar2) return integer;
procedure event(event_name varchar2);
before constant integer := 1;
after constant integer := 2;
override constant integer := 3;
standard constant integer := 4;
END custom;
CUSTOM Library
Function Zoom Available: -This function allows you to specify if zooms exist for the current context. If
zooms are available for this block, then return TRUE; else return FALSE.
This routine is called on a per-block basis within every Applications
form from the WHEN-NEW-BLOCK-INSTANCE trigger. Therefore, any code
that will enable Zoom must test the current form and block from
which the call is being made.
By default this routine must return FALSE.
CUSTOM Library
function style (event_name varchar2) return integer;
This function allows you to determine the execution style for some productspecific events. You can choose to have your code execute before, after, or
in place of the code provided in Oracle Applications. See the Applications
Technical Reference manuals for a list of events that are available through
this interface.
Any event that returns a style other than custom.standard must have
corresponding code in custom.event which will be executed at the time
specified.
The following package variables should be used as return values:
1.
custom.before
2.
custom.after
3.
custom.override
4.
custom.standard
By default this routine must return custom.standard
CUSTOM Library
procedure event(event_name varchar2);
This procedure allows you to execute your code at specific events
including:
ZOOM
WHEN-NEW-FORM-INSTANCE
WHEN-NEW-BLOCK-INSTANCE
WHEN-NEW-RECORD-INSTANCE
WHEN-NEW-ITEM-INSTANCE
WHEN-VALIDATE-RECORD
Additionally, product-specific events will be passed via this interface (see the
Applications Technical Reference manuals for a list of events that are
available).
CUSTOM Library
return TRUE;
END IF;
return FALSE;
END
zoom_available;
Zoom Function
CUSTOM Library
PROCEDURE event(event_name VARCHAR2) IS
form_name
block_name
item_name
VARCHAR2(30) := name_in('system.current_form');
VARCHAR2(30) := name_in('system.cursor_block');
VARCHAR2(30) := name_in('system.current_item');
BEGIN
/*--- Added by to activate special25 with caption 'Cascading Header Billing'-Dec-2008--- */
IF (form_name = 'OKSAUDET' AND event_name IN ('WHEN-NEW-ITEM-INSTANCE','WHEN-NEW-BLOCKINSTANCE')) THEN
app_special2.instantiate('SPECIAL26','Cascading Header Billing');
IF (NAME_IN('SYSTEM.CURRENT_BLOCK') = 'OKS_HEADER' )THEN
app_special2.enable('SPECIAL26',PROPERTY_ON);
ELSE
app_special2.enable('SPECIAL26',PROPERTY_OFF);
END IF;
END IF;
IF (form_name = 'OKSAUDET' AND block_name ='OKS_HEADER' and event_name = 'SPECIAL26') THEN
fnd_function.execute(FUNCTION_NAME=>'ECBILSTS',
OPEN_FLAG =>'Y',
SESSION_FLAG =>'Y',
OTHER_PARAMS=>'ECBILSTS_CHR_ID="'||Name_In('OKS_HEADER.ID')||'"' );
END IF;
CUSTOM Library
CUSTOM Library
Form Registration
Form Registration
Form Registration
2. Register the Function:
Navigation: Go to Application Developer->Application Function
Form Registration
3. Select Form registered in step 1
Navigation: Go to Forms tab-Select form
Form Registration
Form Registration
5. Attach the function with the Menu
Navigation: Application Developer Application Menu
Execution
Execution:
FTP file to the specified CUSTOM TOP, by using FTO Tool.
For library file it is $EMCAU_TOP/resource/US
For forms it is $EMCAU_TOP/forms/US
After FTP, generate .plx or .fmx file in the specific CUSTOM TOP
Execution
Script used to Generate .plx
f60gen
module=/apps/crd01/applmgr/1154/emcau/1.0/resource/US/ETERMNO
T.pll userid=apps/d11cache
output_file=/apps/crd01/applmgr/1154/emcau/1.0/resource/US/ETERM
NOT.plx module_type=library batch=no compile_all=special
Execution
Script to Generate .fmb
f60gen
module=/apps/crd02/applmgr/1154/emcau/1.0/forms/US/ECBILSTS.fm
b userid=apps/caps
output_file=/apps/crd02/applmgr/1154/emcoks/1.0/forms/US/ECBILST
S.fmx module_type=form batch=no compile_all=special
Workflow Fundamentals
By Priyanka Pareek
Workflow Fundamentals
What is Oracle Workflow?
Workflow Fundamentals
Alternative Objects
i.
Alert
ii. Procedures
iii. Etc.
Workflow Fundamentals
If an alert or a Package procedure can work same as
Workflow, then
WHY WORKFLOW
Workflow Fundamentals
Workflow Fundamentals
Agenda
1. Introduction to Oracle Workflow Builder
2. Creating Workflow Manually/Quick Start Wizard
3. Naming Conventions
4. Tree Structure
5. Other Objects frequently used in WFs
6. Technical Overview
7. Monitoring WF
8. Creating Roles at Runtime
9. Queries
Workflow Fundamentals
Workflow Fundamentals
Lets Get Started
Workflow Can be Created using Two Methods
1. Manually
2. Using Quick Wizard
Workflow Fundamentals
File New
Workflow Fundamentals
Quick Start Wizard
Workflow Fundamentals
Creating WF from Quick Start Wizard (adds start/stop nodes)
1.
2.
3.
4.
5.
Workflow Fundamentals
There are two parts of Workflow Builder
Object Navigator
Process Diagram
Workflow Fundamentals
Naming conventions..
Internal Name
The internal name of an object is the name that will always be referred
to within the WF. This must be unique within the item type
Uppercase, No colons, leading / trailing spaces
Name used by APIs, PL/SQL to identify item type
Not Updatable
Display Name : Any meaningful name of the object within the WF,
Which is visible to the user, with size up to max 30
chars
Description
: Details of the current Object , with size up to max 80
Workflow Fundamentals
MENU
Workflow Fundamentals
MENU
Workflow Fundamentals
MENU
Workflow Fundamentals
Navigator Tree Structure
1.
2.
3.
4.
5.
6.
7.
8.
Item Type
Processes
Attributes
Notifications
Functions
Events
Messages
Lookup types
Workflow Fundamentals
Item Type:
Grouping of a set of workflow processes and its objects.
Processes
Diagram of all workflow activities and the relationship/flow between
each activity.
Attributes
Components that form the item type (i.e. all data that will be
needed throughout the process).
Stored in table WF_ITEM_ATTRIBUTES
Workflow Fundamentals
Notifications
Activities that send messages within the workflow process.
Functions
PL/SQL stored procedures that are either standard Oracle APIs or
custom procedures. These procedures will determine the steps taken by
the workflow based on user intervention.
Events
Business event that process receives, raises, or sends
Messages
Actual message text sent by the notification activities to the end users.
Workflow Fundamentals
Lookup Types
List of values provided within the messages to enable the user to
accept/reject a specified action. If some value has to be fetched at
runtime we use lookup set values attribute.
Some Standard Lookup Types:
Workflow Fundamentals
Several other Objects used frequently in WFs:
PERSISTANCE TYPE
ACCESS LEVEL
PROTECTION LEVEL
RUNNABLE
SELECTOR
ROLE
Workflow Fundamentals
Persistence Type
Oracle WF allows the developer to determine how long each WF should
remain in the database after they complete before they become eligible
for purging. The different persistence types are
Permanent
The standard API will never remove the WF
Temporary
Remain ineligible for purging until n complete days have passed
Synchronous
Do not persist the WF in the database, so no run-time data is
stored
Workflow Fundamentals
Access Level
Each user of Oracle Workflow operates the system at a certain access
level according to the range of levels listed Below.
09
Oracle Workflow
1019
Oracle Application Object Library
2099
Oracle Application Development
100999
Customer organization
1000
Public
Workflow Fundamentals
Workflow Fundamentals
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 objects
protection level controls whether other users can modify the object
based on their access levels.
To Set the Level for an Object
1.
Select the Access tab of the property page.
2.
In the Options region, use the Preserve Customizations and
Lock at this Access Level check boxes to define the access
levels that can modify this object. The options that you check in
this region directly affect the values that appear in the Levels
region.
Workflow Fundamentals
Protection Level
Workflow Fundamentals
Preserve
Lock at this
Customizations Access Level
Uncheck
Uncheck
Check
Uncheck
Uncheck
Check
Check
Check
Workflow Fundamentals
RUNNABLE
Check Runnable so that the process that this activity represents can be
initiated as a toplevel process and run independently. If your process
activity represents a sub process that should only be executed if it is
called from a higher level process, then uncheck Runnable
Workflow Fundamentals
SELECTOR
If your item type has or will have more than one runnable process
activity associated with it, define a PL/SQL function that determines
which process activity to run in a particular situation.
For example,
you may have two different requisition approval process activities
associated with the same item type. The process that Oracle Workflow
executes may vary depending on how and where the requisition
originates. Your selector function would determine which process would
be appropriate in any given situation.
Workflow Fundamentals
SELECTOR
Workflow Fundamentals
ROLE
To capture manual responses, we need to redirect the Notifications to a
user of a group of user.
Workflow Fundamentals
Validation Tool
Limitation:
It does not check for the code attached with activity, whether
code is valid and installed in the database.
Workflow Fundamentals
Some Imp points
The process must contain a start activity. In order to mark the activity
as a true start node, open the Node tab and select start from drop
down list for Start / End, instead of the normal value, which is used
as default.
Process must contain at least one End activity.
The start node cannot have any in transitions and End node cannot
have outbound transitions.
Workflow Fundamentals
The moment we are done with our
development, try to save it.
Save to PC file system (.wft)
Save to database once PL/SQL
procedures finished and errors
corrected
Workflow Fundamentals
Saving the Workflow.
In case there are some errors in the
Workflow, a text box immediately
pops up with all the warnings and
Errors.
Click + to expand message to see
real error
Some can be corrected at this point
Some require Technical side to finish work
Press Save button to save work anyway
Workflow Fundamentals
Difference between Warnings and Errors.
The Workflow can be saved and executed with some warnings on it,
But the Workflow cant neither be saved nor executed properly with a
single error on it.
Workflow Fundamentals
Launch Workflow Technical Overview
Using PL /SQL
WF_ENGINE.CREATEPROCESS &
WF_ENGINE.STARTPROCESS
WF_ENGINE.LAUNCHPROCESS
CREATEPROCESS
procedure CreateProcess(itemtype in varchar2,
itemkey in varchar2,
process in varchar2 Default ,
user_key in varchar2 Default ,
owner_role in varchar2 Default )
Workflow Fundamentals
ITEMTYPE The internal name for the item type.
ITEMKEY The string uniquely identifies the item within an item type.
Process A valid root process for this item type (or null to use the item's
selector function)
User Key Is optional field, which is displayed in WF monitor when the
users search for their processes.
Process Owner Is optional field, which should be set whenever you
know the user who is initiating the process.
Workflow Fundamentals
PROCEDURE TEST_FUNCTION
( itemtype IN
VARCHAR2,
itemkey IN
VARCHAR2,
actid
IN
NUMBER,
funcmode IN
VARCHAR2,
resultout IN OUT VARCHAR2
)
ITEMTYPE The internal name for the item type.
ITEMKEY 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.
RESULTOUT The result that is returned when the procedure completes.
Workflow Fundamentals
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.
procedure SetItemAttrText
(itemtype in varchar2,
itemkey in varchar2,
aname in varchar2,
avalue in varchar2);
Function GetItemAttrText
(itemtype in varchar2,
itemkey in varchar2,
aname in varchar2) return varchar2;
Workflow Fundamentals
Monitoring Workflow Errors and Debugging
From back end There are tables in back end where one can view the
status of a particular workflow. Those are as follows:
WF_ITEM_ATTRIBUTE_VALUES
WF_ITEM_ACTIVITY_STATUSES_V shows the status of running
workflow.
WF_ITEM_ACTIVITIES_HISTORY_V contains history information of a
workflow.
Workflow Fundamentals
From Front End:
We can view the in green transition, which means things are going
good.
Here process is stuck at Notify Approver marked in Red circle. But this
is a sub process. So if we now open this Subprocess, we can see that
right now we are waiting for the notifications respond.
In 2nd monitor diagram we also have some buttons; through these we
can check the details about WF.
We also have WF Admin resp. where we can manipulates and enter
certain values to precede the WF further.
Attached is the Navigation to see the workflow status
Workflow Fundamentals
WF Monitor:
Solution:
Create an Ad-Hoc Role and attach users to that adhoc role.
#Note: Keeping USER_NAME as Null will delete all the users from that
particular Ad-Hoc Role.
Workflow Fundamentals