Nicozan-Blog

Knowledge Seeking

Drools-Guvnor – Spring Context Feature February 3, 2011

Filed under: Drools — nicozan @ 5:00 pm

Introduction

Drools-Guvnor has now the possibility to create, modify and delete Spring Context Files. This new feature allows you to define Drools Knowledge Bases, Knowledge Sessions, Knowledge Agents and Common Spring Beans inside your Spring Context File.

How to Create a Spring Context in Guvnor

You have to go to the Knowledge Bases Tag on the Left Menu and select:
Create New —> New Spring Context.
Like any other asset you will have to give it a name and set in which package it’ll be saved.

It is time to Edit our Spring Context

The next image shows the SpringContext Editor. You will be able to insert new tags in this XML file, by positioning your text cursor in the place where you would like to insert this new tag and then click on one of the options on the left palette. (KSession, KBase, Node, KAgent, Spring Bean)

Another feature of the SpringContext editor is that we can validate our XSD file against the XSD file implicitly referred in the Spring Context File. All you have to do is go to : Source—> Validate.

Adding New Buttons to our Palette

If you want to add new buttons to your palette, Drools Guvnor allows you to do this through a Properties File. The name of the file is springContextElements.properties, it’s located in the path:$GUVNOR_HOME/WEB-INF/Clases/springContextElements.properties.

Downloading The Spring Context Files

Each spring context is exposed through an URL. These URLs could be found at the bottom part of the Package editor where the context files are defined.

Stay tuned for updates related to Drools… ;), this new feature is now in the trunk, in Drools 5.2.0.M1. 🙂

Advertisements
 

One Response to “Drools-Guvnor – Spring Context Feature”

  1. […] feature will be available in Drools 5.2.0M1. If you want to get more information, please read Nicola’s post. GA_googleAddAttr("AdOpt", "1"); GA_googleAddAttr("Origin", "other"); […]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s