Sometime back I was asked by Manning Publications to review proposal for a new book on Drools titled 'Drools in Action'. The book looks promising and should be useful for those interested in incorporating an open source and standards based Rule Engine into their applications or services.
Open Source SOA is another great resource for Java architects looking at implementing SOA-based solutions with open source products without expensive commercial products.
Mano's Tech World
Saturday, December 12, 2009
Thursday, November 6, 2008
Introducing Famree
Famree is a web based application intended to bring family members together. The application is an open source project written in Java/Groovy and Grails framework. Famree allows you to build your family tree starting with the root of the family and working your way down.
Features
Features
- Manage family tree
- Rich User Interface
- RSS feeds of upcoming events
- Timeline chart indication key events in the family
- Charts for family composition
- Administer Announcements, events, and FAQ
- Configure multiple site administrators with different authorization
- Template management
Monday, August 4, 2008
Drools Plugin for Grails Application
I have just released a Grails Plugin for Drools. The plugin details can also be found at http://www.grails.org/Drools+Plugin.
Drools is a business rule management system (BRMS) and an enhanced Rules Engine implementation, ReteOO, based on Charles Forgy’s Rete algorithm tailored for the Java language.
Features
Installation
grails install-plugin drools
Usage
Components
DroolsService
droolsService.fireRules(resource, ruleKey, objList)
Example
A simple Ticket processing system is available in the plugin. This example shows how tickets are processed based on their subscription plan.
Run the example: http://localhost:8080/your_app/drools/example
Your console output should be:
Start processing Ticket # 3
Start processing Ticket # 2
Start processing Ticket # 1
Firing rule Bronze Priority for Ticket # 3
Firing rule Silver Priority for Ticket # 2
Firing rule Gold Priority for Ticket # 1
Firing rule Special Discount for Ticket # 1
Display on your browser should be:
Tickets due for processing:
Ticket #1: Customer[Name:Jack, Subscription:Gold, Discount:0%] Status[New]
Ticket #2: Customer[Name:Tom, Subscription:Silver, Discount:0%] Status[New]
Ticket #3: Customer[Name:Bill, Subscription:Bronze, Discount:0%] Status[New]
Firing rules now ...
Tickets after processing:
Ticket #1: Customer[Name:Jack, Subscription:Gold, Discount:5%] Status[Escalate]
Ticket #2: Customer[Name:Tom, Subscription:Silver, Discount:0%] Status[Escalate]
Ticket #3: Customer[Name:Bill, Subscription:Bronze, Discount:0%] Status[Pending]
Drools is a business rule management system (BRMS) and an enhanced Rules Engine implementation, ReteOO, based on Charles Forgy’s Rete algorithm tailored for the Java language.
Features
- Easy implementation of Drools
- Rules can be stored in file or in database
- Rules can be dynamically changed without rebuilding or restarting application
Installation
grails install-plugin drools
Usage
- Install the plugin
- Verify example rules: http://localhost:8080/your_app/drools/example
- Create your own rules: http://localhost:8080/your_app/drools and use droolsService in your code
Components
- DroolsController: Provides CRUD functionality for Drools Rule
- DroolsService: Fires all rules
DroolsService
droolsService.fireRules(resource, ruleKey, objList)
- resource: specifies where the rules are stored. ‘file’ or ‘db’
- ruleKey: identifier for the rule. For ‘file’ resource, this would be the name of the file (eg:ticket_example.drl). For ‘db’ resource, this is the Drools Rule key
- objList: list of objects that need to be put in session
Example
A simple Ticket processing system is available in the plugin. This example shows how tickets are processed based on their subscription plan.
Run the example: http://localhost:8080/your_app/drools/example
Your console output should be:
Start processing Ticket # 3
Start processing Ticket # 2
Start processing Ticket # 1
Firing rule Bronze Priority for Ticket # 3
Firing rule Silver Priority for Ticket # 2
Firing rule Gold Priority for Ticket # 1
Firing rule Special Discount for Ticket # 1
Display on your browser should be:
Tickets due for processing:
Ticket #1: Customer[Name:Jack, Subscription:Gold, Discount:0%] Status[New]
Ticket #2: Customer[Name:Tom, Subscription:Silver, Discount:0%] Status[New]
Ticket #3: Customer[Name:Bill, Subscription:Bronze, Discount:0%] Status[New]
Firing rules now ...
Tickets after processing:
Ticket #1: Customer[Name:Jack, Subscription:Gold, Discount:5%] Status[Escalate]
Ticket #2: Customer[Name:Tom, Subscription:Silver, Discount:0%] Status[Escalate]
Ticket #3: Customer[Name:Bill, Subscription:Bronze, Discount:0%] Status[Pending]
Tuesday, July 29, 2008
Grails 1.0.3 upgrade issues
Recently, we upgraded our application running in Grails 1.0.1 to 1.0.3. Just to give you an idea, the application is pretty complicated involving multiple data sources, complex hibernate mappings with JPA annotations, legacy system, linking tons of external services etc. We had to overcome few significant hurdles to get our application to run in Grails 1.0.3.
1. Update hibernate-entitymanager.jar (3.3.2 GA) in/lib
2. Add hibernate-validator.jar (3.0.0 GA) in/lib. Grails 1.0.1 did not require this jar
3. Changes to g:render taglib.
used to work in Grails 1.0.1 template file in _templates/my_template.gsp under grails-app/views/mycontroller/. Now, for Grails 1.0.3 you need to have the template in template/_my_template.gsp.
4. Issues with domain properties.
my_domain.properties = another_domain.properties. This doesn’t work anymore in Grails 1.0.3, at least in some cases. Had to manually copy properties.
5. There are definitely issues with complex hibernate mapping involving legacy system. A particular hibernate relationship was throwing javax.persistence.PersistenceException with Grails 1.0.3. We couldn’t figure out the actual reason, had to make the relationship transient and manually manage it.
6. Changes to taglib g:actionSubmitImage.
The following works fine in Grails 1.0.1.
In Grails 1.0.3, you will need to change to
7. Issues with blank spaces in directories in Windows:
This is the nasty one and can drive you crazy. You may have problems running the app or executing tests. Errors such as java.util.zip.ZipException: The system cannot find the path specified or error trying to scan etc could be noticed. These errors are due to blank spaces in JAVA_HOME(c:\Program Files\..) and user.home (c:\Documents and Settings\..). To fix this:
* Re-install Java in directory without blank spaces (c:\Java\..)
* By default, the project is built in ${user.home}/.grails. We can change this location by specifying the user.home property in command-line such as grails -Duser.home=c:\ run-app or grails -Duser.home=c:\ test-app
Grails 1.0.3 seems much faster than Grails 1.0.1 and is probably worth the trouble.
1. Update hibernate-entitymanager.jar (3.3.2 GA) in
2. Add hibernate-validator.jar (3.0.0 GA) in
3. Changes to g:render taglib.
4. Issues with domain properties.
my_domain.properties = another_domain.properties. This doesn’t work anymore in Grails 1.0.3, at least in some cases. Had to manually copy properties.
5. There are definitely issues with complex hibernate mapping involving legacy system. A particular hibernate relationship was throwing javax.persistence.PersistenceException with Grails 1.0.3. We couldn’t figure out the actual reason, had to make the relationship transient and manually manage it.
6. Changes to taglib g:actionSubmitImage.
The following works fine in Grails 1.0.1.
In Grails 1.0.3, you will need to change to
7. Issues with blank spaces in directories in Windows:
This is the nasty one and can drive you crazy. You may have problems running the app or executing tests. Errors such as java.util.zip.ZipException: The system cannot find the path specified or error trying to scan
* Re-install Java in directory without blank spaces (c:\Java\..)
* By default, the project is built in ${user.home}/.grails. We can change this location by specifying the user.home property in command-line such as grails -Duser.home=c:\ run-app or grails -Duser.home=c:\ test-app
Grails 1.0.3 seems much faster than Grails 1.0.1 and is probably worth the trouble.
Thursday, June 12, 2008
Hosting Services for Grails Application
I was looking for a hosting service for running my Grails and other Spring enabled Java applications. I was looking at both shared and virtual private servers. My Budget was $20.
GoDaddy: I was already using GoDaddy hosting services with Java support for about $7/month. While they claim to support Java applications, in practice it can run only simple ‘Hello World’ applications. They do not allow Spring/Hibernate enabled applications. So, this is not an option.
EATJ: They have a free service that allows you to upload war, restart your Tomcat. (But the server is automatically shutdown every 6 hours). This run Grails application. The Basic service with no server shutdown is $10/month. They offer only 64MB. What can you run with only 64MB? The next level of service offers 128MB and costs $20/month. You can upload your WAR, restart server. Nothing more.
RimuHosting: Offers VPS and runs Grails applications. Costs $20/month for 96MB. Lot of features, good support. I have also read good feedback on their service.
EAPPS: Offers VPS and supports Grails applications. Costs $20/month for 288MB. Tons of features - Tomcat, MySQL, Ruby on Rails, Subversion, Wordpress, ssh/sftp, Apache, mod_jk, mod_proxy, root access etc. I dumped GoDaddy and have been using eapps for last few months. Great customer service.
My recommendation is eapps.
GoDaddy: I was already using GoDaddy hosting services with Java support for about $7/month. While they claim to support Java applications, in practice it can run only simple ‘Hello World’ applications. They do not allow Spring/Hibernate enabled applications. So, this is not an option.
EATJ: They have a free service that allows you to upload war, restart your Tomcat. (But the server is automatically shutdown every 6 hours). This run Grails application. The Basic service with no server shutdown is $10/month. They offer only 64MB. What can you run with only 64MB? The next level of service offers 128MB and costs $20/month. You can upload your WAR, restart server. Nothing more.
RimuHosting: Offers VPS and runs Grails applications. Costs $20/month for 96MB. Lot of features, good support. I have also read good feedback on their service.
EAPPS: Offers VPS and supports Grails applications. Costs $20/month for 288MB. Tons of features - Tomcat, MySQL, Ruby on Rails, Subversion, Wordpress, ssh/sftp, Apache, mod_jk, mod_proxy, root access etc. I dumped GoDaddy and have been using eapps for last few months. Great customer service.
My recommendation is eapps.
Saturday, March 22, 2008
License management plugin for Grails application
I have been recently working on a plugin that provides ability to securely create, install and verify license for closed source grails applications. This plugin utilizes TrueLicense Library Collection (TLC). You can download the plugin here.
Installation
grails install-plugin
Usage
* Generate license file: grails generate-license
* Start app: grails run-app
* Instal/verify license at http://localhost:8080/your_app/license. If you try to access your app without installing license, you will be redirected to this page.
Components
* /plugins/license-0.1/etc/privateKey.store - private key file. This never gets included in your WAR. (You should generate your own private/public keys with keytool command. see tips section below)
* /plugins/license-0.1/etc/LicensePrivateConfig.properties - holds all necessary configuration to create a license such as issuer, holder, validity etc. Again not included in WAR
* /plugins/license-0.1/conf/publicCerts.store - public key file. This is included in WAR
* /plugins/license-0.1/conf/LicensePublicConfig.groovy - holds all necessary information required for the client. Included in WAR
* /plugins/license-0.1/controller/LicenseController - Install, verify license
* /plugins/license-0.1/services/LicenseService - Install, verify license
* /plugins/license-0.1/conf/LicenseFilter - defines which controllers, actions need to be protected.
Tips
* To generate private key:
keytool -genkey -alias privatekey -keystore privateKeys.store
* To generate public key
keytool -export -alias privatekey -file certfile.cer -keystore privateKeys.store
keytool -import -alias publiccert -file certfile.cer -keystore publicCerts.store
* The system preferences are stored in the registry in windows and file system (/etc/.java/) in Linux. You may need appropriate permissions to be able to do this.
Installation
grails install-plugin
Usage
* Generate license file: grails generate-license
* Start app: grails run-app
* Instal/verify license at http://localhost:8080/your_app/license. If you try to access your app without installing license, you will be redirected to this page.
Components
* /plugins/license-0.1/etc/privateKey.store - private key file. This never gets included in your WAR. (You should generate your own private/public keys with keytool command. see tips section below)
* /plugins/license-0.1/etc/LicensePrivateConfig.properties - holds all necessary configuration to create a license such as issuer, holder, validity etc. Again not included in WAR
* /plugins/license-0.1/conf/publicCerts.store - public key file. This is included in WAR
* /plugins/license-0.1/conf/LicensePublicConfig.groovy - holds all necessary information required for the client. Included in WAR
* /plugins/license-0.1/controller/LicenseController - Install, verify license
* /plugins/license-0.1/services/LicenseService - Install, verify license
* /plugins/license-0.1/conf/LicenseFilter - defines which controllers, actions need to be protected.
Tips
* To generate private key:
keytool -genkey -alias privatekey -keystore privateKeys.store
* To generate public key
keytool -export -alias privatekey -file certfile.cer -keystore privateKeys.store
keytool -import -alias publiccert -file certfile.cer -keystore publicCerts.store
* The system preferences are stored in the registry in windows and file system (/etc/.java/) in Linux. You may need appropriate permissions to be able to do this.
Wednesday, December 12, 2007
Picasa Google Gadget - Updated
Last year, I created a simple gadget to fetch my Picasa albums. Since then, I have received numerous requests to provide additional features and functionality. While I continued to support the gadget and provided simple enhancements, I couldn’t find time to look at the major ones. Finally, I did spend some time and I have just released an updated version with the following features:
If interested, check this out:
- Display random photos from Picasa albums at specified intervals
- Display description of the photo
- Auto width and height adjustment based on screen size
- Display private albums
- Display albums for your friends
- Complete player controls - play, pause, forward, rewind
If interested, check this out:
Subscribe to:
Posts (Atom)