I am trying to create rules in java by using the Fluent Api. Actually I have successfully created rules in a way I like, however I could not find a way to create a rule without adding a package name.
Java Code:
PackageDescr pkg = DescrFactory.newPackage()
.name("org.drools.example")
.newRule().name("Xyz")
.attribute("ruleflow-grou","bla")
.lhs()
.and()
.pattern("Foo").id( "$foo", false ).constraint("bar==baz").constraint("x>y").end()
.not().pattern("Bar").constraint("a+b==c").end().end()
.end()
.end()
.rhs( "System.out.println();" ).end()
.getDescr();
DrlDumper dumper = new DrlDumper();
String drl = dumper.dump(pkg);
DRL File:
package org.drools.example ---> I do not want this to be included
rule "Xyz"
ruleflow-grou bla
when
(
$foo : Foo( bar==baz, x>y ) and
not(
Bar( a+b==c ) ) )
then
System.out.println();
end
Thanks in advance.
Note: I am using Drools 7.3.0 which was installed default by eclipse