Not able to get the knowledgeBase from web application
by jilani
Hi,
I am working with Drools 5.2.0 final and Guvnor also the same version.
application server: GateIn-3.1.0-FINAL-jbossas
I have uploaded a java model and defined a rule using that model. I did
validation of the package and build also.
After that in my web application, when I am trying to access the
knowledgebase I am getting error in server console as mentioned below.
21:22:28,450 INFO [STDOUT] 1
21:22:28,629 INFO [STDOUT] 2
21:22:28,638 INFO [STDOUT] 3
21:22:28,834 INFO [STDOUT] 4
21:22:28,840 INFO [STDOUT] 5
21:22:28,844 INFO [STDOUT] 6
21:22:28,886 INFO [STDOUT] 7
21:22:28,890 INFO [STDOUT] 8
21:22:28,891 INFO [STDOUT] kbase:org.drools.impl.KnowledgeBaseImpl@66c790c9
kag
ent: org.drools.agent.impl.KnowledgeAgentImpl@37f2b0d6
21:22:29,158 INFO [STDOUT] INFO 26-07 21:22:29,157
(NilAuthenticator.java:auth
enticate:35) All users are guests.
21:22:29,163 INFO [STDOUT] INFO 26-07 21:22:29,163
(RepositoryServlet.java:all
owUser:114) null authenticated for rest api
21:22:29,164 INFO [STDOUT] INFO 26-07 21:22:29,164
(PackageDeploymentServlet.j
ava:execute:141) PackageName: sam
21:22:29,164 INFO [STDOUT] INFO 26-07 21:22:29,164
(PackageDeploymentServlet.j
ava:execute:142) PackageVersion: LATEST
21:22:29,165 INFO [STDOUT] INFO 26-07 21:22:29,165
(PackageDeploymentServlet.j
ava:execute:143) PackageIsLatest: true
21:22:29,165 INFO [STDOUT] INFO 26-07 21:22:29,165
(PackageDeploymentServlet.j
ava:execute:144) PackageIsSource: false
21:22:29,172 INFO [STDOUT] error...
21:22:29,173 ERROR [STDERR] java.lang.NullPointerException
21:22:29,174 ERROR [STDERR] at
org.drools.agent.impl.KnowledgeAgentImpl.proc
essChangeSet(KnowledgeAgentImpl.java:223)
21:22:29,175 ERROR [STDERR] at
org.drools.agent.impl.KnowledgeAgentImpl.appl
yChangeSet(KnowledgeAgentImpl.java:189)
21:22:29,175 ERROR [STDERR] at
org.drools.agent.impl.KnowledgeAgentImpl.appl
yChangeSet(KnowledgeAgentImpl.java:174)
21:22:29,175 ERROR [STDERR] at
org.apache.jsp.index1_jsp._jspService(index1_
jsp.java:124)
21:22:29,175 ERROR [STDERR] at
org.apache.jasper.runtime.HttpJspBase.service
(HttpJspBase.java:70)
21:22:29,175 ERROR [STDERR] at
javax.servlet.http.HttpServlet.service(HttpSe
rvlet.java:717)
21:22:29,176 ERROR [STDERR] at
org.apache.jasper.servlet.JspServletWrapper.s
ervice(JspServletWrapper.java:369)
21:22:29,176 ERROR [STDERR] at
org.apache.jasper.servlet.JspServlet.serviceJ
spFile(JspServlet.java:322)
21:22:29,176 ERROR [STDERR] at
org.apache.jasper.servlet.JspServlet.service(
JspServlet.java:249)
21:22:29,176 ERROR [STDERR] at
javax.servlet.http.HttpServlet.service(HttpSe
rvlet.java:717)
21:22:29,176 ERROR [STDERR] at
org.apache.catalina.core.ApplicationFilterCha
in.internalDoFilter(ApplicationFilterChain.java:290)
21:22:29,176 ERROR [STDERR] at
org.apache.catalina.core.ApplicationFilterCha
in.doFilter(ApplicationFilterChain.java:206)
21:22:29,177 ERROR [STDERR] at
org.jboss.web.tomcat.filters.ReplyHeaderFilte
r.doFilter(ReplyHeaderFilter.java:96)
21:22:29,180 ERROR [STDERR] at
org.apache.catalina.core.ApplicationFilterCha
in.internalDoFilter(ApplicationFilterChain.java:235)
21:22:29,180 ERROR [STDERR] at
org.apache.catalina.core.ApplicationFilterCha
in.doFilter(ApplicationFilterChain.java:206)
21:22:29,180 ERROR [STDERR] at
org.apache.catalina.core.StandardWrapperValve
.invoke(StandardWrapperValve.java:235)
21:22:29,180 ERROR [STDERR] at
org.apache.catalina.core.StandardContextValve
.invoke(StandardContextValve.java:191)
21:22:29,180 ERROR [STDERR] at
org.jboss.web.tomcat.security.SecurityAssocia
tionValve.invoke(SecurityAssociationValve.java:190)
21:22:29,181 ERROR [STDERR] at
org.jboss.web.tomcat.security.JaccContextValv
e.invoke(JaccContextValve.java:92)
21:22:29,181 ERROR [STDERR] at
org.jboss.web.tomcat.security.SecurityContext
EstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
21:22:29,181 ERROR [STDERR] at
org.jboss.web.tomcat.security.SecurityContext
EstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
21:22:29,181 ERROR [STDERR] at
org.apache.catalina.core.StandardHostValve.in
voke(StandardHostValve.java:127)
21:22:29,181 ERROR [STDERR] at
org.apache.catalina.valves.ErrorReportValve.i
nvoke(ErrorReportValve.java:102)
21:22:29,182 ERROR [STDERR] at
org.jboss.web.tomcat.service.jca.CachedConnec
tionValve.invoke(CachedConnectionValve.java:158)
21:22:29,182 ERROR [STDERR] at
org.apache.catalina.core.StandardEngineValve.
invoke(StandardEngineValve.java:109)
21:22:29,182 ERROR [STDERR] at
org.apache.catalina.connector.CoyoteAdapter.s
ervice(CoyoteAdapter.java:330)
21:22:29,182 ERROR [STDERR] at
org.apache.coyote.http11.Http11Processor.proc
ess(Http11Processor.java:829)
21:22:29,182 ERROR [STDERR] at
org.apache.coyote.http11.Http11Protocol$Http1
1ConnectionHandler.process(Http11Protocol.java:598)
21:22:29,183 ERROR [STDERR] at
org.apache.tomcat.util.net.JIoEndpoint$Worker
.run(JIoEndpoint.java:447)
21:22:29,183 ERROR [STDERR] at java.lang.Thread.run(Thread.java:662)
-------------
the code snippet for above exception
System.out.println("1");
// knowledge base configuration
KnowledgeBaseConfiguration kbaseConf = KnowledgeBaseFactory
.newKnowledgeBaseConfiguration();
System.out.println("2");
kbaseConf.setOption(EventProcessingOption.STREAM);
System.out.println("3");
// knowledge base
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(kbaseConf);
System.out.println("4");
KnowledgeAgentConfiguration kagentConf = KnowledgeAgentFactory
.newKnowledgeAgentConfiguration();
System.out.println("5");
// enable incremental knowledge base build
kagentConf.setProperty("drools.agent.newInstance", "false");
System.out.println("6");
KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent(
"demoAgent", kbase, kagentConf);
System.out.println("7");
Resource changeset = null;
changeset =
ResourceFactory.newUrlResource("http://127.0.0.1:8080/guvnor/org.drools.guvnor.Guvnor/package/demo/LATEST...");
System.out.println("8");
System.out.println("kbase:"+kbase+" kagent: "+kagent);
*kagent.applyChangeSet(changeset);*
System.out.println("9");
System.out.println("kbase:"+kbase+" kagent: "+kagent);
kagent.dispose();
System.out.println("readKnowledgeBase() at end............");
------
changeset file content
<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://127.0.0.1:8080/guvnor/org.drools.guvnor.Guvnor/package/demo/LATEST'
type='PKG' basicAuthentication='enabled' username='admin' password='admin'
/>
</add>
</change-set>
----------
I am able to get the knowledgebase using java application, but I am not able
to get the knowledgebase from web application.
please suggest me, what could be the reason for this and how to resolve
this.
--
View this message in context: http://drools.46999.n3.nabble.com/Not-able-to-get-the-knowledgeBase-from-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 7 months
Call for Demos: RuleML2011 - 5th InternationalRule Challenge
by Adrian Paschke
Latest News
====================================================================*
* RuleML2011@BRF - 5th International Rule Challenge *
* Nov 4th *
* Westin Diplomat, Ft Lauderdale, Florida *
* http://2011.ruleml.org/america/?page_id=126 *
====================================================================*
* Call for Demos - Submission Deadline - Sept. 2nd, 2011 *
* New categories in the Challenge with prestigious prizes *
* Demo papers published as CEUR proceedings *
* 15% RuleML2011@BRF Partner discounts - see registration page *
* http://2011.ruleml.org/america/ *
* http://www.businessrulesforum.com/register.php *
*********************************************************************
Overview and Aim
======================================================
The RuleML2011@BRF Challenge is one of the highlights at RuleML2011@BRF
Conference.The RuleML2011@BRF Challenge is dedicated to practical
experiences
with rule-oriented applications. In particular, submissions of benchmarks
/ evaluations, demos, case studies / use cases, experience reports, best
practice solutions (e.g. design patterns, reference architectures, models),
rule-based implementations / tools / applications, demonstrations of
engineering methods, implementations of rule standards (e.g. RuleML, RIF,
SBVR, PRR, rule-based Event Processing languages, BPMN+rules, BPEL+rules,
...), rules + industrial standards (e.g. XBRL, MISMO, Accord, ...), and
industrial problem statements are particularly encouraged.
Key themes of the RuleML2011@BRF Challenge include the following:
* Demos related to the RuleML2011@BRF Track Topics
* Extensions and implementations of rule standards: W3C RIF, RuleML,
SBVR, ...
* Editing environments and IDEs for Web rules
* Benchmarks and comparison results for rule engines
* Distributed rule bases and rule services
* Reports on industrial experience about rule systems
A dedicated track of RuleML2011@BRF Challenge will be focused on the theme:
**Combining Rules, Objects, and Ontologies: Implementations and
Applications**
- Loose/tight integrations of rules and knowledge bases
- Knowledge Modelling and Reasoning
- Real cases and practical experiences
Ideally, demos submitted to the Challenge track should tackle knowledge-rich
domain problems. The proposed solution should address such problem using a
combination of rule-based modelling and semantic knowledge-based modelling.
Solutions ranging from loosely coupled hybrid systems (i.e. where different
frameworks are put together), to unified homogeneous architectures (i.e.
where
a unified model / semantics, within a single framework, is proposed) will be
of great interest for the special track.
Prizes will be awarded to the two best applications from the main focus
theme
and for the all categories. All accepted demos will be presented in a
special
Challenge Session.
Submission
======================================================
The submission is composed of two parts:
- open-source or commercial demo
- demo papers describing research, implementation, and technical details of
your submission.
Submissions to the Rules Challenge 2011 consist of a demo paper of 4-8
pages,
describing the demo show case, and a link to the demo/show case, e.g. a
project site, an online demonstration, a presentation about the
demonstration,
or a download site for the demonstration.
Demo and papers submission website:
https://www.easychair.org/conferences/?conf=ruleml2011challenge
Please upload all demo papers submissions as PDF files in LNCS format
(http://www.springer.de/comp/lncs/authors.html).
To ensure high quality, submitted papers will be carefully peer-reviewed
according to the evaluation criteria indicated below.
To better disseminate your work, please also udpate your demo in the systems
submission website with a brief abstract presentation:
http://2011.ruleml.org/america/?page_id=184
Challenge Evaluation Criteria
======================================================
Submissions to the RuleML2011@BRF Challenge general Track will be evaluated
according to the following criteria:
- clear exposition of the objectives, outcomes, benefits for going beyond
the
state of the art in the application domain (25%)
- demos should demonstrate a good level of effectiveness to manage complex
rules according to statistical/analytical/benchmarking evaluations (25%)
- demos have to demonstrate the results with a concrete example balancing
conciseness and completeness (25%)
- demos should preferably (but not necessarily) be embedded into a web-based
or distributed environment (15%)
- demos should pay attention to end-user interactions, providing an adequate
and usable interface that favors a concrete usage of the application
(10%).
Submissions focused on this year's special theme (Knowledge-Based
Applications
combining Rules and Ontologies) should show the potential and benefits of
combining rule-based reasoning and taxonomic/frame/description-logic
reasoning
in a realistic application. Demos submitted to the Special Theme will be
evaluated according to the following criteria:
- papers should clearly expose the objectives, outcomes, benefits for going
beyond the state of the art in the application domain (20%)
- demos should demonstrate a good level of integration or interaction
between
rules and ontologies (40%)
- demos should demonstrate their results with a simple but meaningful case
study, balancing conciseness and completeness (20%)
- demos should preferably be deployed in a web-based or distributed
environment where multiple nodes exchange information (10%)
- demos should pay attention to end-user interactions, providing an adequate
and usable interface that favors a concrete usage of the application
(10%).
Proceedings
======================================================
Authors are invited to submit original contributions of practical relevance
and technical rigor in the field, benchmarks, evaluations, experience
reports
and show/use case demonstrations of effective, practical, deployable
rule-based technologies or applications in web-distributed environments.
Papers must be in English.
Accepted papers will be published as CEUR Workshop Proceedings.
Exhibition Room
======================================================
The RuleML2011@BRF Chairs are currently evaluating the possibility to have
an
exhibition space where to present the demo live to the participants
throughout
the Symposium.
More information will be released with the notification of acceptance of the
demo papers and demo systems.
Important Dates
======================================================
Submission deadline for demo papers and demo systems: Sept. 2nd, 2011
Notification of accepted demo papers and demo systems: Sept. 23rd, 2011
Camera ready papers: Sept. 30th, 2011
RuleML2011@BRF Challenge Chairs
======================================================
Stefano Bragaglia, University of Bologna, Italy
Marco Montali, KRDB, Free University of Bozen-Bolzano, Italy
Charles Petrie, Stanford University, USA
Mark Proctor, Red Hat, UK
14 years, 7 months
Query in stateless knowledge session returns no results
by Heijink, Hank
Hi all,
I'm new to Drools, so please excuse me if I'm asking about the obvious--it's certainly not obvious to me. The problem is this: I use a stateless knowledge session where a list of facts is inserted. The rules that fire create new facts, and after all the rules have fired, I'd like to obtain a list of all the facts (the old and the new). The best way seemed to use a query. I'm using Drools 5.1 on Linux.
This is part of my .drl file (without the imports):
rule "create badge"
when
Event ( eventType == EventType.SOME_EVENT_TYPE )
not BadgeState ( identifier == "badge" )
then
insert( new BadgeState("badge") );
end
query "all badges"
aBadge : BadgeState()
end
This is the Java code:
StatelessKnowledgeSession ksession = StatsKnowledgeBase.getKnowledgeBase().newStatelessKnowledgeSession();
// Create a list of share events
ArrayList<Event> events = new ArrayList<Event>();
Date now = new Date();
MobileDevice aDevice = new MobileDevice("uniqueId", "deviceType");
for (int i = 0; i < 5; i++) {
Event anEvent = new Event.Builder(now, aDevice, "aCustomer", EventType.SOME_EVENT_TYPE).build();
events.add(anEvent);
}
// Create the query for the badges
List<Command> commands = new ArrayList<Command>();
commands.add(CommandFactory.newInsertElements(events));
commands.add(CommandFactory.newQuery("all badges", "all badges"));
// Feed the events into Drools
KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory.newConsoleLogger(ksession);
ExecutionResults results = ksession.execute( CommandFactory.newBatchExecution(commands) );
NativeQueryResults queryResults = (NativeQueryResults)results.getValue("all badges");
// At this point, queryResults is empty.
logger.close();
// Get a list of badges
List<BadgeState> badges = new ArrayList<BadgeState>();
for (Iterator<QueryResultsRow> i = queryResults.iterator(); i.hasNext(); ) {
QueryResultsRow result = i.next();
BadgeState obj = (BadgeState)result.get("aBadge");
badges.add(obj);
}
The logger shows me that the BadgeState object is created, but the query returns an empty list. I've searched the documentation, which suggests that I'm doing it right (http://drools.herod.net/drools-expert/html/ch03.html#d0e1956, example 3.37), the archives of this mailinglist, and the web, so far without success.
Clearly, I'm missing something, and I have the nagging feeling that it's something simple...
Any help is much appreciated!
Best,
Hank
14 years, 7 months
Rule Task
by S.M.H.Jamali
Thank You Mr.Surdilovic
I clone from master and execute "mvn clean install -DskipTests -Dfull" successfully but at runtime When i run gwt-console and refresh process list i get an exception. I attache its logs.
Is there any solution to solve this problem ?
Thanks
S.M.H.Jamali
________________________________
From: Tihomir Surdilovic <tsurdilo(a)redhat.com>
To: rules-users(a)lists.jboss.org
Sent: Monday, August 1, 2011 6:15 AM
Subject: Re: [rules-users] Rule Task
On 7/31/11 11:30 AM, S.M.H.Jamali wrote:
Thanks ,
>
>I add this
>
>jbpm-gwt/jbpm-gwt-core/src/main/java/org/jbpm/integration/console/CommandDelegate.java
>to gwt-console in its location but i can not build jbpm from source ! it seems it has very bugs !
>
clone from master https://github.com/droolsjbpm/jbpm and just
mvn clean install -DskipTests -Dfull
show the bugs or they do not exists :)
>
>Is there any stable version of Jbpm with its bug fixes ?
>
>S.M.H.Jamali
>
>
>________________________________
>From: Tihomir Surdilovic <tsurdilo(a)redhat.com>
>To: rules-users(a)lists.jboss.org
>Sent: Wednesday, July 27, 2011 9:49 PM
>Subject: Re: [rules-users] Rule Task
>
>On 7/27/11 7:18 AM, S.M.H.Jamali wrote:
>> My problem is : when i create a new instance of my
process (in jbpm
>> console) , first Script Task run fine , but execution
of the process
>> stops at Rule Task and no rule fired ! Am i missing
something ?
>This is a known issue in jbpm-console which just got fixed:
>https://issues.jboss.org/browse/JBPM-3301.
>
>Thanks.
>_______________________________________________
>rules-users mailing list
>rules-users(a)lists.jboss.org
>https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
>
>
>_______________________________________________
rules-users mailing list rules-users(a)lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
14 years, 7 months
java int problem
by gbelin
I have a problem with int data in drools.
I have created a test class for persons with it setters and getters:
/public class A {
private int age;
private String sex;
private String name;
public A () {
System.out.println ("creating A.");
}/
I have a rule that gets the person with de min age
/rule "min age"
ruleflow-group 'group1'
salience 10
when
$a : A ()
not A (age<$a.age)
then
System.out.println (" *** the min age "+$a.getAge()+" corresponds to " +
$a.getName());
end
/
I insert 4 persons in the knowledge base with different ages, then, when I
run the rule, it returns all the 4 persons.
If I set another rule with more priority that sets the ages of all persons,
then the "min age" rule works propertly and write the message for the person
with de minimun age.
/rule "set age"
ruleflow-group 'group1'
salience 11
no-loop
when
$a : A ()
then
$a.setAge($a.getAge());
update($a);
System.out.println( "Person " + $a.getName() + " has an age of " +
$a.getAge() + " years" );
end
/
Is there any problem with drools and ints?
Thanks in advance.
--
View this message in context: http://drools.46999.n3.nabble.com/java-int-problem-tp3215383p3215383.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 7 months