Business rule + compare date + problem in jspx

Hi all ,
i am useing Jdeveloper11.1.1.3 .
i need to compare birthDate and employmentDate. birthDate must be greater than employmentDate at least 15 years.
there is a business rule method in entity object impl file :
* Validation method for InsuredPerson.
public boolean validateInsuredPerson() {
//start date must be greater than birthdate _ at lease 15 year (180 month)
Date birthDate=getBirthDate();
birthDate = (Date)birthDate.addMonths(180);
Date startDate=getStartDateEmployment();
if(birthDate.compareTo(startDate)==1) {
return false;
return true;
when false eraise an error message wil genarate.
when i test it in appmodule every thing is ok but by runnig jspx page :
birthDate is --> 1970-05-05
employmentDate --> 1991-05-05
consider edit birthdate from 1970-05-05 to 1980-05-05
so 1991-1980= 11 is < 15 --> error raise
but in jspx year of birthdate changed to 1995 ==> 1980+15
any body know why?or another way to develop it.
Regards,

I change my codes now it is ok .
public boolean validateInsuredPerson() {
//start date must be greater than birthdate _ at lease 15 year
int birthYear=getBirthDate().dateValue().getYear();
int startYear=getStartDateEmployment().getValue().getYear();
int diff=startYear-birthYear;
if(diff<15) {
return false;
return true;
}

Similar Messages

  • Business Rules and Dates

    I have many Java POJOs imported as facts. In each of these POJOs there is at least 1 date property.
    How am I to use these dates in my rules. for example:
    pojo.date > '08/22/06'
    pojo.date < today
    println(pojo.date)
    Although I have imported the java date class and have been over the docs many times, I cannot seem to figure out how to use the dates properly.
    I'm also having a similar problem where I have large numbers stored as doubles. When I make a rule like: pojo.largenumber > 3000 I get the error :
    Cannot perform operation. 'RUL-01726: Data type operator for >, at position 0: java.lang.Long > int '
    Thanks for the help,

    smartel2 wrote:
    I understand we need to compare like values, just as we would in java and other
    languages. however, I am trying to use the Rule Author to enter my rules, as my end
    user / business analysts would. When I use the rule author I can't seem to use any of
    the Date methods for example using the expert mode in the Rule Author
    pojo1.getStarttime ().compareTo(pojo2.starttime)
    gives: "Cannot perform operation. 'RUL-01717: "compareTo" is not a valid identifier
    name. '" when I apply it.Ah, I see. You are doing this correctly. You need to import the Date class into the datamodel and then check the "expand" option for the getStarttime() method of the fact type of pojo1 (or, the expand option if there is a starttime bean property). It should show up then.
    I also don't understand why my previous example "pojo.largenumber > 3000" would
    need a conversion. Shouldn't the interpreter be smart enough to know that the left
    side of the expression is a double and auto cast the right side constant '3000' as a
    double to satisfy the condition?The error indicated that "largenumber" was a Long object, not a primitive double. If largenumber was a double, the cast should be done correctly. If it's not, it may be a bug. Post the code for the pojo class if you think otherwise.
    How do I use the Rule Author to create these kinds of rules?I think the above mostly covers this one.
    How would I use the Rule Author to create a rule for "pojo.startdate is after Sept 1, 2005"One suggestion I have is that you use the Calendar class instead of Date for doing date manipulation. Date is mostly deprecated, and basically only servers as a wrapper for a long number (seconds since the epoch). Most importantly, Date is not internationalizable.
    Calendar has full support for locales, timezones, and all of the other necessary stuff for appropriately handling dates. A simple example of the reason for this class is that date formats differ significantly, for instance, "01/07/89" is January 7th, 1989 to an American, but is July 1st, 1989 to a European. Depending on the format, it could be July 1st, 0089 to a computer.
    So, the answer to you question is to create a final variable that represents the date (either a Calendar or Date) and then use that. With Calendar, you have to also use the SimpleDateFormat object to initialize it. I would probably write a function to initialize all of the global final date objects.
    How do I use standard java objects and there methods in the Rule Author, like Date.Answered above I think, but the short is to import them into the DataModel and then check the "expand" option for the property or method of that type that you want to access its properties and methods.
    Do I have to create all my rules in pure RL language (full script) ?Could you clarify this question?
    And finally, fully integrated date support is one of the things that's being worked on for the 11g release, so this should be much easier to handle in the future.

  • Business Rule Deployment Date & Time

    Hi All,
    Can we know if a business rule is deployed or not, including the time and date for deployment?? This must be available in RDBMS i think.
    Like i tried a query which selects all the Business Rules and display created , modified and moved date and time.
    The issue is that the time provided by the result of query do not match if we access the same business rule through workspace --> calc manger--> specified application --> specified plan type--> and the rule name
    The query is
    select * from
    hsp_object ho
    where ho.OBJECT_TYPE = 115
    Regards
    Ace,

    vvipirailo wrote:
    It's in EPMA schemeIt should be in the Calc Manager schema/database if the products have been deployed to separate dbs/schemas
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Business Rules comparing 2 values using formula

    Hi All,
    My intention is to setup a businessrule which verifies that the value of a specific field is not greater than 1.6 * the value of another field. Let's say my model has Products with Sales and CostPrice as attributes and  someone should be notified
    if SalesPrice > 1.6 * CostPrice.
    Would it be possible to set this up using MDS only ?
    Kind regards,
    Cees
    Please remember to mark replies as answers or at least vote helpfull if they help and unmark them if they provide no help.

    One idea:
    Create a new attribute and use a business rule to populate the attribute with a value that is 1.6 times the Cost.
    Then use another business rule to validate that the value of that attribute is less than the SalesPrice.
    If you have attribute groups, you can create this attribute without showing it to users by not adding it to any groups. (Or set display length to zero.)
    Hope this helps,
    Suzanne Selhorn [MSFT]
    Suzanne Selhorn [MSFT]

  • Business rule, runtime prompt problem

    Hi Gurus,
    We have one business rule which contain run time prompt where global variable assigned to it, when I run the rule form workspace I would able see all numbers from prompt window
    But when I run the same from Excel Smartview, I couldn't able to find all members from prompt windows.
    I was wondering what would be the cause?
    Thnx.

    Hi Amit,
    The person running the rule will need to have read access to both cost centers in order to transfer otherwise as you have seen the prompt will be invalid -- when select the prompt you should find the cost center that have no access to do not appear in the prompt itself. If you a value that the prompt does not make available then it will error out.
    If you do not want to provide read access to both cost centers, you may be able to setup a multi-step process with a transfer out by a previous owner and transfer in by the new owner using a temporary cost center both have read access to -- workforce planning uses both (one step and two step) depending on how your security is provisioned.
    Regards,
    -John

  • Comparing dates problem, need help?

    the checks are not working correctly, and I am missing something. Code is below.
    for the start date check.
    1. if I put in 28-OCT-2006, I get my error message. Why wont it let me enter today and how do I fix it?
    2. If the start and stop date are the same, my SAVE button code fires. WHy? and then it still ends up commiting.
    thanks,
    HERE IS THE START DATE TEXT
    SET_ITEM_PROPERTY('DRUG_ID', Enabled, PROPERTY_FALSE);
    declare
    alert_NO varchar2(10);
    startDate date;
    systemDate date;
    begin
    startDate := :DRUG_PRICE.START_DATE;
    systemDate := sysDATE;
    --this displays at the buttom of form
    -- MESSAGE('StartDate Must be >= Today');
    if(startDate < systemDate ) then
    --this displays at the buttom of form
    MESSAGE('StartDate Must be >= Today');
    --calls the appropriate alert
    alert_NO := show_alert('STARTSYS');
    RAISE FORM_TRIGGER_FAILURE;
    end if;
    end;
    HERE IS MY SAVE BUTTON
    declare
    alert_NO varchar2(10);
    startDate date;
    stopDate date;
    begin
    startDate := :DRUG_PRICE.START_DATE;
    stopDate := :DRUG_PRICE.STOP_DATE;
    --this displays at the buttom of form
    MESSAGE('Error with the Dates');
    if(startDate > stopDate ) then
    -- calls the appropriate alert
    alert_NO := show_alert('START');
    RAISE FORM_TRIGGER_FAILURE;
    elsif (startDate <= stopDate) then
    MESSAGE('Drug Price Added Successfully.');
    commit;
    end if;
    end;

    Is this forms?
    Anyway, regarding your question, you're comparing the input date against sysdate and maybe you're sending a trunc date so sysdate is always bigger (it includes day, month,year, hour, minute and seconds). Since you're sending a truncate date you're comparing now against today 12:00:00 a.m.
    Ex:
    select sysdate from dual;
    SYSDATE
    28.10.06 23:31
    select case when to_Date('28/10/2006', 'dd/mm/yyyy')<sysdate then 'a' else 'b' end FROM DUAL;
    CAS
    a

  • Comparing dates problem

    Hi,
    When I try to execute a query that contains:
    WHERE to_date(CALL_DATE, 'dd.mm.yyyy') = to_date('01.02.2005', 'dd.mm.yyyy')
    I get an empty table when using JDBC but it works when using an editor (like SQL Navigator). Any ideas. Thanks

    Is CALL_DATE actually a column of type DATE? If so, doing TO_DATE(call_date, <<format mask>>) forces Oracle first to implicitly cast call_date to a string using the NLS_DATE_FORMAT for the session, then explicitly casts this string back to a date using the supplied format mask. At best, this is a terribly inefficient approach (particularly if call_date is indexed). At worst, it causes all sorts of tough to debug issues.
    If call_date is actually a DATE, your WHERE clause should be
    WHERE call_date = TO_DATE( '01.02.2005', 'DD.MM.YYYY' )Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Other Delete Business Rule Problem

    Hello everybody
    I have a problem with Oher delete business rules and the problem is for getting rowid for a deleted row and it causes ther error : no data found.
    I solved this problem in this way
    qms_transaction_mgt.process_rule_violation
    ( p_br_name => 'BR_TEAM004_DEL'
    , p_msg_code => 'MS-00184'
    , p_display_label => display_label
    , p_table_name => 'ms_teams'
    , p_table_rowid => null /* get_rowid */
    In fact, I use null instead of get_rowid for this kind of rull. Is it a good way? Have every body any better way?
    Thanks
    Hassan

    Hassan,
    This is a known bug in the original Headstart 6i release. This bug was corrected in Headstart Patch 6.5.2.1 which is available via the Headstart Supplement Option. The Supplement Option can be purchase via your local consulting organization or the Oracle store. You will be given access to a portal from which you can download patches.
    Regards,
    Lauri

  • Display of data after Business Rule Execution

    Hi Gurus
    We are using 11.1.2 and experiencing few problems with some of out Business Rules. The problem is, BR executed successfully and the resultant data is not displaying in the target form. As a workaround, we put a dummy value in any of the target's combination and re-execute the BR, this time BR gets populate the target cell. Pls advice what sort of problem is this???
    Thanks in advance,
    SNK

    It could be down to the business rule not creating blocks, by entering dummy data then you are creating the blocks and the rule will run as expected.
    Have a look at this post :- Re: Busines rule Issue
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How to include the COUNT Function in business rule

    Hi all,
         I am working in oracle data quality in ODI.
         This is regarding the business rule in Data quality.
         I need to count the number of records when my status_type="A".
         But when i include the COUNT function in business rule.
         I find the following error as "*Unspecified Count Function*".
         Waiting for ur valuable reply.
         Thanks in advance,
         JayaPradha P

    Hi,
    The following is the condition I have to be used
    For eg:*Count records in DIM_SERVICE_ORDER_CODE where service_type = ‘P’*
    But when i use COUNT function.
    Im getting the error as "Unrecognised function count"
    waiting for ur valuable reply
    Thanks in advance,
    JayaPradha p

  • Unable to access Business Rules Facts after refreshing XML Facts

    I have created a business rule using an xml schema to generate the XML Facts. Then I created a Decision Function to call a Ruleset to process the information in the XML Facts. This decision function has input and ouput parameters from the XML Facts.
    The decision function is used inside a BPEL Process, by defining the Dictionary has the created business, defined the Service has de Decision Service. After this configuration I'm able to define the Input Facts and Output Facts from and to a variable in the bpel process. Using the Decision Fact Map window I define the input and output to the exposed Business Rule Facts. This works just fine. The BPEL runs and the Rules are correctly used.
    When I change my xml schema to add more elements and complex types I use the "Reload XML Facts From Updated Schemas" option available in the bussiness rule. After this operation I will no longer have access to the Bussiness Rule Facts in the Decision Fact Map window. So I'm no longer able to call the decision function.
    Yet the business rule has no problems and i have tested using a fuction to call the Decision Function.
    Is this a bug or a feature?
    I'm using Oracle 11g with the SOA Composite Editor 11.1.1.0.0.52.19.

    Problem solved. There was an element in the xml schema that had nillable = true. Because of this the XML Fact for that element would no longer be available in the BPEL Process. Removing the nillable and generating the XML Facts again solved the missing variable problem.

  • Business Rule RTP issue

    Hello,
    Currently I am seeing end users intermittently having issues on Business Rules. THe problem is that the description/prompt strings do not display when a user launches a rule. This seems to occur in both SmartView and IE8.
    Has anyone experienced this sort of issue before ?
    Cheers
    Chris

    I had some weird issues where the pop-up wasn't actually being displayed on the monitor, but it was opening (I think it was actually on 11.1.1.3).  We found this out by someone experiencing the problem, and then adding a second monitor for another purpose and the box would show up on the second monitor.  We ended up deleting the Excel items in the registry, and when Excel is reopened it rebuilt them and the popup worked, another option would have been to add a second monitor temporarily to move it back to the main monitor.
    Regards
    JTF

  • Issue with creating/Launching a Business Rule

    Hi All,
    I'm using Hyperion version 11.1.2. When creating Business Rule in EAS console, we can't use admin user right ? Is there any specific reason for that ? I've created one other user called "BRadmin" and given admin privileges to all areas. I've logged in EAS console with the new user ID BRadmin and under "Business Rules" i'm trying to create a new Business Rule BR1. In the associated outline area when i'm trying to select "Select outline" no applications are showing under planning and the planning applications are available under Essbase node. For Business Rules, i should select Planning Application under Planning node right ? Why it is happening. I'm unable to select the Planning application from Planning node and due to this, i'm unable to see the Business Rule in Data Forms in Work Space. Pls. advice

    I did Stop the following services, planning, EAS, hyperion RMI.
    & Started them up RMI, EAS, Planning.After this have you logged in the planning application, before selecting business rules in EAS?
    1. Have you selected Calculation module as Business Rule during outline creation? if not select Calculation module as BR.
    2. Right click on the business rule node and select refresh user list.
    Cheers..!!!

  • Business rule to execute SSIS package OR SP

    Is there a way to trigger SSIS package OR Stored Procedure by Business Rule?
    I would like to trigger SSIS package based on value change of specific column in MDS.
    RaghuM

    Hi MSRN,
    As you may know, Business Rule (Master Data Services, MDS) have the following types of actions
    Default value actions
    Change value actions
    Validation actions
    External action
    The first 3 type of actions can only affect objects inside MDS. The last one, External action, has the action "start workflow".
    The "start workflow" action can be the breakthrough point for us to trigger SSIS packages or Stored Procedure(SP).
    In the StartWorkflow method, we can load an SSIS package by SSIS object model class "Application". We can then Execute the package by package.Execute().
    Same to start SSIS package, we can execute SP by SQLCommand from StartWorkflow method.
    To understand how it works well, please:
    Review "Workflow Integration with Master Data Services":
    http://msdn.microsoft.com/library/gg690195.aspx
    Execute SSIS Packge by using C# and SQL Server:
    http://www.codeproject.com/Tips/658959/Execute-SSIS-Packge-by-using-Csharp-and-SQL-Server
    Thanks,
    Jinchun Chen

  • Error in Business Rule execution

    Dear Gurus,
    I have two base planning applications whihc are having lot of business rules. I have created Duplicate application for those two application by using LCM and EPMA. I have migrated each and every artefact.
    I am able to see all the Business Rules in planning application and able to launch those but one business rule is giving problem.
    That business rule is having 6 runtime prompts but in error it is stating only one RTP name.
    The Error is - Unable to retrieve variable RTP_LAST_ACT_WK deployed in application PROPTEMP in Planning instance Default
    I am clue less why the application is throwing this error.
    Thanks
    Giri Prasad

    Hi Rahul and Endy,
    I have created another duplicate application now and migrated all the artefacts and I set the default value for RTPs which i got from validation of particular business rule. Now its running fine with default instance.
    The problem is i have created some more applications on different instance than the base application where the business rule validation is throwing different error.
    I can stongly say that the instance is making the difference.
    can you please let me know how to change the instance of existing planning applications.
    Thanks
    Giri

Maybe you are looking for

  • Is there a Firefox plug-in for Outlook Web Access?

    I want to access all of Outlook's functions but can't through Firefox, only through Explorer. In Outlook Web Access through Firefox, I don't have access to menu options for italics, bold, underlining, etc., and I can't view the list of emails on one

  • People Picker in Central Administration on change Site Collection Administrator page.

    Hi there We are coming to the end of our rope here. We have a problem where the people picker is not working in Central Administration, particularly the change Site Collection administrator page. It simply does nothing but hang the page, it doesn't e

  • Segment creation for outbound Idocs to non-SAP system

    Hi, I need to create a custom idoc for outbound interface to a non-SAP system. Here I need to create segments. So, should I create the fields in the segment with the attributes of fields in non-SAP system or fields attributes should be of SAP system.

  • Business Card Scanner

    Hello, does anybody know if there is a business card scanner which supports SAP CRM ? We actually run SAP CRM 5.0 and have a workaround to create flat files to upload them to SAP with a special report. Thanks in advance, Thorsten

  • Installing Windows 7 Disc not found

    Hello, When I try to install Windows 7 professional 64 bit I install the CD and click start installation on the boot camp assistant. It returns with "The installer disc could not be found Insert your Windows installer disc and wait a few seconds for