<-----Google Analytics Code Start----> <-----Google Analytics Code Close---->
Skip to content

Green

color

Default screen resolution  Wide screen resolution  Increase font size  Decrease font size  Default font size  Skip to content Default color Pink color Green color Green color

Related Items

Home arrow Technical Articles arrow Oracle Application Framework arrow OA Framework Extension of Application Module
This website has now moved to http://apps2fusion.com





OA Framework Extension of Application Module | Print |  E-mail
Written by Anil Passi   
Friday, 12 January 2007
Extending AM is similar to extending a View Object or an Entity Object. But some of the steps are slightly different. Hence I would like to dedicate an article on Extending AM.

What is an Application Module in OA Framework?
Think of AM as a broker between your Client Activity and database activity. It also manages the state of database transaction.

Is extension of AM recommended by Oracle?
Not really, simple because doing so isn't upgrade safe.
But sometimes you are left with no choice, and also it is better to extend that customize.

Which example will I undertake to extend an Application Module?
In this instance, lets take an example of an iRecruitment Functionality.
iRecruitment [IRC] is a web facing application from Oracle. Let's say, that we wish to capture a record in some custom table when a invalid Logon attempt occurs on iRecruitment Login page. The validation for User Logon occurs in a class named VisitorAMImpl.class
This class can be found in $JAVA_TOP/oracle/apps/per/irc/candidateSelfService/server
If you decompile this class using jad, you will notice the below code
    public String validateLogin(String s, String s1)
    {
        String s2 = null;
        OracleCallableStatement oraclecallablestatement = null;
        try
        {
            String s3 = "begin :1 := fnd_web_sec.validate_login( p_user                => :2 ,p_pwd                 => :3  ); commit; end; ";
            OADBTransactionImpl oadbtransactionimpl = (OADBTransactionImpl)getDBTransaction();
            oraclecallablestatement = (OracleCallableStatement)oadbtransactionimpl.createCallableStatement(s3, 1);

We need to add extra logic, such that, if fnd_web_sec.validate_login returns N, then we either insert record into another table or raise a business event.
Note:- The new logic can be appended to the method of the parent class [as it is, without modifying original code, by using super.method() convention].


So we need to extend and substitute VisitorAMImpl.class?
Well, we can't substitute AM Implementation class, so we will need to substitute VisitorAM itself.

In the extend AM, do we need to write code for each and every method of AM Implementation class being extended?
Not really. You need to write the code for just that method for which you wish to incorporate new/additional logic.


What are the steps in brief, for doing so?
Step 1  [Optional].
           Get a jad utility. This can be downloaded free. Just search on java decompiler jad. This will help you example the standard Oracle code.
Step 2. FTP all the files from $JAVA_TOP/oracle/apps/per/* to your PC and configure your PC for OA Framework development
Step 3. Create a new BC4J package in which the extension will reside.
Step 4. Note down the path and the properties of existing AM that we wish to extend
Step 5. Create a new AM, and specify the original AM being extended.
Step 6. Ensure that the properties of original AM are applicable for new AM too.
Step 7. Perform substitution. This will create a jpx file.
Step 8. Upload the jpx file into Database.
Step 9. Deploy the custom BC4J to $JAVA_TOP by FTP'ing all files.

In the Part-2[link here] of this article, I will provide steps with screenshots, to explain how Application Module can be extended in OA Framework.
 

Comments (12)add
...
written by Anil Passi , January 12, 2007
.
.
.
You are Spot on Ramya, root AM should not be substituted. Hence in this example, I did not use the Root AM.

Thanks for sharing your experience.

Regards,
Anil Passi
...
written by Ramya , January 12, 2007
Adding to your content of the blog, it is not possible to extend a Root level AM. Though Oracle lets you currently extend the AM, after the jpx is imported we would experience issues in the seeded pages. This runs into unpublished bug of Oracle and hence is not recommended.
...
written by Anil Passi , January 12, 2007
.
.
.
You are Spot on Ramya, root AM should not be substituted. Hence in this example, I did not use the Root AM.

Thanks for sharing your experience.

Regards,
Anil Passi
...
written by Ramya , January 12, 2007
Adding to your content of the blog, it is not possible to extend a Root level AM. Though Oracle lets you currently extend the AM, after the jpx is imported we would experience issues in the seeded pages. This runs into unpublished bug of Oracle and hence is not recommended.
...
written by Anil Passi , April 20, 2007
Hi Ashish

Interesting question.
Indeed a site level personalization is created. However the substituted AM will be extending your original AM itself. This substitution will occur at site level. Which means your custom AM[which is substituted] will replace all instances of original AM at runtime. Hence all the five pages will retain the same new AM


The bottomline is that this substitution does not impact ONE SINGLE PAGE.
This substitution impacts all the regions that use that AM

Thanks,
Anil
I need to Insert some records in a custom Table in iProc
written by Harjit , October 25, 2007
Hi Anil,
I need to Insert some records in a custom Table based on the Requisitions Selected for receipting ...when user Clicks Next/Express Receive on the Receiving screen in iProc .. should i just Create a new controller for this page.. or should i extend the AM .. as this process is a Worktrain consisting of three pages.

Harjit
...
written by Anil Passi , October 25, 2007
Hi Harjit

Usually extension to controller is not recommended, as it has no automated migration path to Fusion Apps tech-stack.

Also, from controller, it is not a good practice to call JDBC.
Having said that even Oracle calls JDBC from some of the FND Controller class files.

Action plan for you
AM Extension
Option 1 . See if the AM can be extended{If this isn't a root AM}, if so, find out the name of the AM method that standard CO is invoking

Option 2 . Extend the Controller


Another option to consider is the perform these inserts from PO Requisition Approval Workflow itself.


Thanks,
Anil Passi
...
written by Harjit , October 26, 2007
Anil,
Tanks a lot for all you suggestions.
Here are a few more details about the changes i am trying to make:

1) Page that has to be changed is "IcxPorRcvSrchPG.xml" i.e. receiving page
2) We have to add a checkbox in the ResultsTableRN so that user can select the Requisitions that he wants zero items and close the PO. (against the Receipt tolerance which is 10%)
3) The PageLayoutRN on this page is having "oracle.apps.icx.por.rcv.server.ReceiveItemsAM" as its Application module. Is this the Root AM ? should i try extending this ..

4) How should i call the databases Package from the AM class that i extend.

Cheers!!
HS
...
written by Anil Passi , October 26, 2007
Hi Harjit

Extend the controller for that page and in the extended controller use pageContext.getRootAm to find out the root AM for that page.
Dislpay that AM in the debug message
This is the safest way to know if the AM in question can be extended.

Thanks,
Anil Passi
Extend VO's that are made using Expert mode and have a dynamic Query creation Logic How to add Table Selection to a Existing Table and get its value
written by harji , October 27, 2007
Hi Anil,
Thanks,.. will check it that way.... I am back with some more questions smilies/wink.gif
-------------------------------------------------------------------------
Issue1: Can you please let me know how do i extend the VO that has been built in a Expert mode and the Query is also getting generated at run time i.e. is is not a statis query.

I need to add a column to such a VO ... how will i be able to do that? , will i have to put all the Query creation logic in my new VO and then make a complete query that will also be having my new Column.

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

Issue2: How can i create a check box in a already existing table region and take the Value of Selected/Not Selected from here .. and relate each selection to some other column of the Table (i.e. for each row selected (using my checkbox) i want to check the Value in OrderNumber Column for the same row)

What is a table Selection, how can i use it in this scenario.

Cheers !!
Harjit

Cheers!!
Harjit
...
written by Anil Passi , October 28, 2007
Extend the VO that has been built in a Expert mode
Usually the query of the VO would be static however the whereclause will be dynamic. In this case you can simply extend the View Object and add a new transient column to this VO.
See this URL for example
http://oracle.anilpassi.com/oa...ample.html


Issue2: How can i create a check box in a already existing table region and take the Value of Selected/Not Selected from here

Sounds like a multi-selection checkbox. However, you can create a simple checkbox using personalization. At the time of creating the new item of type checkbox[at site level], you must map this to the view object column that you have created by extending VO.
By doing so, when the page has been submitted, the values from the checkbox will be transferred to View Object. You can then loop through the rows in the view object[from CO or from AM], and check for those rows that have the newly created Attribute with a value of "Y". This will give you the records for which checkbox would have been checked by the user.

Thanks,
Anil Passi
Extend AM Standar from Oracle Application PO
written by Maggy , December 23, 2007
Hi Anil!

I'm trying extend the Standard Application Module (DocumentAM) from Oracle Purchasing, but I can't extend the validateLogin method. How can I know, if this AM is the Root AM in the page from the Application. And How can I extend this AM with the original functionality? Can I ?.

thank you. smilies/smiley.gif
You must be logged in to a comment. Please register if you do not have an account yet.

busy