query created in guvnor 5.3.0.final does not return expected results
by vadlam
I have created a query in guvnor 5.3 in a separate drl file as follows.
query "get total Documents created"
document : Document( )
end
I have several rules that create Documents as part of the ruleflow.
on the java side
ksession.fireAllRules(new RuleFilter()); // the rulefilter does not really
do anything except log the
//rules
executing
org.drools.runtime.rule.QueryResults results =
ksession.getQueryResults("get total Documents created");
System.out.println( "we have " + results.size() +"
Documents" );
I see that the returned results size is 0
but the following code returns the documents as expected.
Collection responseObjects = ksession.getObjects();
is there anything I am missing with respect to the query ? I use a ruleflow
. does the query need to be part of any of the ruleflowgroups within the
ruleflow ?
is there a way to know whether the query ran or not ?
--
View this message in context: http://drools.46999.n3.nabble.com/query-created-in-guvnor-5-3-0-final-doe...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 4 months
Declarative agenda final API
by Marcin Bednarek
Hello,
Looks like my previous post was not sent to mailing list bu only to nabble
forum so I am resending it.
I plan to use declarative agenda API: kcontext.blockActivation,
kcontext.unblockAllActivations, kcontext.cancelActivation.
In Drools documentation there is written that this API is highly
experimental:
*This feature is off by default and must be explicitly enabled, that is
because it is considered highly experimental for the moment and will be
subject to change.*
Could you please let me know in which version you plan to make declarative
agenda API, solution final?
Thanks,
Marcin
14 years, 4 months
java.lang.ArrayIndexOutOfBoundsException at Frame
by mujoko mujoko
Hi Drools Users,
I'm new member, Mujoko.
I got issue regarding my rules. Several times got exception when trying to
create KnowledgeSession. I used drools-core 5.3.0.Final and drools-compiler
5.3.0.Final.
java.lang.ArrayIndexOutOfBoundsException: -1
at org.mvel2.asm.Frame.merge(Frame.java:1373)
at org.mvel2.asm.Frame.merge(Frame.java:1350)
at org.mvel2.asm.MethodWriter.visitMaxs(MethodWriter.java:1282)
at
org.drools.rule.builder.dialect.asm.ClassGenerator$MethodDescr.write(ClassGenerator.java:480)
at
org.drools.rule.builder.dialect.asm.ClassGenerator.generateBytecode(ClassGenerator.java:50)
at
org.drools.rule.builder.dialect.asm.ASMEvalBuilder.createEvalBytecode(ASMEvalBuilder.java:63)
at
org.drools.rule.builder.dialect.asm.AbstractASMEvalBuilder.build(AbstractASMEvalBuilder.java:49)
at
org.drools.rule.builder.dialect.asm.AbstractASMEvalBuilder.build(AbstractASMEvalBuilder.java:15)
at
org.drools.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:65)
at org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:80)
at
org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:2289)
at
org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:822)
--
Mujoko
http://www.linkedin.com/in/mujoko
14 years, 4 months
unable to update the changes (guvnor rules) to application using changeset
by srinivasasanda
Hi All
I am not able to get the updated rules still i used change set , can any one
plz sort out this problem
The source code is
using this program i am printing the rule name in package for every five
seconds.
for first time it prints rule names in package, after that packages are not
available in kbase...
import org.drools.KnowledgeBase;
import org.drools.KnowledgeBaseFactory;
import org.drools.agent.KnowledgeAgent;
import org.drools.agent.KnowledgeAgentFactory;
import org.drools.builder.KnowledgeBuilder;
import org.drools.builder.KnowledgeBuilderError;
import org.drools.builder.KnowledgeBuilderErrors;
import org.drools.builder.KnowledgeBuilderFactory;
import org.drools.builder.ResourceType;
import org.drools.definition.KnowledgePackage;
import org.drools.io.ResourceChangeScannerConfiguration;
import org.drools.io.ResourceFactory;
import org.drools.logger.KnowledgeRuntimeLogger;
import org.drools.logger.KnowledgeRuntimeLoggerFactory;
import org.drools.runtime.StatefulKnowledgeSession;
import org.drools.runtime.StatelessKnowledgeSession;
import org.drools.agent.*;
public class ChangeSet1
{
private ChangeSet1()
{
}
public static synchronized ChangeSet1 start()
{
try{
if ( _instance == null)
{
_instance = new ChangeSet1();
String url="file:H:\\RuleFiles\\ChangeSet.xml";
_kagent = KnowledgeAgentFactory.newKnowledgeAgent( "MyAgent" );
System.out.println("after creating kagent");
_kagent.applyChangeSet(ResourceFactory.newUrlResource(url));
System.out.println("after apply change set");
//Create Knowledge Base
_kbase = _kagent.getKnowledgeBase();
ResourceChangeScannerConfiguration sconf=
ResourceFactory.getResourceChangeScannerService().newResourceChangeScannerConfiguration();
sconf.setProperty("drools.resource.scanner.interval", "5");
ResourceFactory.getResourceChangeScannerService().configure(sconf);
ResourceFactory.getResourceChangeNotifierService().start();
ResourceFactory.getResourceChangeScannerService().start();
System.out.println("After starting Notification service");
}
}catch(Exception e)
{
System.out.println(e.getMessage());
}
return _instance;
}
private static KnowledgeAgent _kagent;
private static ChangeSet1 _instance;
private static KnowledgeBase _kbase=null;
private static StatelessKnowledgeSession _ksession=null;
public static void main(String[] args)
{
int counter=0;
try
{
System.out.println("Before rule engine start ");
ChangeSet1.start();
System.out.println("After rule engine start ");
do{
_kbase = _kagent.getKnowledgeBase();
Collection<KnowledgePackage> kpackages =
_kbase.getKnowledgePackages();
System.out.println("no of packages"+kpackages.size());
for(KnowledgePackage kpackage : kpackages)
{
for(org.drools.definition.rule.Rule rule1
:kpackage.getRules())
{
String packname= rule1.getPackageName();
String rulename=rule1.getName();
System.out.println("This is : "+packname+" Packages and
RuleName is " +rulename);
}
}
counter++;
try{
Thread.sleep(10000);
}catch (InterruptedException e){
System.out.println("Sleep exception occured");
}
}while(counter < 10000);
}catch (Throwable t){
t.printStackTrace();
}
}
}
This is my changeset.xml
<change-set xmlns='http://drools.org/drools-5.0/change-set'
xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
xs:schemaLocation='http://drools.org/drools-5.0/change-set
http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/...'
>
<add>
<resource
source='http://localhost:8080/guvnor-5.3.0.Final-jboss-as-5.1/rest/packages/prici...'
type='DRL' />
<resource
source='http://localhost:8080/guvnor-5.3.0.Final-jboss-as-5.1/rest/packages/searc...'
type='DRL' />
</add>
</change-set>
Output:--
Before rule engine start
after creating kagent
after apply change set
After starting Notification service
After rule engine start
no of packages2
This is : pricing Packages and RuleName is ageprice
This is : pricing Packages and RuleName is incomeprice
This is : pricing Packages and RuleName is cpvprice
This is : search Packages and RuleName is age
This is : search Packages and RuleName is income
This is : search Packages and RuleName is cpv
no of packages0
<after updating package count is 0 so no rules>
no of packages0
no of packages0
--
View this message in context: http://drools.46999.n3.nabble.com/unable-to-update-the-changes-guvnor-rul...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 4 months
Building Guvnor - Required Java version?
by Stephen Masters
Hi folks,
Having grabbed Guvnor from github and switched to the 5.3.1.Final tag, I'm getting test failures when in the IDE project. Now, I' am admittedly building with Java 1.7.0_02, so that may be the issue. Has anybody else tried building with Java 7? Did you experience success/failure in doing so?
I'm just wondering whether I need to install a version of Java 6 just to get this building or whether the issue is likely to be something else.
Many thanks,
Steve
p.s. Build summary below...
[INFO] Reactor Summary:
[INFO]
[INFO] Guvnor multiproject ............................... SUCCESS [0.933s]
[INFO] Guvnor repository connector multiproject .......... SUCCESS [0.126s]
[INFO] Guvnor repository connector JCR ................... SUCCESS [2.029s]
[INFO] Guvnor repository connector Jackrabbit ............ SUCCESS [1.132s]
[INFO] Guvnor repository connector ModeShape ............. SUCCESS [1.301s]
[INFO] Guvnor repository ................................. SUCCESS [8:22.963s]
[INFO] Drools and jBPM IDE common ........................ FAILURE [15.296s]
[INFO] Guvnor web application ............................ SKIPPED
[INFO] Guvnor bulk importer .............................. SKIPPED
[INFO] Guvnor examples ................................... SKIPPED
14 years, 4 months