ADF Groovy call method in different application module

Hi All,
I have two different application modules(Say TestAM.xml and MyTestAM.xml). I have a method in second application module. I want to call that method from Entity object. Normally we use adf.object.applicationModule.getName()  if it is in the first application module
So how do I call a method in second application module from Entity object?
I am using JDev 11.1.1.5 and ADF BC.
Thanks,
Rajesh

Hi,
In my opinion the second way have a advantage, which its method could be invoke automatically using a invokeAction on pageDef, if necessary.
regards

Similar Messages

  • ADF call different application module using groovy

    Hi All,
    I have a requirement where I need to call method in application module. As we all know we can call it using adf.object.applicationModule.someMethod();
    But I have a requirement where I have two Application modules. I have method defined in second application module. So how to call this method defined in second application module.
    Please help me how to solve this issue. I am using JDev 11.1.1.5
    Thanks,
    Rajesh.

    Maybe this can help:
    https://blogs.oracle.com/jdevotnharvest/entry/remote_task_flow_vs_wsrp
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/43-remote-task-flow-169185.pdf
    Dario

  • Two different ways to execute a custom method in an Application Module

    I have a custom method exposed in an Application Module's Client Interface, and i know two different ways of executing it from my ADF Faces project (both works fine):
    1) Calls the method directly through the Data Control:
    MyModule service = (MyModule)JSFUtils.resolveExpression("#{data.MyModuleDataControl.dataProvider}");
    service.myMethod();
    2) Adding a Method Action in the PageDef's file:
    <methodAction id="myMethod" InstanceName="MyModuleDataControl.dataProvider"
    DataControl="MyModuleDataControl" MethodName="myMethod"
    RequiresUpdateModel="true" Action="999"
    IsViewObjectMethod="false"/>
    //Call the method from the binding container
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("myMethod");
    operationBinding.execute();
    Basically i want to know: what are the differences (pros & cons) of each approach ??

    Hi,
    In my opinion the second way have a advantage, which its method could be invoke automatically using a invokeAction on pageDef, if necessary.
    regards

  • Adding and Calling custom method to the application module or view object

    My project uses jheadstart 10.1.2.
    I want to run "oracle reports" from my uix page. I have coded a method which takes "VOParameter view object" as a parameter to run report.
    I have generated the input page (parameter page) which based on VOParameter view object, by using jheadstart for using jheadstart lov, date etc. advantages. But I dont know how can I add custom method on application module or view object implementation class and custom button on uix page to call from uix page.
    THANKS for your help

    Yes, method binding has been added to the page UI model.
    I have find some clue that When I darg and drop metod as a submitButton, the code "
    <SubmitButton text="runReport" model="${bindings.runReport}" id="runReport0" event="action" />"
    is added to the uix page code. I change this code like this;
    <button text="runReport" model="${bindings.runReport}" id="runReport0" event="action" onClick="submitForm('dataForm',1,{'event':'action','source':'runReport0'});return false"/>
    by adding onClick method and changed submitButton to button tag..
    Then button action is triggered. But I can not pass to the design part of the uix page. It gives me the message like that "The document is not a valid state" But it works. I dont know why?

  • Error While Calling a WebService from Application Module

    Hi all
    I have generated a Proxy from a web Service and i am trying to call the web service from an Application Module it is throwing me error
    JBO-29000: Unexpected exception caught: oracle.classloader.util.AnnotatedNoClassDefFoundError, msg= Missing class: webservices.types.com.siebel.xml.order_interface.Orders Dependent class: java.lang.reflect.Array Loader: jre.bootstrap Code-Source: unknown Configuration: jre bootstrap
    Missing class: webservices.types.com.siebel.xml.order_interface.Orders Dependent class: java.lang.reflect.Array Loader: jre.bootstrap Code-Source: unknown Configuration: jre bootstrap
    IMy web Service is correct, as i have executed the client and it is working fine, but when i try to class the web service from an external class or from an application module it is throwing me this error. So any light on this issue will be very helpful
    thanks

    Hi,
    did you registered the web service in the external service registration? The "DataAccessException:" is a hint to this issue.
    best regards,
    Rene

  • Making LOV off of an exposed method from second application module

    Hello,
    I am on JDev 11.1.1.4.0.
    My ADF project worked fine until the spec changed on how Lookups are going to be handled. Previuosly, all the lookup tables were in the same database as other tables. Change is that FND Lookups will be created in the "Oracle" and my ADF project should connect to "Oracle" to get appropriate lookup values to build LOVs while maintaining the main database connection intact.
    After some research, I now have 2 Application Modules, one my project and the other for Lookups to create LOVs. I went to Application Module configuration wizard to edit JDBC setting to point to "Oracle" database and created a read only view with the following SQL:
    SELECT LOOKUP_CODE, MEANING, DESCRIPTION FROM FND_LOOKUP_VALUES  
    WHERE LOOKUP_TYPE = 'MY_LOOKUP'
    AND ENABLED_FLAG = 'Y'
    AND LANGUAGE = 'US'I can run both AMs via "Oracle Business Component Browser" fine. However, I somehow have to set the lookup view object as data source to create LOV on the main updatable view object's attribute. If I set it the way I used to do treating the lookup view as a view object residing in the same AM I am getting "table or view does not exist" error. I guess it is something to do with the lookup view object, but I cannot seem to make any kind of progress on this.
    Any help would be greatly appreciated.
    Thank you
    Bones Jones
    Edited by: Bones Jones on May 19, 2011 10:40 AM

    Well, I think I have found a solution which I didn't have to write a single line of code. My mistake was to think that I have to write code to achieve this.
    Here is what I did:
    *I already have the main AM and View Objects created for my project.  The following steps are done on top of that to bring LOV to life
    1. Create a new, pretty empty AM, named LovAM.
    1.1 Right click on the newly created AM and select 'Configurations'
    1.2 Click JDBC Name value and click 'Edit'
    1.3 Select the second database source where Lookup is defined. If not listed, go back out and create a new Database connection and come back.
    2. Create a View Object with the following SQL:
    SELECT
        TO_NUMBER(LOOKUP_CODE) ID,
        MEANING NAME,
        DESCRIPTION
    FROM
        FND_LOOKUP_VALUES
    WHERE
        LOOKUP_TYPE = 'MY_LOOKUP' AND ENABLED_FLAG = 'Y' AND LANGUAGE = 'US'3. Notice you now have LovAMDataControl
    4. Create a jspx page and create a table with the main data control's binding (This was a part of the requirements).
    5. I create a read-only table with LovAMDataControl.LovLookUp1 binding (I think this creates/exposes correct binding in the pageDef).
    6. Now I drag-and-drop an attribute that I have been wanting to display LOV from the main binding.
    7. Selected single select listbox. You will be presented with 'Edit zlist Binding' screen.
    8. Base Data Source is the main data control binding.
    9. Select Dynamic List
    10. Select LovAM data control binding as List Data Source.
    11. (optional) Selected 'Name' as Display Attribute.
    11.1. (optional) I don't want to see the table created in step 5. On the jspx page, go to Source tab and delete the table from there. I think this keeps binding in pageDef while the UI component is deleted from the page.
    12. Save and Run
    Now, I didn't have to create Root Application Module in the code, but still achieved what I wanted.
    Thanks
    Bones Jones

  • Binding Methods Exposed From Application Module

    Hi All,
    I am using JDeveloper 11.0.2. I have a method exposed on the Application Module that when invoked, it creates a row. I exposed AppModADImpl as a client interface. After doing this, I am now able to see the method under data control section. On my page, I when to bindings and tried to create a bind to this method, I am able to see the method but the OPERATIONS list is disabled, because of this, I am unable to create the bind to the page.
    The method I'm trying to bind is below
    public Row createSystemTypes() {
    ViewObjectImpl vo = getAdSystemTypes1();
    Row row = vo.createRow();
    vo.insertRow(row);
    return row;
    Because the Operations List if disabled, when I click OK, I get the Error "No Actiond defined for the selected Item"
    I would appreciate help to know why Im unable to bind the method to the page.

    As the method has been added to the client interface of the application module, you have to select the application module in the dialog, not a view object. After selecting the application module (or the data control or root node) you should see all methods which are part of the client interface.
    Still, I wold do like Joonas outlined: use drag and drop and if you don't like the button you get this way on the page, switch to source mode and remove it. This will keep hte generated binding in the page def. Removing the button in design view will remove both, button and binding.
    Timo

  • Calling custom methods from Nested Application Modules

    We are having a problem with passing parameters to our nested App Modules.
    We have a custom method in our nested app module and when we drag that method from our data control palette in our page everything seems to work just fine. We are binding our NamedData values to #{requestScope.<field>} where the fields are inputText controls. When we run it will execute the function but the parameters are null.
    It seems to me that the Nested App Module can not evaluate the EL expression, or in other words when it gets evaluated it returns a null.
    Can anyone help with this?
    Thanks,
    Peter

    If you use an EL expression of some hard-coded value instead of #{requestScope.XXX} does that value correctly get passed to the function?
    In other words, are you 100% sure that EL expression is not evaluating to null ?
    If you drop an AM method as a parameter form on a page, you'll see that by default it's NamedData elements use EL expressions that reference attribute bindings that are bound to local page-def variables, rather than to #{requestScope.something}

  • Question on SRDemo ADF BC, why there is thrree application modules ?

    Hi All,
    Since the ADF Dev Guide for ADF BC has not come yet, I try to explore SRDemo ( ADF BC version ) to learn the best practice.
    Could any body please tell me, why there is three apps modules in SRDemo ?
    ( SRAdminService, SRPublicService, SRServiceBase )
    What is the criteria to detemine how many apps modules need to be created ?
    Thank you for your help,
    xtanto

    In later versions of the demo (which will come out along with the ADF Developer's Guide for Forms/4GL developers) I've simplified that back down to a single AM again.
    In the version that's on OTN now, the SRServiceBase was a parent component with some common code and a single common view object instance. The SRAdminService and the SRPublicService extended that base component to add things they needed.
    I was trying to follow the structure of the EJB/Toplink version of the demo where there were separate "Admin" and public "User" services, but it ended up not really making too much sense to me after I thought about it more given how they were being used in the demo. The additional complexity introduced wasn't balanced by the extra value for this small sample application that new users are also supposed to use to learn the basics from, along with the developer's guide.

  • Non-Serializable Parameter in client methods on an Application Module

    Hello,
    I want to create a client method which expects an java.io.InputStream as input parameter. Unfortunately all method parameters must be of a data type that implements the Serializable Interface. This might be good and reasonably for remote deployments as EJBs, but I want to use them local.
    Is there any solution for this problem?
    Thanks,
    Christian

    The use of our interface-based approach is for guaranteeing that your client layer is always separable from your middle-tier layer.
    If you are implementing a project where you are making the assumption that you won't be separating the two, then you can:
    (1) Make sure you're using Immediate sync mode, and
    (2) Have your client downcast to your *Impl class to call your method with non-serializable parameter.
    This isn't best practice in general, but given your constraints, it's the way to solve this problem.

  • Help with calling methods of different classes

    I have two classes. In class A I read a line of input from the console
    myVar= x.readLine();
    then I call a method of the same class (A)
    methodA(); i get NULLPOINTEREXCEPTION here
    in this method I wish to call another method but this time of class B so I create an instance of class B in class A
    private B instanceVar;
    and then proceed to create the method call to class B
    instanceVar.methodB(myVar); i get NULLPOINTEREXCEPTION here
    What am I doing wrong?

    What am I doing wrong?Not posting a short snippet of java code that demonstrates your problem.
    In class A I read a line of input from the console
    myVar= x.readLine();
    How is that related to the NPE's?
    then I call a method of the same class (A)
    methodA(); i get NULLPOINTEREXCEPTION hereSomething is probably wrong in methodA(). Impossible to say anything more with the information given.
    private B instanceVar;
    and then proceed to create the method call to class B
    instanceVar.methodB(myVar); i get NULLPOINTEREXCEPTION hereDid you ever assign instanceVar to an actual object with something like instanceVar = new B(); ?

  • Best practice for calling application module methods and plsql code

    In my application I am experiencing problems with connection pooling, I seem to be using a lot of connections in my application when only a few users are using the system. As part of our application we need to call database procedures for business logic.
    Our backing beans, call methods on the application module which in turn call a database procedure. For instance in the backing bean we have code like this to call the application module method.
    // Calling Module to generate new examination/test.
    CIGAppModuleImpl appMod = (CIGAppModuleImpl)Configuration.createRootApplicationModule("ky.gov.exam.model.CIGAppModule", "CIGAppModuleLocal");
    String testId = appMod.createTest( userId, examId, centerId).toString();
    AdfFacesContext.getCurrentInstance().getPageFlowScope().put("tid",testId);
    // Close the call
    System.out.println("Calling releaseRootApplicationModule remove");
    Configuration.releaseRootApplicationModule(appMod, true);
    System.out.println("Completed releaseRootApplicationModule remove");
    return returnResult;
    In the application module method we have the following code.
    System.out.println("CIGAppModuleImpl: Call the database and use the value from the iterator");
    CallableStatement cs = null;
    try{
    cs = getDBTransaction().createCallableStatement("begin ? := macilap.user_admin.new_test_init(?,?,?); end;", 0);
    cs.registerOutParameter(1, Types.NUMERIC);
    cs.setString(2, p_userId);
    cs.setString(3, p_examId);
    cs.setString(4, p_centerId);
    cs.executeUpdate();
    returnResult=cs.getInt(1);
    System.out.println("CIGAppModuleImpl.createTest: Return Result is " + returnResult);
    }catch (SQLException se){
    throw new JboException(se);
    finally {
    if (cs != null) {
    try {
    cs.close();
    catch (SQLException s) {
    throw new JboException(s);
    I have read in one of Steve Muench presentations (Oracle Fusion Applications Team' Best Practises) that calling the createRootApplicationModule method is a bad idea, and to call the method via the binding interface.
    I am assuming calling the createRootApplicationModule uses much more resources and database connections that calling the method through the binding interface such as
    BindingContainer bindings = getBindings();
    OperationBinding ob = bindings.getOperationBinding("customMethod");
    Object result = ob.execute()
    Is this the case? Also is using getDBTransaction().createCallableStatement the best way of calling database procedures. Would it be better to expose plsql packages as webservices and then call them from the applicationModule. Is this more efficient?
    Regards
    Orlando

    Thanks Shay, this is now working.
    I successfully got the binding to the application method in the pagedef.
    I used the following code in my backing bean.
    package view.backing;
    import oracle.binding.BindingContainer;
    import oracle.binding.OperationBinding;
    public class Testdatabase {
    private DCBindingContainer bindingContainer;
    public void setBindingContainer (DCBindingContainer bc) {this.bindingContainer = bc;}
    public DCBindingContainer getBindingContainer() {return bindingContainer;}
    public static String validateUser()
    // Calling Module to validate user and return user role details.
    System.out.println("Getting Binding Container from Home Backing Bean");
    BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
    System.out.println("Obtain binding");
    OperationBinding operationBinding = bindings.getOperationBinding("calldatabase");
    System.out.println("Set username parameter");
    operationBinding.getParamsMap().put("p_userId",userId);
    System.out.println("Set password parameter");
    operationBinding.getParamsMap().put("p_testId",examId);
    Object result = operationBinding.execute();
    System.out.println("Obtain result");
    String userRole = result.toString();
    System.out.println("Result is "+userRole);
    }

  • Java code common to the applications modules

    I need help to generalise some methods and include them in project.
    I have some Java methods and I need it to be able to include/calll these methods from different application modules.
    I need it accessible to all app modules.
    Is there any way to do it?

    what we do is create a root application module to be the parent of all our app modules. edit that root app module and add your other app modules as nested app modules under the "Application Modules" section. then in your child app module java code you can initialize your root application module by using the getRootApplicationModule() method:
    YourServiceImpl yourServ = (YourServiceImpl)getRootApplicationModule();
    then you have access to all your methods in the master app module. however, to make sure you're accessing your app module in the desired hierarchy, you have to base your jhs app def file on your root app module or use your app module under the desired hierarchy in any of your custom adf pages.
    hope this helps
    paul

  • How do I call an Application Module method from a EntityImpl class?

    Guys and Gals,
    Using Studio Edition Version 11.1.1.3.0.
    I've got a price update form, that when submitted, takes the part numbers and prices in the form and updates the corresponding Parts' price in the Parts table. Anytime this Parts view object's ReplacementPrice attribute is changed, an application module method needs to be called which updates a whole slew of related view objects. I know you can modify view objects via associations (How do I call an Application Module method from a ViewObjectImpl class? but that's not what I'm trying to do. These AppModuleImpl methods are the hub for all price updates, as many different operations may affect related pricing (base price lists, price buckets, etc) and hence, call the updatePartPricing(key) method.
    For some reason, the below code does not call / run / activate the application module's method. The AppModuleDataControl exists and recordPartHistory(key) is registered and public. At runtime, the am.<method> code is simply ignored, and as a weird side-effect, I cannot navigate out of my current page flow.
      public void setReplacementPrice(Number value)
        setAttributeInternal(REPLACEMENTPRICE, value);
        AppModuleImpl am = (AppModuleImpl)this.getDBTransaction().findApplicationModule("AppModuleDataControl");
        Key key = new Key(new Object[]
            { getPartNumber() });
        am.recordPartHistory(key);  // AppModuleImpl method which records pricing history
        am.updatePartPricing(key); // AppModuleImpl method which updates a whole slew of related pricing tables
      }Any ideas?

    Thanks Timo.
    Turns out the code provided was correct, but the AppModuleImpl method being called was not. A dependent ViewObject wasn't returning the row I was expecting. I then tried to perform some operations on that row, which in turn ... just stopped everything, but didn't give me an error.
    It was the lack of the error that threw me off. I had never messed with calling an AppModuleImpl method from the EntityImpl so I assumed that's what was messing up.
    You are correct. It is available from the ViewRow, but I thought it better to put it in the EntityImpl. This method will be called every time the replacement cost is modified. If I didn't put it in the EntityImpl, I'd have to remember to call it every time a replacement cost changed.

  • Invoking custom methods in application modules

    Hi,
    I am absolutely new to oracle ADF.I was recently working with application module.My question is how do I call a custom method(say myCustomMeth(String str) ) residing inside my application module from my Managed bean?I saw one example where the operation(i.e. the method) was directly dragged and dropped onto the jspx page from the data control.Is it the right way of doing it?I also saw one example where operation binding was used to invoke a method inside the application module although I didn't understand the code fully.I am really confused now.Please help.
    Thanks in advance.

    user11930797 wrote:
    My question is how do I call a custom method(say myCustomMeth(String str) ) residing inside my application module from my Managed bean?You write the custom Application Module method and you expose it to the AM's client interface. By doing so, the custom operation becomes available in the AM Data Control and can be bound to your jspx page.
    I saw one example where the operation(i.e. the method) was directly dragged and dropped onto the jspx page from the data control.Is it the right way of doing it?I also saw one example where operation binding was used to invoke a method inside the application module although I didn't understand the code fully.Both of the methods that you are mentioning above are used:
    1. You can drag the custom method from the data control in JDeveloper and drop it in your page as a command button or link to create a method binding declaratively this way. The method binding is executed via some command button or link and your custom AM method is called, or
    2. You can create the method binding yourself in the bindings tab of you jspx page, add the command button in your page and define an action listener for it in your backing bean. In your backing bean action listener you can write the necessary code to execute the method binding, which will call your custom AM method.
    Hope it is clear.
    Nick

Maybe you are looking for

  • Tips on reducing PDF file size?

    I can't seem to export PDFs smaller than 5 MB from Pages. The docs I'm exporting are only one or two pages in length with one small raster image and a few vectors. Exporting to PDF even at loweset "Good" quality produces a 5 MB file. Things I've trie

  • Range partitioning on virtual column based on binary xmltype column

    Alright, our DBA finally got around to upgrading to 11.2.0.2. Now I'm running into another issue: CREATE TABLE USER.DI_D2     ID NUMBER(19, 0) NOT NULL ,     XML SYS.XMLTYPE ,     PRIMARY KEY ( ID )   XMLTYPE XML STORE AS SECUREFILE BINARY XML   VIRT

  • SUS PO in Supplier Portal

    Hi all, I have created a ZSUS PO in MM and successfully sent it through to the SUS system, however, I can't see it in the supplier portal, is there a setting I need to do transfer docuements to the supplier portal? I am logged on as admin not the act

  • Open SharePoint 2013 site by iPad Safari

    Hi expert,   In same network, I can use Safari (iOS 8.1.2) to open SP 2013 by port, for example 192.168.1.100:1234. but how to open a site that the port is default port 80 ? For example, I create a BI site, the URL is portal.contoso.com/Sites/BI/page

  • Ejb-local-refs not showing up in webapp

    I have an EAR that has a WAR and an EJBJAR inside (nothing new here). I have my WAR reference several local ejbs from the EJBJAR. All of my local-ejb-ref entries in web.xml are not appearing in the console. Are there any restrictions on this? Thanks