Sunday, January 12, 2020

Oracle Framework Work Architecture

OAF Architecture -

Architecture of Oracle Application Frame Work is similar to the Struts Frame Work but some differences are there.
Fig. OAF Work Architecture
This Framework helps to create Self Service pages in Oracle EBS.


These pages are designed to be familiar to web-based users, and easy to deploy within a web browser (requiring no plugin or download, unlike Oracle Forms). As such, they are often expected to require no support or training for users, are more user friendly, and result in better performance over the internet and a faster transaction rate.
The OA Framework helps in building the presentation layer, adding the business logic and controlling the flow of the application.

Oracle Application Framework (OAF) is an architecture for creating web based front end pages and J2EE type of applications within the Oracle EBS ERP platform. In order to develop and maintain OAF functionality, Oracle's JDeveloper tool is used. OAF is based on J2EE technology called BC4J (Business Components for Java). As per the MVC architecture, in OAF, the XML Page forms the View, the JAVA based controller class forms the controller and the Application Module along with View Objects (VO) and Schema Objects (EO) forms the Model.

Every application has a package some location on the Application Server where all the code is held, there are basically three types of location within a given package path:
  1. Server (The BC4J Components, R12 uses ADF)
  2. Webui (Web user interface components)
  3. Schema (Entity objects)
  4. Server files

Model(BC4J) 
  • EO (Entity Objects)
  • VO (View Objects)
  • AM (Application Module)
View (User Interface) 
  •      Page Design (User interface XML- UIX)
Controller 
  •      Java Code Classes(CO) - User Actions
1. VO (View Objects)  
a. VO is used for displaying the records.
b. Two types of VO :
   i.  SQL based
   ii. EO based
   
2. EO (Entity Objects)
       a. EO is used while updating, inserting or deleting the records. (Depending on VO)
       b. Contains database attributes nothing but the table columns
3. AM (Application Module)
       a. AM will be track all the transactions between VO and pages(user activities).
       b. Contains only VO, can not attach EO directly to AM.
       c. Every page must have root AM.
4. CO (Controller)
      a. Responds to user actions
      b. Model objects like EO and VO can't be accessed directly from the Controller class, except AM.
      c. Contains methods such as :
   i.   ProcessRequest : Executes when page load at first time(Initially).
   ii.  ProcessFormRequest : Executes when user doing action on page(Clicking on Button, changing LOV etc).
   iii. ProcessFormData : Transfer information from page fields to the cache memory(Executes in backend - not used by developer).

5.    Page and Region (PG and RN)

It represents the View layer of the MVC architecture, it is the creation of the page that is rendered on front end, every component on that page like input text box, Lov’s, submit buttons and all other components are part of a bean that is defined in the system, each of these page is stored in the file system tables in the database, whenever any page is called the components are called from the database and rendered.

Onion Architecture of OA Framework :
Fig. Onion Architecture of OAF
Onion Architecture of OA Framework :
OA Framework can be extracted into a series of concentric layers, like an onion.
Each layer communicates with it top and bottom layers.

Key Features of MVC Architecture :

  1. Integrated development environment
  2. Durable personalization and extensions
  3. Consistent and compelling user interface
  4. User interface interactivity
  5. Object oriented reuse
  6. Oracle portal interoperability
  7. Built-in security
  8. Deployment environment
Comparison of D2K, OAF and ADF :

D2k OAF ADF
Desk Top Application It is Frame with MVC Architecture It is a Frame work with MVC Architecture
It is a Client and Server Architecture It is a 3-Tier Architecture It is a N-Tier Architecture
From Builder used to develop the applications JDeveloper is used to develop the applications JDeveloper is used to develop the applications
PL/SQL JAVA JAVA
Drag and Drop features No Drag and Drop features Drag and Drop features
Client and  Server Application Web Application Enterprise Application

Personalization :
There are certain changes, which are in fact small changes on a page that can be done without any code changes is a feature that oracle provides to its users, this is called personalization. Personalization can be done at user level, responsibility level, org level and site level.

To enable the personalization link on every page use the Profile option, "Personalize Self-Service Defn".

After setting this profile, on every page the Personalize link will appear. One can personalize certain attributes like rendering items, making fields read only creating items at required level (User/Responsibility/Site) etc.

After personalization the personalized page needs to be imported to the file system as mentioned earlier each of the pages resides in the file system and stored in tables within the database, for doing this there is a standard xml importer script.

Customization :
In case some new customized codes needs to be created and added to the custom level which will extend to existing codes.(We will discuss this later)

Debugging :
Debugging and code analysis is a very major aspect of tracking and finding the required changes in an OAF code. Set the profile “FND: Diagnostics” this will create a Diagnostics link on the top as well as a “About this page” link at every page bottom. These are very important utility for tracking the components on a page, like AM’s /VO’s and CO’s on a page and helps in finding the various view objects that are attached on a page and their respective queries. This is also helpful in tracking the components that needs to be modified or extended during development.


Monday, January 6, 2020

Basic Installation and setup of JDeveloper

Basic Installation Steps 
  1. Download Java Jdk 1.8. Download jdk from below link https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
  2.  Download JDeveloper according to your EBS instance version. With me available Oracle patch is p8431482_R12_GENERIC.zip which supports oracle 10g. Download Jdeveloper using link  https://www.oracle.com/technologies/developer-tools/jdeveloper/jdeveloper.html
  3. Unzip the patch p8431482_R12_GENERIC.zip i.e. in D:\
  4. Add the JDev path in your system where your JDeveloper is available, as shown in below screen capture.
Fig. Environment Variable

      5. Create new variable in User Variables(In User Variable section > Click on New and add below details).
      6. Enter the details as shown in below screen capture:
    • Variable Name : JDEV_USER_HOME
    • Variable Value : <Insert your JdevHome/JDev path>
Fig. User Environment variable Value

    7. Download <instance_name>.dbc file from $INST_TOP/Secure OR $INSTANCE_TOP/Secure
                    .dbc file consisting of Connection details which is same as tnsnames.ora. 
    8. Place <instance_name>.dbc file into  D:\p8431482_R12_GENERIC\jdevhome\jdev\dbc_files\secure.

May error occurs while opening the JDeveloper at first time:
Error : Ø  SQL Developer can’t start because MSVCR71.dll is missing
Steps for Solution :
1. Go to Environment Variable(right click on My Computer or This PC > Properties > Advanced system Settings > Environment Variable):

Fig. Environment Variable
2. Go to System variables and click on "path" > Edit > 
Fig. System Variable Edit

3. It will open the window as shown in below screen shot. Click on New > enter the path which is same as JDEV_USER_HOME(entered at the time of installation/setup of JDeveloper).
Fig. Add new in path - System Variable
4. Copy the MSVCR71.dll file from D:\p8431482_R12_GENERIC\jdevhome\jdk1.8\bin path to D:\p8431482_R12_GENERIC\jdevhome\jdev\bin and restart your jDeveloper.

Using above setup we can start our JDeveloper. Thanks.!

Thursday, January 2, 2020

Background of Oracle Application Framework

Basic Information and little bit background of OAF-

Oracle Application Framework (OA Framework) is the Oracle Applications development and deployment platform for HTML-based business applications.
Fig. Simple Web Application Architecture

Application Tier Contains a Web Server, which maintains the components such as Servlet, JSP:

Component is nothing but piece of code, which implements well defined interface.
A Single Component is not an Application. An Application consists more than one number of components working together.
Component handles complete task, such as Business Logic, Database Transactions Logic and Presentation Logic.

Few are the disadvantages were observed in this architecture :
  1. Only One Application developer has to develop the complete component
  2. Application developer has to concentrate on Business Logic, Database Transactions Logic as well  as Presentation Logic.
  3. Application Developer Must have the Multiple Skills
  4. Development Time is more
  5. Lot of confusion with Business Logic, Database Transactions Logic and Presentation Logic since they are being developed as single component.
To overcome the above disadvantages MVC1 Architecture was introduced :
Fig. MVC1 Architecture
  • Model (M): Model Represents data object. Model is what is being manipulated and presented to the user.
  • View (V):    Serves as Screen representation of Model. It is the object that presents the current state of the data objects to user.
  • Controller (C):  Defines the way user interface reacts to the user’s input. The Controller component is the object that manipulates the model or data object.

In MVC1 Architecture
  • Servlet/JSP acts as View as well as Controller.
  • Java Bean acts as Model Component.

Below are the disadvantages of MVC1 architecture:

  1. Only One Application developer has to develop the component with Business Logic, as well as Presentation Logic.
  2. Application developer has to concentrate on Business Logic as well as Presentation Logic.
  3. Application Developer Must have the Multiple Skills.
  4. Resources such as Java developers and Web developers can not be used effectively.
  5. Development Time is more.
To overcome the above disadvantages MVC2 Architecture has been introduced:
Fig. MVC2 Architecture
MVC is divided as below :
  • Model :  Java Bean acts as Model. It is Java Bean called as Form Bean. It will receive the client data through the Controller and performs the data validations or data base transactions such DML operations. After performing database transactions it provides the data for the view.
  • View : JSP acts as View. It populates the data from the Form Bean ( Model ) and Present to the user.
  • Controller : Here Servlet acts as Controller. It is java Servlet called as Action Servlet. It receives request from the web client and stores data into the Java Bean called as Form Bean (Model) and receives response (success / fail) from the Form Bean. Based on the response from Form Bean, Action Servlet decides, which page (view) to be presented to the client.


Friday, December 27, 2019

Concurrent Program Scheduler Tool - Appworx (Part II)

1. Procedure to Create User -

Step 1 - From the Users selector window, click New as shown in Figure A.


Figure A. User Selector






Step 2 - AppWorx opens the Users window shown in Figure B. Complete the required                            details using Table A and click on Apply button, your user is Created..!!.

Table AUser General tab field description

Field
Description

User Name

The name the user will enter on the AppWorx Login Window. Entry can be 30 characters long.

First Name Last Name/Description

The user’s first and last name or description.

Active

Designates the user as active or inactivate.

Password

The password for the user. Entry can be 30 characters long.

Expire interval

The number of days until the user's password will expire (forcing them to specify a new one).

Last modified

This non-edit field displays the date and time the password was last changed


Figure B. User Creation Window
Step 2 - The AppWorx user options control user access to specific features. Select from the list and press up button from AppWorx of user group and click on OK.
Figure C. Assign User group to User Window






















Friday, August 2, 2019

Concurrent Programs Scheduler Tool - Appworx (Part I)

1. Introduction to AppWorx 
     
   AppWorx provides a complete background-processing management system. With AppWorx, you can do all the traditional batch management tasks, as well as submit jobs and view output. However, instead of writing scripts to perform tasks, you create AppWorx modules that run programs. You combine modules to create chains. You create a schedule for each chain (or for each module if you wish) using a full complement of scheduling tools including custom calendars and execution conditions.
As with all modular systems, you create individual objects once, then use them in different combinations to accomplish a variety of tasks. In the context of batch management, this can save you hours of time compared to writing, debugging, and maintaining scripts. A diagram of the AppWorx modular approach to operations is shown in Figure A.

A Different Way of Thinking -

In a traditional operations environment, scripts drive operations. Scripts incorporate the information required to run one or more programs on a set schedule, direct output, and handle exceptions. The problem with scripts is the required time maintaining them when the system changes. For example, if a printer definition changes, you must change it in every script. AppWorx takes the individual components of a script such as programs, schedules, printers, and variables, and lets you define them as discrete objects. You can then combine the objects in an unlimited number of combinations to handle your operations. The advantage is being able to change an object in one place, and have the changes roll over to every use of the object.

Figure A. AppWorx uses a modular approach to replace the tedious tasks of writing and maintaining scripts.
















---------------------------------------------------------------------------------------------

2. Objects in AppWorx

1. User 

The Users are created for Controlling access to AppWorx. You can assign names, access permissions, user options, and roles to AppWorx users.

2. User Authority

User authority is control user access to Application Manager window and can give Users and privileges for objects.

3. User Group

User group is control access to all areas of Application Manager. In a traditional system, you create a groups of User, Output, Devices and Applications. User groups can contain any combination of objects, and objects can be assigned to any User group.

4. Agent

Agents are instances of application manager. An agent is installed on each machine where new tasks are executed. An agent can be Local agent or Remote agent.

5. Module (Job)

Module is the basic building block in AppWorx. For each program which you want to run (for example: FTP, application, database load), you must create a module. A module contains all the information required to execute a program. Modules are run both individually and as components of AppWorx chains. Furthermore, a module can be a component of as many chains as you wish. If you change a module definition, the change is applied to every chain that includes it.

6. Chains (Process Flows)

Process flows are the combination of one or more jobs(Concurrent Programs from EBS), which are scheduled as per requirement. For running the chain, specific eligibility of its component and condition must meet.

7. Chain Components

Chain components are modules and chains assigned to the chain. When you add a component to a chain, AppWorx creates a pointer from the chain to the module or chain instead of adding a copy of it. This is in keeping with the AppWorx object-oriented approach. If you edit a module or chain definition, the update is effective immediately for all chains that include it.

8. Notification

Application Manager includes the notification which alerts you to unusual task runs. If you want to be notified when task does not completed or not completed task in expected time. You can receive notification by email.

9. Substitution Variables

It stores the values that can be used in Jobs and Process Flows. You can add the SQL statement to pull the value from database, variable name such as #XXOrganization_id, in prompts and execution conditions assigned to Jobs.

Wednesday, July 31, 2019

Basic SQL Queries used in Oracle Apps


Below query will fetch the data for Concurrent Program attached to which responsibility -

  SELECT DISTINCT fcpt.user_concurrent_program_name,
                             frt.responsibility_name,
                             frg.request_group_name,
                             frgu.request_unit_type,
                             frgu.request_unit_id
    FROM apps.fnd_Responsibility fr,
             apps.fnd_responsibility_tl frt,
             apps.fnd_request_groups frg,
             apps.fnd_request_group_units frgu,
             apps.fnd_concurrent_programs_tl fcpt
   WHERE     frt.responsibility_id = fr.responsibility_id
         AND frg.request_group_id = fr.request_group_id
         AND frgu.request_group_id = frg.request_group_id
         AND fcpt.concurrent_program_id = frgu.request_unit_id
         AND frt.language = USERENV ('LANG')
         AND fcpt.language = USERENV ('LANG')
         AND fcpt.user_concurrent_program_name LIKE  '%<Concurrent Program Name>%'
ORDER BY 2;


Below query will fetch the data from which responsibility request was submitted:-

SELECT   c.request_id, 
                 frv.responsibility_name
  FROM    fnd_responsibility_vl frv, 
                 fnd_concurrent_requests fcr
 WHERE  fcr.request_id = <Request ID>
       AND  fcr.responsibility_application_id = frv.application_id
       AND  fcr.responsibility_id = frv.responsibility_id;


Below query will fetch the data which function is attached to which responsibilities:-

SELECT  fr.responsibility_name, 
                fm.menu_name, 
                ff.user_function_name
  FROM   apps.fnd_responsibility_vl fr,
                apps.fnd_menus fm,
                apps.fnd_compiled_menu_functions fmf,
                apps.fnd_Form_functions_vl ff
 WHERE  fr.menu_id = fm.menu_id
       AND  ff.function_id = fmf.function_id
       AND  fmf.menu_id = fm.menu_id
       AND  ff.user_function_name LIKE '%<Function Name>%';


Below query will fetch the data of Request group and it's concurrent programs:-

SELECT cpt.user_concurrent_program_name "Concurrent Program Name",
               DECODE (rgu.request_unit_type,
                                     'P', 'Program',
                                     'S', 'Set',
                               rgu.request_unit_type)          "Unit Type",
               cp.concurrent_program_name "Concurrent Program Short Name",
               rg.application_id "Application ID",
               rg.request_group_name "Request Group Name",
               fat.application_name "Application Name",
               fa.application_short_name "Application Short Name",
               fa.basepath "Basepath"
  FROM  apps.fnd_request_groups rg,
               apps.fnd_request_group_units rgu,
               apps.fnd_concurrent_programs cp,
               apps.fnd_concurrent_programs_tl cpt,
               apps.fnd_application fa,
               apps.fnd_application_tl fat
 WHERE rg.request_group_id = rgu.request_group_id
       AND rgu.request_unit_id = cp.concurrent_program_id
       AND cp.concurrent_program_id = cpt.concurrent_program_id
       AND rg.application_id = fat.application_id
       AND fa.application_id = fat.application_id
       AND cpt.language = USERENV ('LANG')
       AND fat.language = USERENV ('LANG')
       AND rg.request_group_name LIKE '%<Request Group Name>%';


Below Query for Extracting the data for Alert in Oracle Apps:-

SELECT  fav.application_short_name,
                aa.alert_name,
                aa.description alert_description,
                aa.start_date_active,
                aa.enabled_flag,
                aa.sql_statement_text,
                aav.description alert_action_type,
                aav.to_recipients,
                aav.cc_recipients,
                aav.bcc_recipients
  FROM   apps.alr_actions_v aav, 
               apps.alr_alerts aa, 
               apps.fnd_application_vl fav
 WHERE aav.alert_id = aa.alert_id
       AND aav.application_id = aa.application_id
       AND fav.application_id  = aa.application_id
       AND (fav.application_short_name LIKE '%<Application Short Name>%' 
               OR  aa.alert_name LIKE '%<Alert Name>%');


Below Query will Find all the fields in a given Descriptive Flex Field(DFF):-

  SELECT   ffv.descriptive_flexfield_name DFF_Name,
                    ffv.application_table_name Table_Name,
                    ffv.title Title,
                    ap.application_name Application,
                    att.column_seq_num SegmentNumber,
                    att.form_left_prompt SegmentName,
                    att.application_column_name,
                    fvs.flex_value_set_name ValueSet,
                    att.required_flag
    FROM     apps.fnd_descriptive_flexs_vl ffv,
                    apps.fnd_descr_flex_contexts_vl ffc,
                    apps.fnd_descr_flex_col_usage_vl att,
                    apps.fnd_flex_value_sets fvs,
                    apps.fnd_application_vl ap
   WHERE   ffv.descriptive_flexfield_name = att.descriptive_flexfield_name
         AND   ap.application_id = ffv.application_id
         AND   ffv.descriptive_flexfield_name = ffc.descriptive_flexfield_name
         AND   ffv.application_id = ffc.application_id
         AND   ffc.descriptive_flex_context_code =
                    att.descriptive_flex_context_code
         AND  fvs.flex_value_set_id = att.flex_value_set_id
         AND  ffv.title IN ('<Descriptive FF Title>')
ORDER BY ffv.title;


Below Query will find User and it's attached responsibilities:-

SELECT   fu.user_name,
                 fr.responsibility_name,
                 furg.start_date,
                 furg.end_date
  FROM   apps.fnd_user_resp_groups_direct furg,
                apps.fnd_user fu,
                apps.fnd_responsibility_vl fr
 WHERE fu.user_name = UPPER ('<User Name>')
       AND furg.user_id = fu.user_id
       AND furg.responsibility_id = fr.responsibility_id;


Below Query will find Form Personalization and it's assigned responsibilities:-

SELECT rmcr.description Personalization,
              (CASE
                    WHEN fmcs.level_value =
                          (SELECT responsibility_id
                              FROM apps.fnd_responsibility_vl
                           WHERE responsibility_id = fmcs.level_value)
                    THEN
                          (SELECT responsibility_name
                              FROM apps.fnd_responsibility_vl
                           WHERE responsibility_id = fmcs.level_value)
              END)
               "Responsibility Name"
  FROM    apps.fnd_form_custom_scopes fmcs,
                apps.fnd_responsibility_vl frv,
                apps.fnd_form_custom_rules rmcr
 WHERE  level_id = 30
       AND frv.responsibility_id = fmcs.level_value
       AND rmcr.id = fmcs.rule_id

       AND rmcr.description LIKE '%<Personalization Name>%';


Below Query will find Concurrent Program's parameter:-

SELECT fcpl.user_concurrent_program_name,
               fcp.concurrent_program_name,
               fcp.concurrent_program_id,
               fav.application_short_name,
               fav.application_name,
               fav.application_id,
               fdfcuv.end_user_column_name,
               fdfcuv.form_left_prompt prompt,
               fdfcuv.enabled_flag,
               fdfcuv.required_flag,
               fdfcuv.display_flag
  FROM  apps.fnd_concurrent_programs fcp,
               apps.fnd_concurrent_programs_tl fcpl,
               apps.fnd_descr_flex_col_usage_vl fdfcuv,
               apps.fnd_application_vl fav
 WHERE fcp.concurrent_program_id = fcpl.concurrent_program_id
       AND fcpl.user_concurrent_program_name = '<User Concurrent Program Name>'
       AND fav.application_id = fcp.application_id
       AND fcpl.language = 'US'
       AND fdfcuv.descriptive_flexfield_name = '$SRS$.' || fcp.concurrent_program_name;


Below Query will find Responsibility level Profile Options:-

  SELECT NVL (g.responsibility_name, c.level_value) "Responsibility",
               b.user_profile_option_name "Profile",
               c.profile_option_value "Profile Value",
               (SELECT application_name
                  FROM apps.fnd_application_vl
                WHERE application_id = g.application_id)
                "Application"
    FROM  apps.fnd_profile_options a,
                 apps.fnd_profile_options_vl b,
                 apps.fnd_profile_option_values c,
                 apps.fnd_user d,
                 apps.fnd_user e,
                 apps.fnd_responsibility_vl g,
                 apps.fnd_application h
   WHERE 1 = 1
         AND a.profile_option_name = b.profile_option_name
         AND a.profile_option_id = c.profile_option_id
         AND a.application_id = c.application_id
         AND c.last_updated_by = d.user_id(+)
         AND c.level_value = e.user_id(+)
         AND c.level_value = g.responsibility_id(+)
         AND c.level_value = h.application_id(+)
         AND c.level_id = 10003
         AND g.responsibility_name LIKE '%<Responsibility Name>%'
ORDER BY 1;