Groovy Expression at instance level.

Hi,
Iam using JDev 11.1.1.5.0.
I've an ViewObject and then applied ViewCriteria. Now I want to apply groovy expression sum(column1). Is it possible? Please suggest, if you have any clue.
Thanks,
Samba.

Hi,
Going through this would give you the basics of groovy expressions : http://www.oracle.com/technetwork/developer-tools/jdev/introduction-to-groovy-128837.pdf
-Arun

Similar Messages

  • ADF Groovy Expression with bind variable and ResourceBundle

    Now I have ViewObject which have WHERE clause with bind variable.
    This bind variable is for language. Within bind variable I can change Value Type to Expression and into Value: I put +(ResourceBundle.getBundle("model.ModelBundle")).getString("language")+.
    Now if I run Oracle Business Component Browser (on AppModule) this works. In my ModelBundle.properties there is language=1 name-value pair. And with different locale I have different language number.
    Now if I put that ViewObject on one JSF, this bind variable expression does not work any more. Error:
    *oracle.jbo.JboException: JBO-29000: Unexpected exception caught: java.util.MissingResourceException, msg=Can't find bundle for base name model.ModelBundle, locale my_locale*
    Any ideas?
    10x
    Zmeda

    The most wierd thing is that, if I make ViewObjectImpl and insert this method
    public String getLanguage() {
    return (ResourceBundle.getBundle("model.ModelBundle")).getString("language");
    and call it in Bind Variable Expression Value: viewObject.getLanguage()
    IT WORKS!
    But why with groovy expression it does not work?
    Zmeda

  • Using groovy expressions to get a value of the current row

    Hi,
    I have a bounded task flow. The first step in the flow is calling an ExecuteWithParameters on one of my views. Based on the result of this query, I want to go to either Page1 or Page2.
    So I have a router. I first tried to route based on whether or not the result of the query contained only one row. That worked fine. But I want to add a condition to that.
    Basically, if the query returns one row AND that row has an attribute named 'Noc' == 1, then I want to go to Page2. Otherwise, go to Page 1.
    Right now to get the estimatedRowCount I am getting the iterator from the pageDef file created for my ExecuteWithParams object. To see if 'Noc' == 1, I tried this:
    #{data.rcl_view_reimbCode_search_results_task_flow_reimbCode_search_results_task_flow_ExecuteWithParamsPageDef.ReimbCodeSearchView1Iterator.currentRow.getAttribute("Noc") == 1}
    But it is complaining of grammar issues.
    What is the best way to go about getting the value of my attribute in a groovy expression?
    Thanks,
    Joel

    Hi,
    the best way is to use a managed bean reference
    1. create a binding for the router
    2. Expose the queried iterator in the PageDef file
    3. write a managed bean that accesses the binding
    BindingContext bctx = BindingContext.getCurrent();
    BindingContainer bindings = bctx.getCurrentEntry();
    DCIteratorBinding iter = bindings.get("NameOfIterator");
    // i) get estimated row count
    // ii) get attribute value
    //iii) evaluate
    // iv) return true/false
    Reference the managed bean from the router
    Frank

  • Groovy expression evaluation

    Hi,
    The following groovy expression is returning null when validating attribute. If I use (PolicyNum > 2000000) in the if condition it is working fine. If use (newValue < MaxManualClassEndDate) in the if condition that is also working as expected. if I combine these two conditions using && it is failing. Can you please suggest right way to merge two expressions using groovy.
    if ( (PolicyNum > 2000000) && (newValue < MaxManualClassEndDate)) {
    print "Policy Term EffDate $newValue is less than $MaxManualClassEndDate";
    return false;
    Thanks and Regards,
    S R Prasad

    Can any one help in resolving the groovy expression.
    It is not working when there is && in the if condition between two expressions.

  • (Groovy Expression) Get the no. of days between two dates

    Hi All,
    I am using ADF-BC-11g to create an entity object with 2 specific columns ActualDate and EstimatedDate both of Date type. I also want an additional field DaysBetweenTwoDates showing the difference between these two dates. Hence, I add another attribute DaysBetweenTwoDates in my entity object and after removing the Persistent property, I modify the expression field as ActualDate - EstimatedDate. When I test my AM, I get an error as below:
    *(oracle.jbo.JboException) JBO-29000: Unexpected exception caught: groovy.lang.MissingMethodException, msg=No signature of method: java.sql.Date.minus() is applicable for argument types: (java.sql.Date) values: {2009-04-01}*
    Can anyone please tell me how to achieve the same?
    Please note that I can not add a new column DaysBetweenTwoDates in the table nor can I have a new VO attribute subtracting and storing the difference as there are some logical and refreshing constraints.
    Any suggestions would be really helpful.
    Thanks
    Neeraj

    Thanks John,
    Oops...I did not think on this ground at all. Thanks for directing towards right direction. However, just to know, is that possible anyways thorugh groovy expression? Do we have any docs where we can search for the functions available in groovy expression?
    Regards,
    Neeraj

  • Is it possible to set character set at instance level?

    hi all,
    I have some confusion.
    say my database character set is AL32UTF8.
    and i want tio set charcter set of instance is WE8MSWIN1252
    Is it passible to set character set at instance level?
    Please reply with yes or No or why?
    Thanks & Regards,

    Hi,
    It's DataBase Level. One best example would be when you try to change the character or characterset conversion by using "Csscan" you can check the log or report. Which can guide what the things are happening. Instance - I think you might be referring to "Session".
    - Pavan Kumar N
    - ORACLE OCP - 9i/10g
    https://www.oracleinternals.blogspot.com

  • Accessing AppModuleImpl methods from Groovy expressions?

    From a VO View Criteria bind variable I'm attempting to call an accessor (aka. getValue) in it's parent AppModuleImpl, via a Groovy expression. I thought I could do something like:
    ((model.AppModuleImpl)object.getApplicationModule()).getValue()
    ...but at runtime I'm getting an error that Groovy doesn't know model.AppModuleImpl.
    I must be missing something here. Does anybody have the Groovy syntax for calling methods in the parent AppModuleImpl please? I've searched Grant Ronald's ADF Groovy whitepaper with no success, and I haven't found an example on these forums either.
    With thanks,
    CM.
    PS. JDev 11.1.1.2.0, ADF BC + ADF Faces RC

    Hi,
    I am not sure but may be you found this post useful http://andrejusb.blogspot.com/2010/01/storingaccessing-objects-in-adf-bc.html
    one more thing i did lately you can try if it works
    I created Method in AppModuleImpl class and called it in VOImpl class with AM object and then assigned it as expression to the attribute value in VO it should work for Bind variable value as well
    //Method in AM
      public String sayHello(){
        return "Hello World";
    //Method in VOImpl
      public String getHelloFromAM(){
        AppModuleImpl am = new AppModuleImpl();
        return am.sayHello();
    //Attribute "HelloTEXT" default value
    adf.object.getHelloFromAM()Hope it the same thing you are looking for
    Baig
    Edited by: BaiG on Jul 12, 2010 1:02 PM

  • Need Instance level failover in Windows Azure

    Hi,
    I have windows azure and sql server 2008 r2. I need to incorporate instance level failover (like widows failover cluster). How do i configure failover cluster in windows azure.
    Please dont recommend as Always on. since it has only DB level failover. But i need instance level failover. Please recommend if there is any other alternatives other than windows cluster failover.
    Thanks,
    Saravanan
    Please vote if you find this posting was helpful or Mark it as answered.

    Hi Durai,
    According to your description, since the issue regards Windows Azure SQL Database. I will help you post the question in the Windows Azure SQL Database forums at
    http://social.msdn.microsoft.com/Forums/en-US/home?forum=ssdsgetstarted. It is appropriate and more experts will assist you.
    We need to verify if you install SQL Server in the Windows Azure Virtual Machines, and the High Availability and Disaster Recovery (HADR) solutions for SQL Server in Windows Azure Virtual Machines include AlwaysOn availability
    groups ,database mirroring ,log shipping , and backup and restore with Windows Azure Blob Storage Service.
    Most SQL Server features are supported on Windows Azure Virtual Machine with some exceptions.
    However,  SQL Server Failover Clustering is not supported.
    For more information, see:
    http://support.microsoft.com/kb/2721672/en-us
    Regards,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • Database Level Tracing or Instance Level Tracing

    Hello,
    How do I know whether database level tracing or instance level tracing is enabled ? This is on 10g R2
    Thanks,
    R

    I amnot sure that I have heard about instance level tracing but normally tracing is enabled either through sql_trace parameter set in the parameter file or through some trace event. So you need to check your parameter file for any such setting.
    HTH
    Aman....

  • Re:Groovy Expression for time

    Hi All,
    Iam using Jdeveloper 11.1.2.3.0 ,my requirement is that :Groovy expression for time
    Can any one send me the above requirement
    Thanks,
    Sandeep

    What time?
    Yesterday noon?
    Now?
    You need to give us a use case.
    Check out GroovyCookbook: Dates and Times
    Timo

  • Groovy expression for fetching current user details

    I have created a view object that retrieves user details from the database. Also for dynamically getting the details of the current user logged in i have defined a bind variable currentUser and the default expression is adf.context.securityContext.userName.When i give the fixed literal value as user name the details are fetched. However details are not fetched when i use the groovy expression. Can i get some help on this please.
    Regards

    details are not fetched when i use the groovy expressionby using groovy you cant the details
    i cant get you, is this you question?
    some hints, here
    groovy expression as default value in a Entity's Field Problem

  • Groovy Expression Issue

    Hi,
    JDeveloper version: 11.1.1.3.
    I am setting the bind variable value using the below Groovy expression but the issue it is always setting the value "anonymous" instead of logged in user.
    viewObject.DBTransaction.session.userPrincipalName.toUpperCase()
    Note: Same is working fine in 11.1.1.2 version.
    Thanks.

    Hi,
    Thanks for the reply.
    Document says the following but I am not sure how to use incase of setting the bind variable for a VO.
    Application Module Returns Anonymous User After Logged In (9546149)
    Web applications using getUserPrincipalName() from ApplicationModuleImpl or SessionImpl may get 'anonymous' after user already logged in. Use ADFContext.getCurrent().getSecurityContext().getUserName() instead. Entities with histoty column kinds Created By and Modified By should override getHistoryContextForAttribute() in the entity impl class as follow:
    protected Object getHistoryContextForAttribute(AttributeDefImpl attr) {
    byte historyKind = attr.getHistoryKind();
    if ((historyKind == AttributeDefImpl.HISTORY_CREATE_USER) ||
    (historyKind == AttributeDefImpl.HISTORY_MODIFY_USER))
    Thanks.

  • ADF Groovy Expression for calculation

    Hi,
    I am using JDeveloper 11gR2. For a transcient attribute in a VO, I must add an expression that will calculate and return a value according to a business rule.
    I.e. if 'Standard' then column a * 0.3 or column b * 0.3
               elsif 'Premium' then column c * 0.3
               else 'Luxury' then column d * 0.3 Of course, using the appropriate Groovy expression. Does anyone have an example I could try?
    Thanks!
    Edited by: user545194 on 02.02.2013 07:28

    for example if att is the attribute that you want to calculate and it depend on val attribute
    the groovy exp is done on att
    if(val=='Standard') return a * 0.3
    else if(val=='Premium') return c * 0.3
    else if(val=='Luxury') return d * 0.3
    you must add attribute val, a, c ,d to the dependent attribute
    hope it helps
    Fakhri

  • Entity validation with groovy expression

    Hi,
    I'm using jdeveloper 11.1.2.3.0
    I have an entity object with two attributes "status" and "reason".
    Only in case the user select status id "4" I would like to validate that he will select also reason.
    for this I was trying to add entity validation with groovy expression.
    so I added this expression "Status== 4 && Reason == null" and also I added failure message.
    But it doesn't work as I expected.
    The error is displayed every time, also when the user select status that is not 4 and also when he select status 4 and the reason is not null.
    How should I write this groovy expression?
    Thanks

    Just to clarify,
    If you add this validation to your status attribute then it will validate that Reason is not null when you change the status to 4.
    If you want to raise an entity validation just add a new Entity Validator and the expression should be something like what you had:
    But slightly different
    Status != null ? (Status==4? (Reason!=null) : true) : true

  • Error in groovy expression: Illegal type in constant pool

    Hi,
    I intermittently get this error on my page:
    EMGC_OMS1 ERROR] [ http://oracle.adfinternal.view.faces.config.rich.RegistrationConfigurator [tid:
    userId: SYSMAN ecid: 004emUHK7jA9XbWLHyl3if0002JD0011gG,0:1 APP: emgc URI: ... ... ... :Server Exception during PPR, #15[[ javax.servlet.ServletException: java.lang.VerifyError: (class: org/codehaus/groovy/runtime/ArrayUtil, method: createArray signature: ()[Ljava/lang/Object;) Illegal type in constant pool
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:341)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    Caused by: java.lang.VerifyError: (class:
    org/codehaus/groovy/runtime/ArrayUtil, method: createArray signature:
    ()[Ljava/lang/Object;) Illegal type in constant pool
             at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
             at bc4j.oracle_sysman_core_event_console_uimodel_view_IssueListVO_PriorityLocalizedLabel_null.gs.run(bc4j.oracle_sysman_core_event_console_uimodel_view_IssueListVO_PriorityLocalizedLabel_null.gs.groovy:1)
             at oracle.jbo.ExprEval.internalEvaluateGroovyScript(ExprEval.java:1208)
    The IssueListVO getPriorityLocalizedLabel uses a groovy expression:
    oracle.sysman.core.event.common.uimodel.util.MetadataUtil.getPriorityLabel(Priority.intValue()).
    The Priority field is defined to be numeric, and the repository data shows all records having a value of 0, so this groovy expression should behave correctly.
    We are using Build JDEVADF_11.1.1.5.0_GENERIC_110409.0025.6013.
    Any ideas on how to resolve this?
    Thanks!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    cn u chk this
    LinkageError

Maybe you are looking for

  • Two iPhones linked to the same Apple ID

    Is there any way to have separate iMessage services for two iPhones linked to the same Apple ID? I share Apple ID with my wife for convenience of buying apps only once and sharing photo and music from one Mac. However, the my iMessages to other peopl

  • Display problem import photos

    Hello, I have a display problem when I try to import photos into Lightroom. I use the version 5.2. The problem can be viewed in the following video. At the begining you can view that there is something weird as under the folder "Panoramas" there is a

  • Which Ipad mini for 2 Daughters Help

    Hello, I'm looking into buying 2 Ipads mini for my 11 and 13 years old daughters for Christmas. I'm familiar with most Apple products but not much when it comes to Ipads. I came across to the mini ipad 2 retina 32GB on sale for $299 however I'm not s

  • Upgrade Logice Express to Logic Pro

    Any Big different/Advance that you experience when Upgrade Express to Pro?? Don't ask me to refer to the Comparison...please...i wish to get some really experience!! Thanks Ray

  • Direct Link to Next Task via Email

    I would like to send a direct link to the next process task via e-mail.  In this scenario a user would receive notification to complete a task assigned to them and be able to access that task directly from a link in the mail. I am currently able to s