Groovy expression to create a range of business rules

Hello

JDev 11.1.2.4

I need to check if a date is between now and 6 months ago. I created a range validation rule, I put the maximum value of adf.currentDate. I need to do the same for the minimum value.

What is the groovy syntax on 6 months ago?

Thank you

Something like this perhaps? (You can add this as the groovy for the attribute expression end date).

import java.util.Calendar;

Calendar cal = Calendar.GetInstance ();

Cal.Add (Calendar.MONTH,-6);

Return cal.getTime ();

Arun-

Tags: Java

Similar Questions

  • Error with groovy expression of sequence number of EO attribute assignment?


    Hello world

    My version of Jdeveloper is 11.1.2.3.0.
    Starting from this post: https://tompeez.wordpress.com/category/adf/page/6/
    I found to add a groovy expression for the sequence number to my attribute. I created a single sequence and added that the groovy expression to my attribute but got the error below:

    Utils > < buildFacesMessage > ADF: addition of the following JSF error message: failed to start, bc4j_model_TestEntityObject_Empno_null_gs.groovy: 1: lack of hook closing ' > ' for generic types.
    solution: Please specify the missing support! @ line 1, column 12.
    1 error

    org.codehaus.groovy.control.MultipleCompilationErrorsException: failed to start, bc4j_model_TestEntityObject_Empno_null_gs.groovy: 1: lack of hook closing ' > ' for generic types.
    solution: Please specify the missing support! @ line 1, column 12.
    1 error

    Note: groovy expresion used in my EO attribute is given below:
    (new class < SPAN > 'skimlinks-fidget' = > oracle.jbo.server.SequenceImpl ("SampleSeq", adf.object.getDBTransaction ())) .getSequenceNumber </span >)

    also used:
    (new class < SPAN > 'skimlinks-fidget' = > oracle.jbo.server.SequenceImpl ("SampleSeq", adf.object.getDBTransaction ()) .getSequenceNumber () </span >

    What can be the problem?
    Please give me your valuable contributions...


    Thank you.

    Sorry, somehow the code in the blog is messed up. Use

    (new oracle.jbo.server.SequenceImpl ("SampleSeq", adf.object.getDBTransaction ()) .getSequenceNumber)

    Where SampleSeq is the name of the sequence defined in the comic book.

    Timo

  • How to call a method defined in AppmoduleImpl using a groovy expression?

    Hi experts,

    With the help of jdev 11.1.1.5.0 - adfbc battery.

    I followed this post as the blogger says.
    How to call a method defined in AppmoduleImpl using a groovy expression?
    https://blogs.Oracle.com/ADF/entry/how_to_call_a_method

    While a button insert hit

    Suite error survey.
    java.sql.SQLException: ORA-20483: ADM-
    ORA-06512: at "RMSTD.FUNC_FIND_PLNT_DESC", line 22
    ORA-06512: at line 1
    
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:457)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:405)
         at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:889)
         at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:476)
         at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:204)
         at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:540)
    It is my code for the function.
    CREATE OR REPLACE FUNCTION func_find_plnt_desc (
       p_bu        VARCHAR2,
       p_plnt_id   VARCHAR2,
       p_lang      NUMBER
    )
       RETURN VARCHAR2
    IS
       CURSOR cur_find_plant
       IS
          SELECT bup_name1, bup_name2
            FROM bus_unit_plants
           WHERE bup_bu = p_bu AND bup_plant_id = p_plnt_id;
    
       rec_find_plant   cur_find_plant%ROWTYPE;
    BEGIN
       OPEN cur_find_plant;
       FETCH cur_find_plant INTO rec_find_plant;
    --RAISE_APPLICATION_ERROR(-20999,P_BU||P_PLNT_ID);
       IF cur_find_plant%NOTFOUND
       THEN
    
          raise_application_error (-20483, 'ADM' || P_PLNT_ID ||'-'||P_BU);
          --NULL;
       END IF;
    
       CLOSE cur_find_plant;
    
       IF p_lang = 1 THEN
          RETURN (rec_find_plant.bup_name1);
       ELSIF p_lang = 2 THEN
          RETURN (rec_find_plant.bup_name2);
       END IF;
    END;
    /
    Reason behind:
    while hitting the insert means null from the value of the survey so error function.

    If am not hitting doesn't mean no problem. the function works correctly return description.

    can someone help me how to override?

    Published by: ADF7 on April 10, 2012 23:51

    ADF7,
    the subject of the post has nothing to do with the question (for as far as I see it).
    As you can see the error message clearly comes from the procedure pl/sql you call the application module, works of groovy appeal method.

    We cannot decide what makes your service if you pass null as a parameter. You can check the settings before you proceed to the procedure or write the procedure in how it treats null parameters.

    Timo

  • Groovy expression to return a string.

    Version 12.1.3

    I got this groovy expression that evaluates to true or false
    don't #{pageFlowScope.userName, null}

    How to rewrite, so that it returns a string when it is false?

    Thank you

    I think it's just EL, not Groovy.

    #{pageFlowScope.username == null? {"it was null": 'it was not null'}

  • execution of groovy expression based on a condition

    Hello

    I'm on jdev 11.1.2.4 and MySql db.

    I use under groovy expression to get the domain in my name of the VO. area is a temporary variable.

    key oracle.jbo.Key = new oracle.jbo.Key (AreaId);

    Return LookupAreaVO1.findByKey(key,1) [0] .getAttribute ("AreaName");

    It works very well if there is a value in AreaId. However, he throws a NPE when there is no value.

    How I can only run this code if AreaId has value?

    It works very well if there is a value in AreaId. However, he throws a NPE when there is no value.

    How I can only run this code if AreaId has value?

    Add an if to test the value AreaId.

    If (AreaId! = null) {}

    key oracle.jbo.Key = new oracle.jbo.Key (AreaId);

    Return LookupAreaVO1.findByKey(key,1) [0] .getAttribute ("AreaName");

    }

  • Groovy expression in the output text

    Hi all

    I want to use groovy expression in the output as text

    < af:outputFormatted value = "#{adf.currentDate}" id = "2" / > "

    < af:outputFormatted value = "#{adf.userSession.userData.user}" id = "2" / > "

    but the values are not seen at the exit and the value to the property inspector area becomes red...

    This is because groovy can be used on the side of the model. For the user interface, you use the expression language.

    For the user, you can use adfsecurity information (control http://docs.oracle.com/cd/E14571_01/web.1111/b31974/adding_security.htm#CHDFFGDJ)

    To date, you must implement a bean method that you call via EL.

    Timo

  • Reader Adobe XI updates last week. Reinstalled this morning. All previous saved pdf files are now forms of words asking the conversion? Creates problems for my business. Help, please?

    Reader Adobe XI updates last week. Reinstalled this morning. All previous saved pdf files are now forms of words asking the conversion? Creates problems for my business. Help, please?

    See http://windows.microsoft.com/en-us/windows/change-file-open-program#1TC=windows-7

    Another method: http://windows.microsoft.com/en-us/windows/change-default-programs#1TC=windows-7

  • problem in the groovy expression

    Hi all
    I have three attributes: "WorkDateFrom", which is of type Date and "Working days" which type number and "WorkDateTo", of type Date.

    the value of 'WorkDateTo' must be
    WorkDateFrom+WorkDays
    After the execution of the Application Module to test. I write the value of "WorkDateFrom" and the value of "Working days", the WorkDateTo value will be zero.
    This expression is wrong?

    Just tested on the opinion of the employees in the HR schema. My groovy expression

    HireDate+DetartmentId.intValue()
    

    Displays the correct result. So, if your WorkDateFrom is of type Date and days of work is of type number and then

    WorkDateFrom + WorkDays.intValue()
    

    should work. Always check null values.

    Timo

  • Error when creating a business rule

    Hi all

    I'm trying to create the regional service console m rule when I choose business rule > repsitory display > rules > new rule > select outline.
    I am able to select an essbase database schema, but while I am trying to select the outline planning I get the following error


    WARN http-10080-Processor4 com.hyperion.hbr.plugin.planning.PlanningMetadata - connection error in the metamorp-ee0b9e of Planning Server.


    Any suggestion?

    Thank you

    The problem is solved? You log on with the default admin user? Given that it is a question in the environmental assessments for business so rules using user default hyperion. For example, to create a new admin user and try. I hope this will help you!

    byeee
    Ankur

  • Impossible to find in the JDeveloper business rules when creating new project

    Hi all

    I'm in Chapter 9 creating a rule of Non - SOA Java EE Application for JDevloper 11 g. I'm following the instructions given in the chapter.
    However I can't find a category of business rules for the creation of a directory of business rules.

    It must probably be activated from a place.
    I tried to look for its meaning with JDev installation but do not have anything.

    However, it seems very basic level problem... Please let me know if anyone knows how to solve

    Thank you
    Haman.

    Published by: user11223806 on August 12, 2009 07:48

    Have you installed the extension of SOA for JDeveloper for help-> updates?

  • Ranging from the form of a business rule is incorrect.

    Say we have 2 forms of planning F1 and F2 with 2 B1, B2 business rules. B1 is set to F1 and B2 is set at F2.

    We open form F1 and open B1, and then open the form F2 and run B2, we observe that instead of B2 B1 is running.

    This strange phenomenon occurs in all forms with their related business rules.

    Note: Is not a specific user or a specific browser.

    Someone has seen this before. Hyperion Version: 11.1.2.2

    Enjoy the anyhelp.

    Reading of Re: question in business rules with shapes (11.1.2.2.300) attahed

    See you soon

    John

  • Planning of business rule

    I need to write a business rule to calculate the difference of version 1 and version 2 and copy this difference to version 3 for all data at the level of zero for all the periods of a year, including the opening balance. Can someone help me

    You could have elaborated more on your version of Hyperion, you're on and and what are your basic needs. (is this a a time point, it is something that must be considered at all times).

    A very simple approach (without having to deal with a business rule) be fair would create a member of the dynamic version with an e.g (@VAR (VERSIOn1, Version2)) formula member. Again only once, you know the design of your application, as well as the details around your needs so you should test to see if the option is possible.

    Others on the Board of Directors will give more information on approaches using some business rule approaches (e.g. VERSIOn3 = Version1 and Version2 ;) who would be most effective.

    I hope that the option has been useful for you and let us know how make you out.

  • Delete the business rule on the list of planning application business rules

    Hi all


    It is Hyperion planning 11.1.2.3 500, Classic application.


    The business removed from the calculation Manager rule is not available in the calculation Manager but still available in the list of planning application business rules.

    Any suggestion is appreciated to get it removed the application too.

    Note: EPMA, to deploy the application, but not safe for the classic.

    Kind regards

    Deker P.

    Are you sure you have deployed all the rules again Calc Manager planning then the rule is removed from the planning to remove from the Manager of Calc won't be enough.

    Support documents

    How to remove Calc of Hyperion Planning and Smart View rules after their removal in the calculation Manager? (Doc ID 1983285.1)

    How to remove redundant deployed rules of calculation Manager a Hyperion Planning application (Doc ID 1568355.1)

    How to completely remove the business rules created in the calculation Manager (Doc ID 825853.1)

    How to remove business rules that have been deleted or renamed in the calculation of Planning Manager. (Doc ID 1598010.1)

    See you soon

    John

  • How to access a group of resources from business rules?

    Hi, I am using jDev 11.1.2.4.0

    I created a business rule in the purpose of the entity and everything works fine! The only problem is that I want to translate the message defined in the business rule.

    Anyone know how to get a resbundle ource of the business rule? (As it is possible to see on the image below).

    I already have the resource group created and it works great!

    Untitled.png

    Thanks in advance!

    Best regards

    Try to place your resource group in the same folder that Jdeveloper would place the default.

    Make sure that you use the name of the package just before the name of the package.

    Restart your Jdeveloper.

  • Business rule to use member of form page

    Hi all

    I need to create a business rule that uses a member of the page of the form. A variable RTP created and used in the Rule.Attached the rule and choose 'use the shape members' and 'hide at short notice. But, always request invite. How to display the prompt?

    Is the type RTP or members, keep Member.

Maybe you are looking for

  • 4655 all-in-one: set up my 4655 in Windows

    Can not set up the 4655 as a printer on my Lenovo Yoga 2 execution of Win10. I can see that he established as Telec.

  • Poor access WLAN

    Can I have a real problem with my WIFI adpter or is this normal? I use my EDGE 13 for 3 months now. As soon as I have the view contact to my router to get the usable connection (maximum 6 meters). It's even more frustrating because we use a 11 EDGE f

  • High temperature of Acer Aspire One 725

    Hello I just got my new Acer Aspire One 725 and it works very well - however, when I checked what temperatures at which it turns, I'm quite concerned. The inactive temprature is about ~ 60 degrees Celsius, and under load, he got to 87 degrees Celsius

  • Impossible to open attachment on my e-mail xls is the file, does downloading MicrosoftOffice always no go HELP frank

    I have recived an e-mail message with p.j. I was unable to open reason given was, necessary downloaded free microsoft office trial version software and have the confirmation number, now what that? Frank

  • Windows updates will not be installed.

    I had to run a System Recovery on my PC running Windows 7 Home Premium 64-bit.  I got the disc that came with the computer.  As I did the reinstall, I was not able to update windows.  The procedure starts normally, but nothing else happens.  The Stri