The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

bato (12) [Avatar] Offline
I’ve encountered problems with Drools Script from Listing 14.9. - alerts.drl

rule "weekdays are high priority"
   calendars "weekday"
   $alert : Alert()

rule "weekends are low priority"
  calendars "weekday"
  $alert : Alert()

When I try to start mule application the following error message is thrown:

ERROR 2015-10-06 15:15:27,027 [main] org.mule.module.launcher.application.DefaultMuleApplication: null
Errors while parsing ruleset defined in file alerts.drl : [10,3]: [ERR 101] Line 10:3 no viable alternative at input 'calendars' in rule "weekdays are high priority"[19,2]: [ERR 101]
Line 19:2 no viable alternative at input 'calendars' in rule "weekdays are high priority" in rule "weekends are low priority"

When these rules are commented out the scrip works fine.
Have someone any idea what cause this error?

My environment is :
Anypoint Studio 5.3.0
Mule ESB and Integration Platform
Version: 3.7.0 Build: 725cbc8a
JDK: 1.8.0_05 (mixed mode)
OS: Windows 7 - Service Pack 1 (6.1, amd64)
David Dossot (233) [Avatar] Offline
Mule in Action Ed2 source code has been tested against version 3.4.0. It is possible some examples do not work with version 3.7.0.

For the sake of investigations, can you try installing a 3.4.x runtime in Studio and run the example against it?
bato (12) [Avatar] Offline
Mule console
[ 21 KB ]
I got the same behavior with CE 3.4.0 and java 1.6.33. I attached Mule configuration file and drools script, perhaps I overlook something. I proceed as follows: In AnypointStudio create a new Mule project and add attached files.
The project structure is simple:
| +---api
| +---app
| | mia2.xml
| |
| |
| |
| +---java
| | \---com
| | \---prancingdonkey
| | \---domain
| |
| |
| \---resources
| alerts.drl
| \---com
| \---prancingdonkey
David Dossot (233) [Avatar] Offline
There should be a
directory at the root.

Did you use the functionality for importing a Mule Maven project?
bato (12) [Avatar] Offline
Hi David
I don’t use maven for this project.
Src folder exists, the root of above listing is src folder.
When two rules with 'calendar' function are commented out everything works fine.

I proceed as follows:

1. In AnypointStudio create a new Mule project
2. add following files from the book source code
- chapter05\src\main\java\com\prancingdonkey\domain\
- chapter05\src\main\resources\alerts.drl
3. Customize mia2.xml (see above attached file Mule configuration )
4. Start mule application. Run>Run As>Mule Aplication

the error message is thrown
David Dossot (233) [Avatar] Offline
If you don't import as a Maven project, you need to make sure that:

are all configured as source folders on the build path.

Is this the case?
bato (12) [Avatar] Offline
Mule Project
[ 11 KB ]
Yes everything is in place. See attached Mule Project
David Dossot (233) [Avatar] Offline
Yes, everything looks in order. I'm sorry, I don't know why this doesn't work anymore :'(