<< ORA-00911: invalid character | Home | What is this dynamic language hype all about? >>

visual rules 4: maven integration

visual rules finally integrates with maven

In my point of view one of the main drawbacks of visual rules 3 was it's missing maven integration. Now that a beta version of visual rules 4 is available I wanted to see if the better JDT integration finally allows me to integrate visual rules in a maven build process - without the need for ugly hacks...

I've created the following project structure with the upper projects depending on the lower ones.

  • myproject-service (service implementation)
  • myproject-rules (business rules)
  • myproject-api (value objects)

Before beeing able to run the example project you need to install the visual rules runtime library in your repository. The file can be found here \Visual Rules 4.0\eclipse\plugins\de.visualrules.runtime_4.0.0.v20080118-1512\visualrules-runtime.jar. Now run Now you are ready to try the example project. Run mvn eclipse:eclipse in the root directory of the extracted archive and mvn will generate the project files for you. Note how easy it is to convert a project to "visual rules project" - the correct nature and builder is all you need:

Now open the "library" ruletree in the myproject-rules project with visual rules. As you can see the ruletree is pretty basic: looping through a list of books it sorts out all books that have been written by a favourite author.

After generating the sourcecode with visual rules we are able to compile our myproject-service project and run it's test. This is all because visual rules is using all the standard JDT mechanics: standard source folders and classpath settings.

The API for generating source code from visual rules is currently not public, therefore I've not yet made any attemps to let maven handle this. I'll revisit this once visual rules 4 is final. Another cool improvement would be the introduction of a JdbcTemplate style wrapper around the rule execution api - so that the user does not have to worry about session close or exception handling.

In conclusion one can say that due to the stronger JDT integration visual rules 4 itself integrates more closely with maven2 - something I was waiting for really long...

Click here to download the three example projects.



Re: visual rules 4: maven integration

How did you get vr4 to generate code into /src/main/java/ intead of /vr-srcgen/?

Re: visual rules 4: maven integration

you can change the source folder here: Open Rule integration perspective, open settings view of rule model, change the folder in the section "Java Code Generator"

Add a comment Send a TrackBack