In official documentation I can't find any information how to write conditional statements for java.util.Date type fact fields in guided rules. For example how to compare such field to current date, check if it is equal omitting time, or check if it is date before some time from now?
2
There are 2 best solutions below
Related Questions in DROOLS
- Drools LHS Evaluation: matches vs String.contains()
- Drools : Rule firing multiple times
- How to load Drools Rule From DB
- JESS vs DROOLS : Backward chaining
- Failed to execute goal org.kie:kie-maven-plugin:6.1.0.Final:build
- Drools rules not firing
- Drools Stateful Knowledge Session using persistence
- Optaplanner finds unnecessary conflict for Custom dataset for curriculum example
- How to add a rule to an existing KnowlegeBase Drools 5.3?
- Drools: Match local string from array in LHS of rule
- Protocol message contained an invalid tag while trying to Complete Task using drools 5.5.0.Final
- Can't log into Workbench with roles developer, manager, or user
- Drools 6.x Workbench cannot be deployed to tomcat in windows- no resource registered with uniqueName 'jdbc/jbpm'
- Cannot see File Explorer and Project Explorer side panel in Drools 6?
- Facts can not be deleted automatically when I use sliding window
Related Questions in RULES
- Xpath rule template is missing in SonarQube 5.1
- How do I give read/write access to all nodes with Firebase rules?
- How to add a rule to an existing KnowlegeBase Drools 5.3?
- Python Script to Turn Outlook E-Mail Rules on and Off
- yii2 disable the rules if a checkbox is selected
- Trigger Rule with Filefield 'when field has changed' in Drupal 7
- Firebase Rules Flat structure for stores, user, products relationship
- Set length on when required Yii2 rules
- Add rules using jquery
- SAS Enterprise Miner Associaton Rules generation
- Rule to group two facts in prolog?
- How scaleable is drools in applying rules over millions of transactions?
- R. Apriori. Preprocess data to know the name of the attributes in the rules
- How to export and import a set of rules selected from the predefined rules in the rules configuration of the Eclipse Plugin PMD?
- drools working with dates
Related Questions in JAVA.UTIL.DATE
- java.util.Date returning --> 2016-12-26 14:18:57.0 want to remove this .0
- drools working with dates
- Java Date library accepts bad dates
- Why do java.util.Calendar before() and after() methods take an Object as an argument, and simply return false if the passed Object is not a Calendar?
- Does DateUtil.AddDays accept a variable for the # of days?
- Comparing only dates not working properly in Java
- getting java.lang.IllegalArgumentException: Illegal pattern character 'o'? while parsing java.text.SimpleDateFormat
- java.util.Date: seven days ago
- Java - getting consistent UTC values irrespective of server
- Different time conversion by using java.util.Date in Java
- How to retrieve DATETIME format from Sqlite database
- Why is the month changed to 50 after I added 10 minutes?
- JodaTime convert from Java.util.Date to DateTime (or LocalDate)
- Compare last modified time of file on google drive and file which is stored on local machine
- java.time.LocalDate to java.util.Date
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Drools isn't a real-time program and it doesn't have an innate idea of Time or Now. If you need to investigate relations of some fact property w.r.t. some point of time X, you'll have to establish a fact carrying X as its data, and write your rules based on that.
A more or less coarse approximation of a fact representing Now can be made using timers. You can implement a rule that modifies a fact containing a value representing Time (e.g. java.util.Date) every second, or less frequently.
Blending out the time of the day is something you'll have to do using Java or DRL functions. Alternatively, if it is days you are interested in, use some custom class representing days, with some suitable day 1 defined by you.