Calendar oneYearLater = new GregorianCalendar(); oneYearLater.add(Calendar.YEAR, 1);
The first line gets today's date. The second line should change the value, but it isn't doing it.
I am running Drools in debug mode, and the value of the field doesn't change from one line to the next. What am I doing wrong?
I have also tried this:
Calendar oneYearLater = new GregorianCalendar(2108, 9, 24);
The result that shows in the debug Variables display area looks pretty random to me. When I look at the values, cdate is null, and gdate has a cachedYear of 2004, while the dayOfMonth, Month and Year are all 0. Again, what am I doing wrong?
Verrry innnteresting. Printing the field as you suggested had the same results that you showed, that is, the field changed as it was supposed to.
But the variable display area of the debug mode showed that the field did NOT change.
This tells me that my question is not about making the code work right, but it's really about making the environment work right, so the code will do what it is supposed to do. Or that I need to understand the environment, and how to interpret what debug is telling me. I'll go to the experienced folks around here for that.