Questo contenuto non è disponibile nella lingua selezionata.
13.3. Working with POJOs
Procedure 13.1. Task
- Observe the example below:
public int getAge() { Date now = DateUtil.now(); // Do NOT do this return DateUtil.differenceInYears(now, birthday); }
public int getAge() { Date now = DateUtil.now(); // Do NOT do this return DateUtil.differenceInYears(now, birthday); }
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - To solve this, insert a fact that wraps the current date into working memory and update that fact between
fireAllRules
as needed.