Drools difference between type=drl and type=pkg

665 Views Asked by At

I'm new to using drools and guvnor

I have deployed a tomcat server that serves business rules

The problem is that I get two different answers if I use code that goes against the server with type DRL or with PKG

If I go against the server with DRL type I get one result

http://localhost:8180/guvnor/org.drools.guvnor.Guvnor/package/PkgDinamicoBV/LATEST.drl

property name="type" value="DRL"

If I go against the server with PKG type I get a different

http://localhost:8180/guvnor/org.drools.guvnor.Guvnor/package/PkgDinamicoBV/LATEST

property name="type" value="PKG"

I don't understand what I have to do to get both ways to access the server to produce the same result

I have build the package in guvnor so I expected to get the same result in both ways to access my local server

Many thanks for your help

Simar

2

There are 2 best solutions below

1
laune On

DRL and PKG are file types for two different things. Compared to the programming language C, they correspond to .c and .o.

More accurately, a DRL file is the Drools Rule Language text which can be written with a text editor or is generated from your input in the Drools IDE, Guvnor or its successor in 6.x. A DRL file must be compiled by the Drools DRL compiler used in the Builder; the result is a (binary) Rule Package file, the .PKG.

For creating a Rule Base and from it, in turn, a session, you may use the rule package.

0
Parul Singh On

You can always access the .drl file generated by guvnor. Click on the "view source" option after selecting the package you created in Guvnor webapp.

Here you can see how many rules have actually been written. Hope it helps..:)