JBoss.orgCommunity Documentation

Eclipse Guvnor Tools Reference Guide

Olga Chikvina

Version: 3.2.1.GA


1. Introduction
1.1. Guvnor Tools Key Features
1.2. What is Guvnor Tools?
1.3. Requirements and Installation
2. Tasks
2.1. Creating a New Guvnor Connection
2.2. Getting Local Copies of Guvnor Files
2.3. Managing Guvnor Resources
2.3.1. Update Action
2.3.2. Add Action
2.3.3. Commit Action
2.3.4. Show History Action
2.3.5. Compare with Version Action
2.3.6. Switch to Version Action
2.3.7. Delete Action
2.3.8. Disconnect Action
3. Reference
3.1. Guvnor Repository Exploring Perspective
3.2. Guvnor Connection Wizard
3.3. Resource from Guvnor Wizard
3.4. Guvnor Repositories View
3.5. Guvnor Resource History View
3.6. Guvnor Preferences
3.6.1. Guvnor Repository Connection Preferences
3.6.2. Local Guvnor Repository Resource Decoration Preferences
4. Summary
4.1. Other relevant resources on the topic

The purpose of this document is to describe briefly the functionality present in the Eclipse Guvnor Tools (EGT) for Drools 5. While not intended as a comprehensive reference, there should be enough detail included for early adopters using these tools.

The table below lists the key features of Guvnor Tools:

Guvnor Tools is a part of the JBoss Tools project. Thus to get started with Guvnor Tools, you should have the following:

To deploy JBoss Server with the Guvnor repository, you should download Drools Guvnor. When downloading you may choose either web based Guvnor to deploy to your JBoss Server or Standalone Guvnor with JBoss AS.

If you use JBoss AS 5 and Guvnor Tools doesn't work when deployed to the server, you should perform the following steps to get Guvnor Tools running:

  1. Remove the JBoss Security libraries (authorization-spi-2.0.2.CR6.jar, identity-*, acl-spi-2.0.2.CR6.jar) from drools WAR file (not the app server itself). The JBoss Security libraries are provided in AS 5.

  2. Remove the JAXP libraries (xercesImpl-2.8.0.jar, xml-apis-2.*)

  3. Remove the EL libraries (el-*)

When these steps have been performed, Guvnor should operate as normal. During deployment, you would see the following exception in the log which indicates that the experimental JBoss Security based ACL integration has defined some EJB3/JPA features in guvnor that have not been configured.

ERROR [AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=#ACL state=Create
java.lang.RuntimeException: Specification violation [EJB3 JPA 6.2.1.2] - You have not defined a non-jta-data-source 
for a RESOURCE_LOCAL enabled persistence context named: ACL            
    

This chapter provides an overview of the functionality provided by the Guvnor Tools.

As mentioned in Chapter 1, Introduction, the main purpose of the EGT™ is to allow development using resources held in a Guvnor repository. The first task is to make a connection to a Guvnor repository. This is handled by the Connection Wizard (see Section 3.2, “Guvnor Connection Wizard”).

There are two methods of getting local copies of Guvnor repository resources:

When local copies of Guvnor repository files are created, the EGT sets an association between the local copy and the master file in the repository. This information is kept in the (normally) hidden .guvnorinfo folder in the local project and, like all metadata, should not be changed by end users.


The association allows for operations such as update and commit in synchronization with the master copy held in the Guvnor repository.

The EGT decorates local resources associated with Guvnor repository master copies. This decoration appears in Eclipse views conforming to the Eclipse Common Navigator framework, such as the Eclipse Resource Navigator and the Java Package Explorer. In the image above you can see the Dummy rule.drl file with the decoration in the Resource Navigator. The Guvnor icon decorator is on the top right of the file image, and the Guvnor revision details are appended to the file name. The location of these can be changed in the Local Guvnor Repository Resource Decoration Preferences (see the Section 3.6.2, “Local Guvnor Repository Resource Decoration Preferences” section).

Here we see that the Dummy rule.drl file is associated with a Guvnor repository resource, and the local copy is based on revision 0, with a 02-10-2008, 4:21:53 date/time stamp. However, the file Sample.drl is not associated with a Guvnor repository file. Further details about the association can be found in the standard Eclipse properties page, accessed via the Properties option in the context menu:


The EGT adds a property page to the standard Eclipse properties dialog, the contents of which are shown above. It displays the specific Guvnor repository, the location within the repository, the version (date/time stamp) and the revision number.

The EGT provides a number of actions (available through the Guvnor context menu on files) for working with files, both those associated with Guvnor repository master copies and those not associated. The actions are:

Each of these actions is described below.

This chapter includes detailed reference information about Views and Wizards used to manage Guvnor Tools.

The Guvnor Repository Exploring perspective contains two views supplied by EGT, described in Section 3.4, “Guvnor Repositories View” and Section 3.5, “Guvnor Resource History View”, that will be the center of most interactions with Guvnor. Eclipse standard views such as Properties and Resource Navigator are also useful.

While each of these views can be opened and positioned independently within an Eclipse workbench, the Guvnor perspective provides a convenient method for displaying a common layout. In the Eclipse workbench menu, select WindowOpen PerspectiveOther to view the perspective list:


Selecting the Guvnor Repository Exploring option will open the Guvnor perspective.

The Guvnor Connection wizard appears in a number of places within the EGT (as detailed below), but in this section we will cover only the two most basic entry points.

The Guvnor Connection wizard can be started in the following ways:

Choosing either of these will start the Guvnor Connection wizard.


Default values appear in the Location, Port and Repository fields (See Chapter 3, Reference for details about on changing these default values). Of course, any of these fields can be edited by editing the corresponding text box. Drag-and-drop or paste into the Location field a typical Guvnor repository URL such as:

http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/webdav

This results in the URL being parsed into the respective fields as well. The authentication information (user name and password) can optionally be stored in the Eclipse workbench's key-ring file based on the selection of Save user name and password.

Note:

If the authentication information is not stored in the key-ring, then the EGT uses a session authentication, what means that the credentials supplied are only used during the lifetime of the Eclipse workbench instance.

If authentication information is not stored in the key-ring, or the authentication information (key-ring or session) is not valid, the EGT will prompt for the authentication information once it has to access the Guvnor repository.

If authentication fails, the EGT will retry once and then issue an authentication failure error.

Tip:

If an authentication failure error occurs, you can retry the same operation and supply different authentication information.

Note that the EGT calls the Guvnor repository at various times, such as when it is determining if any resource updates are available. Thus if you use session authentication, the authentication dialog will appear at different times during the Eclipse workbench session, depending on what actions you take. For ease of use, we recommend saving the authentication information in the Eclipse key-ring.

Note:

The Eclipse key-ring file is distinct from key-ring files found in some platforms such as Mac OS X and many forms of Linux. Thus, sometimes if you access a Guvnor repository outside the EGT, the key-ring files might become outdated, and you will be unexpectedly prompted for your credentials in Eclipse. This is nuisance, but in this case you can simply re-enter the appropriate username and password.

The Guvnor Repositories view contains tree structures representing the contents of Guvnor repositories.


You can perform the following actions under the resources in the Guvnor Repositories view:

Drill-down is useful when working with deeply nested tree structures, and when you wish to concentrate on only a single branch of the tree. For example, drilling into the defaultPackage node changes the tree view to:


Clicking on the Go Home button ( ) or selecting Go Home in the context menu returns the tree to the top-level structure shown in the previous picture above.

There are a number of operations that can be performed on Guvnor repository files. Selecting a file in the Guvnor repository causes the Eclipse Properties view to display the details of that file:


The EGT provides a preference page in the Guvnor category:


The preferences cover two categories:

  • Guvnor repository connections

  • Local Guvnor repository resource decorations.

As stated at the beginning of this document, the key goal of the EGT is to provide a way to interact with Guvnor repository resources in a local Eclipse workspace. While clearly there is a lot more that could be done, and no doubt there will be aspects of the current tooling that require revision going forward, we feel that the current state of the EGT is sufficient for the major use cases.