343 total views, 1 views today

How to access AppModule method in Groovy expression ADF

In this section, we walk through about accessing an AppModule java method using Groovy expression

Pre-Requisite

JDeveloper 12.1.3

HR Schema

Country Entity & View Object (Click here for instruction to create Entity/ViewObject and its Java class )

Process

Double click on the AppModuleImpl.java class >> Write a method that return some integer. We are going to call this method from a View Object through Groovy Expression

050616_0548_Howtoaccess1 How  to access AppModule method in Groovy expression in ADF

Expose the method by double Click on the AppModuleImpl.xml >> Click Java >> Click the pencil icon >> Move the method to the selected list >> Click Ok

050616_0548_Howtoaccess2 How  to access AppModule method in Groovy expression in ADF

Now Open a View Object >> Click Attribute >> Click + icon to create new attribute

050616_0548_Howtoaccess3 How  to access AppModule method in Groovy expression in ADF

Input a name and change type to BigInteger as shown below

050616_0548_Howtoaccess4 How  to access AppModule method in Groovy expression in ADF

Select the created field >> Click Details >> Enable expression >> Click the expression icon as shown below

050616_0548_Howtoaccess5 How  to access AppModule method in Groovy expression in ADF

Input the groovy expression as shown below. Click Ok

This expression calls the method in the AppModuleImpl.java and assign it to the column ‘someNumber’

Syntax: ad.object.applicationModule.<MethodName>

050616_0548_Howtoaccess6 How  to access AppModule method in Groovy expression in ADF

Now Click the Source tab of the Country View Object >> Find the View Aattribute name ‘someNumber’ >> Select the element TransientExpression >> After select , a property window appear n the right hand side >> Change the TrustedMode to true in the property window

050616_0548_Howtoaccess7 How  to access AppModule method in Groovy expression in ADF

Click Save All

Test AppModule

Right click the AppModule.xml >> Click Run

Double click on the CountryEOView1 and check the method return value get populated in the column someNumber

050616_0548_Howtoaccess8 How  to access AppModule method in Groovy expression in ADF

govindan How  to access AppModule method in Groovy expression in ADF
Connect me

Govind

Thank you for visiting my personal blog. Myself Govindan, Software Developer by profession since 2006 and hence I started this blog early in 2016 and ever since I've been writing about technologies experienced and learnings of everyday life.

The views expressed on this blog are my personal views and do not necessarily reflect the views of my employer.

Please feeling free to reach me on any comments and feedbacks you have. Would be more than glad to listen and reply šŸ™‚
govindan How  to access AppModule method in Groovy expression in ADF
Connect me
By | 2016-12-29T00:31:37+00:00 May 6th, 2016|Categories: ADF|Tags: , , , |1 Comment
  • Ahmed Mamdouh

    Did you try it against version 12.2.1.1.0. As I got [No such property: applicationModule for class oracle.jbo.script.ExprValueSupplier] during compilation time. although expression in trusted mode.

Like us on Facebook.
Connect!