POJO accessors method in Drools facts
by aliosha79
Hi,
i have some troubles to undestand how drools processes FACTS. I have a POJO
class resulted from an UnMarshal jaxb processing like this:
public MyClass {
protected String className = "Class1";
public getClassName(){
return className;
}
public setClassName(String className){
this.className = className
}
}
Now i have to compose a drl file with a rule like this:
when
$Class : MyClass()
eval ($Class.getClassName() == "Class1")
then
System.out.println("ok!!!");
end
This syntax doesn't rise errors BUT doesn't match the real name... no ok
message are printed.
when
$Class : MyClass (getClassName() == "Class1")
then
System.out.println("ok!!!");
end
This syntax raises me a null pointer exception!!!
What's the right syntax?
Can i use the accessor methods building drools facts?
Thanks a lot!
--
View this message in context: http://drools.46999.n3.nabble.com/POJO-accessors-method-in-Drools-facts-t...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years
CLOUD mode Vs Stream Mode.
by Hassan
Hello,
It's clair that to work with thae events we have to put our base
configuration into STREAM mode like this:
*/KnowledgeBaseConfiguration config =
KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
config.setOption( EventProcessingOption.STREAM );/*
But in an exemple, I didn't use this mode and I didn't use Entry-points,
Although my events work very well !!
Help please !!
--
View this message in context: http://drools.46999.n3.nabble.com/CLOUD-mode-Vs-Stream-Mode-tp3780297p378...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years
Drools (Planner) getting confused between list and map access
by aitchnyu
I am trying to find the total of an attribute of`SubjectTeacherPeriod`. The
`numAttributeMap`property (a map with `String` keys and `int` values) stores
the value. But trying to access it is problematic as Drools thinks that
`$num_value[$attribute]` is a list operation, not a map operation.
I listed my rule and runtime errors:
rule "insertAttributeDayTotal"
//salience 1 // Do these rules first (optional, for performance)
when
$sum_regression_constraint : SumRegressionConstraint(
$class : class_,
$attribute : attribute//,
//$weight : weight;
)
$day_of_week : DayOfWeek()
$attribute_day_total : Number() from accumulate(
SubjectTeacherPeriod(
//period != null,
period.class_ == $class,
period.dayOfWeek == $day_of_week,
$num_value : numAttributeMap
//$total : num_attribute_map.get($attribute)
),
sum($num_value[$attribute]) //PROBLEM LINE??
)
then
//System.out.println("BUCKET TOTAL "+$id+" "+$bucket_total.intValue());
insertLogical(new AttributeDaySum($class, $attribute, $day_of_week,
$attribute_day_total.intValue()));
end
*Errors:*
jesvin@Jesvin-Technovia:~/dev/drools/timetabler$ java -server
in.co.technovia.timetabler.TimeTableApp
Exception in thread "main" java.lang.IllegalStateException: There are errors
in the scoreDrl's:
Rule Compilation error : [Rule name='insertAttributeDayTotal']
in/co/technovia/timetabler/domain/Rule_insertAttributeDayTotal_fd3f7d4f98084049887c1596f5a56805.java
(9:1093) : The type of the expression must be an array type but it resolved
to Map
in/co/technovia/timetabler/domain/Rule_insertAttributeDayTotal_fd3f7d4f98084049887c1596f5a56805.java
(9:1104) : Type mismatch: cannot convert from String to int
at
org.drools.planner.config.solver.SolverConfig.buildRuleBase(SolverConfig.java:238)
at
org.drools.planner.config.solver.SolverConfig.buildSolver(SolverConfig.java:170)
at
org.drools.planner.config.XmlSolverConfigurer.buildSolver(XmlSolverConfigurer.java:103)
at
in.co.technovia.timetabler.TimeTableApp.createSolver(TimeTableApp.java:55)
at in.co.technovia.timetabler.TimeTableApp.main(TimeTableApp.java:39)
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Planner-getting-confused-between...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years
Deadline Approaching - ACM DEBS 2012
by Adrian Paschke
* Apologize for multiple posting - Submission Deadline March 5th *
=====================================================================
DEBS2012
6th ACM International Conference on Distributed Event-Based Systems
July 16-20, 2012
Freie Universitaet Berlin, Berlin, Germany
http://www.csw.inf.fu-berlin.de/debs2012
=====================================================================
The objectives of the 6th ACM International Conference on Distributed
Event-Based Systems (DEBS) are to provide a forum dedicated to the
dissemination of original research, the discussion of practical insights,
and the reporting of relevant experience relating to event-based computing
that was previously scattered across several scientific and professional
communities. The conference also aims at providing a forum for academia and
industry to exchange ideas, for example, through industry papers and demo
papers.
DEBS 2012 Tracks
================
The conference will consist of the following tracks:
- Research track featuring high quality research paper on relevant topics.
- Industry track with two sub-tracks: industry full papers and industry
experience reports.
- Tutorials geared towards either the research or the industrial
communities.
- Demos and posters.
- The DEBS 2012 Grand Challenge is a problem solving competition for
commercial and research event-based systems.
- Gong show: The gong show will consist of short presentations about
visionary and outrageous ideas towards the next generation of event-based
systems. The audience will vote for the best idea.
- Doctoral workshop
Important Dates
=======================
- Research, Industry and Tutorial papers submission, and (optional) Industry
experience report submission: March 5, 2012
- Grand Challenge problem description: March 7, 2012
- Author notification for tutorials, research and Industry papers, and
Industry experience reports: April 30, 2012
- Poster and demo submission: May 2, 2012
- Grand Challenge Solutions including 4 page papers: May 2, 2012
- Doctoral Workshop submission: May 2, 2012
- Grand Challenge abstracts: May 2, 2012
- Author notification for poster, demo, Challenge, PhD papers: May 16, 2012
- Conference: July 16-20, 2012
Paper Submission
=======================
Submissions will be accepted in the following tracks:
Research track;
Industry track;
Tutorials Track;
Demos& Posters;
Grand Challenge;
Doctoral Workshop.
All submissions must be original and unpublished. Accepted papers will be
published by ACM and disseminated through the ACM Digital Library.
More information about the tracks and submission information can be found on
the DEBS 2012 website:
http://www.csw.inf.fu-berlin.de/debs2012/calls.html
Scope of the Conference
=======================
The topics addressed by the conference include (but are not
limited to):
Models, Architectures and Paradigms
- Event-driven architectures
- Basic interaction models
- Event algebras, event schemas and type systems
- Languages for event correlation and patterns, streaming and continuous
queries, data fusion
- Models for static and dynamic environments
- Complex event processing
- Design and programming methodologies
- Event-based business process management and modeling
- Experimental methodologies
- Performance modeling and prediction based on analytic approaches
- Functional Reactive Programming
Middleware Infrastructures for Event-Based Computing
- Federated event-based systems
- Middleware for actuator and sensor networks
- Algorithms and protocols
- Optimization techniques for event-based (or streaming) systems
- Event dissemination based on p2p systems
- Context and location awareness
- Fault-tolerance, reliability, availability, and recovery
- Security issues
- (Self-)Management
- Mobility and resource constrained device support
- Streaming queries, transformations, or correlation engines
- Logic-based event processing
- Semantic event processing
- Business Process Management with events
Applications, Experiences, and Requirements
- Use cases and applications of event-based systems
- Real-world application deployments using event-based middleware
- Domain-specific deployments of event-based systems
- Real-world data characterizing event-based applications
- Benchmarks, performance evaluations, and testbeds
- Application requirements for next-generation event-based solutions
- Relation to other architectures
- Enterprise application integration
- Event-driven business process management
- Information logistics
- Seamless integration of event-based mechanisms into middleware platforms
--
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
14 years
Removing many facts have invalid timestamp
by Benjamin Bennett
Trying to figure out if it can be done in a rule almost some sort of pre
rule before other rules are triggered.
The current rule I have is
rule "RemoveInvalidEndTimestamps"
salience 100
when
$factN : Fact()
$factsToRemove : ArrayList(size>=5)
from collect( Fact(endTime==$factN.endTime))
then
List newFactsToRemove = new ArrayList();
newFactsToRemove.addAll($factsToRemove);
for(Fact n : newFactsToRemove ){
retract(n);
}
end
I am using a cloud based process . I could sort the facts and stream them
in.
Just in a few test cases there are many facts with invalid times , which
kills the speed .
>From the log I think that each collection of size>=5 , is triggered which
means triggered for 5,6,7, etc.
Just wondering if there is way to say before doing any other rules collect
up all these invalid times and remove them.
I was just going to write up a some java code and filter before feeding
facts into drools but I find the rule syntax is much easier to read for the
non software developers in my group.
--
Thanks,
Benjamin Bennett
<benbennett(a)gmail.com>
14 years
(no subject)
by youssef azbakh
Hello every body !
I'm a new drools Fusion user, And I'm now facing a real problem which
is that my events attriutes values doesn't go to starttimestam and
endtimestamp, I explain :
when declaring a new event
declare Evenement
@role(event)
@startimestamp(attr1)
@endtimestamp(attr2)
end
And in the java code when I call the methods (getStartTimeStamp() end
getEndTimeStamp()) of EventFactHandle object which is used to insert a
nuw event in the working memrory.
it gives me a very different values of what give (getAttr1() and getAttr2().
I want to know what is my error and also what is exactely the
relationship between starttimestamp of EventFactHandle and attr1 ??
Thank you
Merci :)
--
Youssef AZBAKH
Elève ingénieur en 3ème année informatique.
Institut National de Statiqtique et d'Economie Appliquée (INSEA).
14 years