-2

I am trying to compare two dates in DRL file using compareTo().However, I am facing an issue when I use new Date() as the argument to the compareTo() method.

eg:

loanDatePaid.compareTo(date2)==0

is working but

loanDatePaid.compareTo(new Date())==0

is giving

Exception in thread "main" java.lang.RuntimeException: Cannot find KieModule: org.default:artifact:1.0.0-SNAPSHOT
    at org.drools.compiler.kie.builder.impl.KieServicesImpl.newKieContainer(KieServicesImpl.java:186)
    at org.drools.compiler.kie.builder.impl.KieServicesImpl.newKieContainer(KieServicesImpl.java:172)

Can anyone suggest why it is so?

PS: The exception posted above is standard one which is coming for all errors in drl execution at runtime. https://groups.google.com/forum/#!topic/drools-usage/LHRKHkO35RI

The-Proton-Resurgence
  • 808
  • 1
  • 13
  • 28
  • Can you post the error you're getting? – Turtle Aug 02 '17 at 14:12
  • could you use java 8 Date and Time API or are you forced to stick with the old one ? – Ahmad Sanie Aug 02 '17 at 14:28
  • You asked the same question 3 hours ago in a different thread: https://stackoverflow.com/questions/45458466/cannot-find-kiemodule-org-defaultartifact1-0-0-snapshot – Esteban Aliverti Aug 02 '17 at 15:31
  • Possible duplicate of [Cannot find KieModule: org.default:artifact:1.0.0-SNAPSHOT](https://stackoverflow.com/questions/45458466/cannot-find-kiemodule-org-defaultartifact1-0-0-snapshot) – Esteban Aliverti Aug 02 '17 at 15:31
  • @EstebanAliverti As in the comment of IntellijAMiya in the post - https://groups.google.com/forum/#!topic/drools-usage/LHRKHkO35RI. All errors in the drl give this standard error and the two questions are different in the sense this question specifically asks why compareTo() is not working. – The-Proton-Resurgence Aug 02 '17 at 21:24

2 Answers2

1

You are missing the dependency for the module. Have a look at a similar issue in this posting

Imtiyaz J
  • 19
  • 1
0

Somehow the drl execution facing errors at runtime gives the standard error posted above. For more info: https://groups.google.com/forum/#!topic/drools-usage/LHRKHkO35RI

Also, this is a misnomer as this leads in a wrong direction.

The issue was that I was not importing java.util.Date class for initialization of new Date().

The-Proton-Resurgence
  • 808
  • 1
  • 13
  • 28