Add calendars to knowledge session from Spring?
by dunnlow
I am using the Drools 5.4 integration server in a stateless session. I have
it running fine with the example. Now, I want to use custom Quartz
calendars in my rules. The only way I could come up with to do this in
Spring (a la integration server) was to create a bean that takes a ksession
constructer then creates the calendars and adds them to that ksession.
I see that the bean is created with a knowledge session and all seems ok,
but none of my calendar-based rules ever fire regardless of how the
calendars are configured. (I test the calendars in my bean (with a call to
isTimeIncluded()) and they seem to be in working order.
Also weird is that bean's constructor gets called twice and with two
different knowledge sessions. Once when I start the application, and then
again when I send to the rules service.
1) What is the right was to add custom calendars to a knowledge session (via
Spring)?
2) Any idea why my bean is getting called twice with different knowledge
sessions?
Thanks for any insight. -J
---in knowledge-service.xml
<drools:ksession id="ksession1" type="stateful" kbase="kbase1"
note="node1"/>
<bean id="myCalendar" class="org.test.MyQuartzCalendarLoader">
<constructor-arg ref="ksession1"/>
</bean>
--- MyQuartzCalendarLoader.java
public class MyQuartzCalendarLoader {
private static StatefulKnowledgeSession thisSession=null;
public MyQuartzCalendarLoader (StatefulKnowledgeSession thisKs) {
//gets called twice?
thisSession=thisKs;
print thisSession.tostring() -- looks ok
WeeklyCalendar calendar = new WeeklyCalendar();
org.drools.time.Calendar onlyWeekDays =
QuartzHelper.quartzCalendarAdapter(calendar);
calendar.setDayExcluded(Calendar.WEDNESDAY,false) -- I toggle
just to test
print onlyWeekDays.isTimeIncluded(now.getTime()); --- also
works as expected
Calendars cals =
thisSession.getCalendars().set("ONLYWEEKDAYS",onlyWeekDays);
}
}
--- test.drl
rule "weekdays" dialect "mvel" <-- This rule never fires unless i
remove calendars.
calendars "ONLYWEEKDAYS"
when
$m:Message()
then
$m.text = "FIRED"
end
--
View this message in context: http://drools.46999.n3.nabble.com/Add-calendars-to-knowledge-session-from...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 3 months
Reg. Iterating over a list
by Phani Saripalli
Hi.
I tried to identify relevant ways for some container specific operations
like exists, forall (or foreach). Basically I have started using for
software product line research, and specifically model checking over product
line models. The initial results so fat ( considering the time I started)
have been wonderful, alas I am tuck at this point.
For example, consider :
import java.util.List;
import java.util.Arrays;
import java.util.ArrayList;
declare Project
a : int
b : int = 5
list : List = new java.util.ArrayList(java.util.Arrays.asList(1 , 2 , 3
, 4 , 5))
end
Now that the element of Project - list is configured, I would like to
perform some operations on it like:
a) for each - for the list (Project - P; P.list), is each element is greater
than 2? (or in essence - evaluating each element using a boolean
expression).
b) Similarly, a function like exists . for the list, is there any element
for which this expression is satisfied -
t > 2 && t < 5, where t is the iterator for the list.
As the elements of the lists are mere numbers (in this case ints), I am not
really aware/clear how I can use the Drools operations collect, for all etc.
Previously I worked with Jess rule engine, and it has in built lambda
functions which nicely provides list iterators and thus evaluating each
element of the list against a boolean expression.
I am at a very important point in my work, and any hint or solution will be
highly appreciated.
Many thanks :)
Phani
--
View this message in context: http://drools.46999.n3.nabble.com/Reg-Iterating-over-a-list-tp4019512.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 3 months
2nd CFP Semantic Web Applications and Tools for the Life Sciences (SWAT4LS 2012)
by Adrian Paschke
2nd Call for Papers - Submission Deadline in 3 Weeks
5th International Workshop on Semantic Web Applications and Tools for the Life Sciences (SWAT4LS 2012)
http://www.swat4ls.org/workshops/paris2012
**** NEWS ****
Submission system has been opened - submission deadline in 3 weeks!
http://www.easychair.org/conferences/?conf=swat4ls2012
First program structure, keynotes & tutorials announced
http://www.swat4ls.org/workshops/paris2012/scientific-programme/
Overview
Since 2008, SWAT4LS is a workshop that has provided a platform for the
presentation and discussion of the benefits and limits of applying web-based
information systems and semantic technologies in the domains of health care
and life sciences.
SWAT4LS has been in Edinburgh (2008), Amsterdam (2009), Berlin (2010) and
London (2011).
Growing steadily each year as Semantic Web applications have become more
widespread, the program of SWAT4LS has grown to include associated events.
The next edition of SWAT4LS will be held in Paris, on November 30th 2012,
and it will be preceded by two days of tutorials and hackathons.
We are confident that the next edition of SWAT4LS will provide the same open
and stimulating environment that brought together researchers, developers,
and users, from various fields including biomedical informatics, systems
biology, computational biology, drug discovery, bioinformatics and
biocomputing, to discuss goals, current limits and real experiences in the
use of Semantic Web technologies in Life Sciences.
________________________________________
Rationale
The web is a key medium for information publishing, and web-based
information systems play a key role in biomedical information exchange and
integration. At the same time, the variety and complexity of biomedical
information call for the adoption of semantic-based solutions.
The Semantic Web provides a set of technologies and standards that are key
to support semantic markup, ontology development, distributed information
resources and collaborative social environments.
Altogether the adoption of the web-based semantic-enabled technologies in
the Life Sciences has potential impact on the future of publishing,
biological research and medicine. This workshop will provide a venue to
present and discuss benefits and limits of the adoption of these
technologies and tools in biomedical informatics and computational biology.
It will showcase experiences, information resources, tools development and
applications. It will bring together researchers, both developers and users,
from the various fields of Biology, Bioinformatics and Computer Science, to
discuss goals, current limits and some real use cases for Semantic Web
technologies in Life Sciences.
________________________________________
Topics
Topics of interest include, but are not limited to:
Standards, Technologies, Tools for the Semantic Web:
- Big Metadata
- Semantic Web standards and new proposals (e.g.: RDF, OWL, SKOS, SPIN,
RuleML, Microformats)
- Tools for ontology editing, annotation, versioning and provenance
management
- RDF stores, NoSQL, reasoners, query and visualization systems
- Knowledge representation for biomedical knowledge bases
- Query federation systems for distributed knowledge and data discovery
- Tools for semantics-enabled web publication
Systems for a Semantic Web for Bioinformatics:
- Biomedical knowledge bases on the Semantic Web
- Semantic biomedical Web Services
- Semantics-enabled biomedical information systems and solutions
- Linked Data for biomedical research
- Semantic Scientific Workflow Systems
Existing and prospective applications of the Semantic Web for
Bioinformatics:
- Semantic Wikis
- Semantic collaborative research environments
- Semantic crowdsourcing and collective intelligence
- Alternative approaches to biomedical metadata generation and management
- Methods for data sharing and open data
- Approaches to data privacy and security
- Case studies, use cases, and scenarios
________________________________________
Type of contributions
The following possible contributions are sought:
- Research papers
- Position papers
- Posters
- Software demos
________________________________________
Proceedings
Proceedings of SWAT4LS will be published in CEUR Workshop proceedings.
Please refer to the SWAT4LS website for detailed formatting instructions
prior to submission:
http://www.swat4ls.org/workshops/paris2012/call/
________________________________________
Special issue
Authors of accepted contributions to the upcoming edition of SWAT4LS will be
invited to submit to a special issue of the BMC Journal of Biomedical
Semantics.
________________________________________
Deadlines
Expression of interest for tutorials: 5th July 2012
Submission opening: 3rd September 2012
Papers submission deadline (abstracts): 28th September 2012
Papers submission deadline (full text): 9th October 2012
Early registration deadline: 15th October 2012
Posters and demos submission deadline: 22nd October 2012
Communication of acceptance: 29th October 2012
PDF ready: 23rd November 2011
Hackathon, Tutorials 28-29th November 2012
Workshop day: 30th November 2012
________________________________________
Instructions:
All papers and posters must be in English and submitted in pdf format.
Submissions for papers should report original research, and should be
between 8 and 15 pages.
Submissions for position papers should report qualified opinions,
recommendations or conclusions, and should be between 3 and 6 pages.
Submissions for posters should be between 2 and 4 pages.
Submissions for software demo proposals should also be between 2 and 4
pages.
Please refer to the SWAT4LS website for detailed formatting instructions
prior to submission:
http://www.swat4ls.org/workshops/paris2012/call/
________________________________________
Submission
All submissions will be handled via the EasyChair submission system
http://www.easychair.org/conferences/?conf=swat4ls2012
To ensure high quality, submitted papers will be carefully peer-reviewed by
at least three members of the Scientific Committee.
12 years, 3 months
Without salience
by salt
Hi All,
For the below use case i have implemented the rule. Please suggest other way
of doing without salience.
scenario
ITEMS AMOUNT OCCNO
PASS 10 1
FAIL 10 2
PASS 15 3
PASS 25 4
rule "HelloWorld_14"
salience (65522- $list.indexOf( $transdet1 ))
when
$p1:Passes($list : transaction)
$trans1:Transaction(items in ("PASS")) from $list
$p2:Passes()
not(exists($transdet5:Transaction(items in
("FAIL"),value==$transdet1.getVaue(), occno>$trans1.getOccno()) from
$p2.transaction))
then
System.out.println($trans1.getOccno());
end
The above will return
3
4 (not 4,3)
Kindly suggest other way of doing this without salience.
Thanks
Salt
--
View this message in context: http://drools.46999.n3.nabble.com/Without-salience-tp4019565.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 3 months
before/after behavior for negative pattern
by Rob21
Hi all,
I try to detect the beginning of a scenario which is characterized by an
event happening after no other event of the same type has happened in the
last 90sec.
I can't understand why only the first of those two rules is working.
rule "Detect Scenario beginning"
when
$start : RawEvent()
not RawEvent(id == $start.id, $start after[0ms, 90s] this)
then
System.out.println($start);
end
rule "Detect Scenario beginning alt"
when
$start : RawEvent()
not RawEvent(id == $start.id, this before[0ms, 90s] $start)
then
System.out.println($start);
end
Moreover if the first sent event is a rawEvent none of them will detect it.
Where am i wrong ? (still a beginner with drools)
PS : I already posted it on the forum, but i forgot to complete all the
subscription steps so it was rejected. Sorry for the double post.
--
View this message in context: http://drools.46999.n3.nabble.com/before-after-behavior-for-negative-patt...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 3 months
ClassNotFoundException
by devan.vanreenen@gmail.com
Hi there,
Please confirm if anyone is able to assist.
I have uploaded several pojo model jars to Guvnor, and resolved all issues
when saving and validating the package configuration in Guvnor and no issue
when building packages.
I get a ClassNotFoundException for classes in a specific jar that I have
uploaded but when I download this jar from Guvnor and inspect jar those
classes are present.
As soon as i remove the rules that use objects from this problematic jar
then the rest of the rules work as expected
Do you have any suggestions on where I can start investigating this?
Please let me know if you require any further information.
Thanks and Regards
Devan
--
View this message in context: http://drools.46999.n3.nabble.com/ClassNotFoundException-tp4019536.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 3 months