Re: [rules-users] Rule Task

2011-07-31 Thread Tihomir Surdilovic

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 
*To:* rules-users@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@lists.jboss.org 
https://lists.jboss.org/mailman/listinfo/rules-users




___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Insert a fact into drools server from a web application or java application

2011-07-31 Thread kkelleyjr
Ok, I have read the documentation like a million times. I have looked at all
the examples. Yet I still can not figure out how to add a fact to the drools
server ksession1 from a web application or a java application. I have got
the server to work. I have even got the soapUI to work. now I want to add a
fact from my own client.

My issue is that I need to add a facts that has maps and list in the pojo.
how can I just add the pojo to the ksession1? Is there an example that is
out there that I have not found? 

It seems simple, but I just do not understand... can someone provide some
additional help, please? 

--
View this message in context: 
http://drools.46999.n3.nabble.com/Insert-a-fact-into-drools-server-from-a-web-application-or-java-application-tp3214229p3214229.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] CFP: 4th International Workshop on Semantic Web Applications and Tools for the Life Sciences (SWAT4LS 2011)

2011-07-31 Thread Adrian Paschke
Call for Papers
4th International Workshop on Semantic Web Applications and Tools for the
Life Sciences (SWAT4LS 2011)
http://www.swat4ls.org/2011/

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 Biomedical Informatics and
Computational Biology. 
Growing steadily each year as Semantic Web applications become more
widespread, SWAT4LS has been in Edinburgh 2008, Amsterdam 2009, and Berlin
2010, with London planned for 2011. The last edition of SWAT4LS was held in
Berlin, on December 10th, 2010. It was preceded by two days of tutorials and
other associated events.
We are confident that the next edition of SWAT4LS will provide the same open
and stimulating environment that brought together researchers, both
developers and users, from the various fields of Biology, Bioinformatics and
Computer Science, 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 medecine. 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
o Semantic Web standards and new proposals (e.g.: RDF, OWL, SKOS, SPIN,
RuleML)
o Tools for ontology management, editing and versioning
o RDF stores, Reasoners, query and visualization systems
o Formal approaches to large biomedical knowledge bases
o Tools for semantic-enabled web publication
o Alternative approaches to integrate semantic representations and web based
solutions
. Systems for a Semantic Web for Bioinformatics
o Biomedical knowledge bases on the Semantic Web
o Semantic biomedical Web Services
o Semantics aware Biological Data Integration Systems
o Semantic-enabled biomedical information systems and solutions
o Linked Data for biomedical research
. Existing and prospective applications of the Semantic Web for
Bioinformatics
o Semantic Wikis
o Semantic collaborative research environments
o Semantic crowdsourcing and collective intelligence
o Alternative approaches to biomedical metadata generation and management
o Case studies, use cases, and scenarios

Type of contributions
The following possible contributions are sought: 
. Research papers
. Position papers
. Posters
. Software demos

Proceedings
All accepted communications will be published in the proceedings (under
definition, proceedings of SWAT4LS have appeared in the past in CEUR
proceedings and Nature precedings). 

Special issue
Authors of accepted contributions to the upcoming edition of SWAT4LS will be
invited to submit an extended and revised version of their contributions for
a special issue of an internation peer-reviewed scientific journal (under
definition, special issues of SWAT4LS have appeared in the past in BMC
Bioinformatics and in the BMC Journal of Biomedical Semantics.) 

Deadlines
. Expression of interest for turorials: 10 June 2011
. Submission openinig: 12 September 2011
. Papers submission deadline: 7 October 2011
. Posters and demo submission deadline: 31 October 2011
. Communication of acceptance: 7 November 2011
. Camera ready: 21 November 2011

Instructions
All papers and posters must be in English, formatted according to LNCS
format (http://www.springer.de/comp/lncs/authors.html) and submitted in pdf
format. 
. Submissions for papers should report orginal research, and should be
between 8 and 15 pages.
. Submissions for position papers should report qualified opinions,
recommendations or conclusions, and should be bet

Re: [rules-users] Condition syntax to access Map

2011-07-31 Thread Mark Proctor

On 31/07/2011 19:39, Wolfgang Laun wrote:
2011/7/31 Mark Proctor >




Implicit mapping I call Managed Object Graphs MOGs. So you can write
Person( address.street == "my road" )

And that internally would get translated too
$p : Person()
Address( person == $p, street == "my road" )

As there is no doubt that the current explicit bindings approach
on objects is too verbose and hard to read. Nested accessors add a
lot of readability.


So what if Address is not an inserted fact? So far, a CE with type 
Foo(...) implied the existence of a fact of that type. I'm not sure 
that inserting some object should imply the insertion of all of its 
descendants as facts as well...
You don't necessarily have to insert Address. It can attach a listener, 
assuming the pojo supported it, when it's accessed in a pattern - 
allowing the pattern to receive updates from nested objects.


Whether something is inserted or not can be annotation driven. Something 
can't be inserted anyway unless it has the necessary references for the 
joins.


I want to look at a full range of MOGs to automate and semi-autimate 
things with regards to nested structures. At the moment there is no best 
practice and DRL (or any other rule language) does not make this nice. 
We ALL suck for compact nested accessors.


Mark


-W


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Condition syntax to access Map

2011-07-31 Thread Wolfgang Laun
2011/7/31 Mark Proctor 

>
>
> Implicit mapping I call Managed Object Graphs MOGs. So you can write
> Person( address.street == "my road" )
>
> And that internally would get translated too
> $p : Person()
> Address( person == $p, street == "my road" )
>
> As there is no doubt that the current explicit bindings approach on objects
> is too verbose and hard to read. Nested accessors add a lot of readability.
>
>
So what if Address is not an inserted fact? So far, a CE with type Foo(...)
implied the existence of a fact of that type. I'm not sure that inserting
some object should imply the insertion of all of its descendants as facts as
well...

-W
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Query in stateless knowledge session returns no results

2011-07-31 Thread Heijink, Hank
Thanks so much! I'll have a chance to test it tomorrow.

Hank

Sent from my iPhone

On Jul 31, 2011, at 12:48 PM, "Mark Proctor" 
mailto:mproc...@codehaus.org>> wrote:

On 31/07/2011 17:45, Mark Proctor wrote:
On 31/07/2011 17:25, Heijink, Hank wrote:
Aha! I missed the line about the dispose. That makes a lot of sense. What I 
don't understand is why the example 3.37 in the docs would work. If I 
understand what you're saying, it shouldn't.
It should work, as long as the query is executed as part of the same execute 
batch. We have unit tests f or that too somewhere.
ok I see the problem. Your rules will not fire until the all the command shave 
been executed. i.e. the implicit fireAllRules() is once all commands have been 
executed. Which means the query will be invoked before your rule fires to 
insert the object.

Instead you need to add the FireAllRules command before executing the query.

Mark

mark

Thanks!
Hank

Sent from my iPhone

On Jul 30, 2011, at 8:27 AM, "Wolfgang Laun" 
<wolfgang.l...@gmail.com>
 wrote:

StatelessKnowledgeSession.execute(...) executes the command(s) and finally 
calls dispose() on the session. Use a stateful session or a global (filled with 
a low-salience rule) or  -  simply use the getObjects command.
-W

On 29 July 2011 22:47, Heijink, Hank 
<heij...@audible.com> 
wrote:
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 events = new ArrayList();
   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 commands = new ArrayList();
   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 badges = new ArrayList();
   for (Iterator 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


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users



___
rules-users mailing list
rules-users@lists.

Re: [rules-users] Condition syntax to access Map

2011-07-31 Thread Mark Proctor

On 29/07/2011 17:50, Greg Barton wrote:
Ah, other engines don't do nested accessors because they're wimps. 
 WIMPS! :)


I'd like to see a situation where we have the convenience of nested 
accessors, but mapping to fully relational joins. This is combine with 
some nice XPATH like syntax too.


Implicit mapping I call Managed Object Graphs MOGs. So you can write
Person( address.street == "my road" )

And that internally would get translated too
$p : Person()
Address( person == $p, street == "my road" )

As there is no doubt that the current explicit bindings approach on 
objects is too verbose and hard to read. Nested accessors add a lot of 
readability.


I also want to add xpath like syntax as a short cut for 'from', as I 
think it makes for easier readability:

Bookshop()/books( author == "some author" )

Which is a short cut for:
$b : Bookshop
Book( author == "some author" ) from $b.books

And would support map/list access like xpath:
Person()/pets[0]/( age > 30)

Whichis short for
$p : Person()
Pet( owner == $p, age > 30 ) from $p.pets[0]

Again if the nested objects are inserted as MOGs, the joins would be 
obeyed instead of using 'from', i.e. they'll receive notifications from 
nested object update.


This is partly why I think we need to have a think about syntax 
accessors in general, before we decide what to do, there are a lot of 
related areas and a decision in one area impacts another.


Mark




--- On *Fri, 7/29/11, Mark Proctor //* wrote:


From: Mark Proctor 
Subject: Re: [rules-users] Condition syntax to access Map
To: rules-users@lists.jboss.org
Date: Friday, July 29, 2011, 8:52 AM

On 29/07/2011 14:28, Edson Tirelli wrote:


   Yes, that is exactly what I think. Pattern matching
constraints are like query parameters. They need to exist and
evaluate to true in order to match. So, for this to match:

a.b.c == null

   a needs to exist and be non-null, b needs to exist and be
non-null, c needs to exist and be null. So it is not just NP safe
navigation... it is an existence test at the same time. So for maps

a[x].b[y].c[z] == null

   The keys x, y and z need to exist, and c[z] must have a value
of null. That is what the expression above is asking for, in my
understanding.

   This presents no loss of completeness to the language, as you
can still test non-existence of keys if that is what you want,
but the most common case you are looking for the opposite and it
becomes much simpler to write rules that way.

> So, a builder option to turn this on is allright with me.

   We can probably do that and have a configuration option to
turn this feature on/off.

I'm strongly against configuration options in this case, we decide
on one way and stick with it. We already have too many
configurations and a casual person looking at the code could
introduce a bug as they weren't aware of what configuratino was on
for null safety.

I think part of the problem here is we are mixing domains, between
script evaluation and relational constraints. There is a reason
why other rule engines don't do nested accessors :) (ignoring the
technical issues too).

Mark

Mark


   Edson


2011/7/29 Mark Proctor >

Lets forget that these are nested accessors and the problems
they bring. Lets look at what they would be if they were real
relations:


On 29/07/2011 08:55, Wolfgang Laun wrote:

Whoa! See below...

2011/7/28 Edson Tirelli >


   I think we need to differentiate paradigms here. When
using rules, contrary to imperative code, what we are
doing is pattern matching.

X( a.b.c ==  )

   In the above case, we are looking for Xs that make
that whole constraint true (i.e. match). If a or b are
null, the whole expression will be false, does not
matter the value of c or the value it is being compared
against.


(Edson: Only if you define it so. The logical implication of
c being null in an absent a.b (i.e., a.b==null) could very
well be that "a.b.c does not exist", and you can't claim
that a.b.c exists if a.b. doesn't!

Is there no house at some address?
(city.street[name].house[number] == null)  # true => no
such house

$c : City()
$s : Street( city == $c, street = "name" )
   House( number ==  null)

The above is identical logic to the more convenient form of
nested accessors, it's the proper relational form. In this
case if there was no Street, it wouldn't match.





This test data with false when null:
Vienna/TirelliStrasse/42 returns "false", hence there /is/
such a house. But we don't have a Tirelli Street in Vienna
(yet)!

Confer this to Perl's
! exists 

Re: [rules-users] Query in stateless knowledge session returns no results

2011-07-31 Thread Mark Proctor

On 31/07/2011 17:45, Mark Proctor wrote:

On 31/07/2011 17:25, Heijink, Hank wrote:
Aha! I missed the line about the dispose. That makes a lot of sense. 
What I don't understand is why the example 3.37 in the docs would 
work. If I understand what you're saying, it shouldn't.
It should work, as long as the query is executed as part of the same 
execute batch. We have unit tests f or that too somewhere.
ok I see the problem. Your rules will not fire until the all the command 
shave been executed. i.e. the implicit fireAllRules() is once all 
commands have been executed. Which means the query will be invoked 
before your rule fires to insert the object.


Instead you need to add the FireAllRules command before executing the query.

Mark


mark


Thanks!
Hank

Sent from my iPhone

On Jul 30, 2011, at 8:27 AM, "Wolfgang Laun" > wrote:


StatelessKnowledgeSession.execute(...) executes the command(s) and 
/finally calls dispose()/ on the session. Use a stateful session or 
a global (filled with a low-salience rule) or  -  simply use the 
getObjects command.

-W

On 29 July 2011 22:47, Heijink, Hank > wrote:


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 events = new ArrayList();
   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 commands = new ArrayList();
 
 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 badges = new
ArrayList();
   for (Iterator 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


___
rules-users mailing list
rules-users@lists.jboss.org 
https://lists.jboss.org/mailman/listinfo/rules-users


___
rules-users mailing list
rules-users@lists.jboss.org 
https://lists.jboss.org/mailman/listinfo/rules-users



___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


__

Re: [rules-users] Query in stateless knowledge session returns no results

2011-07-31 Thread Mark Proctor

On 31/07/2011 17:25, Heijink, Hank wrote:
Aha! I missed the line about the dispose. That makes a lot of sense. 
What I don't understand is why the example 3.37 in the docs would 
work. If I understand what you're saying, it shouldn't.
It should work, as long as the query is executed as part of the same 
execute batch. We have unit tests f or that too somewhere.


mark


Thanks!
Hank

Sent from my iPhone

On Jul 30, 2011, at 8:27 AM, "Wolfgang Laun" > wrote:


StatelessKnowledgeSession.execute(...) executes the command(s) and 
/finally calls dispose()/ on the session. Use a stateful session or a 
global (filled with a low-salience rule) or  -  simply use the 
getObjects command.

-W

On 29 July 2011 22:47, Heijink, Hank > wrote:


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 events = new ArrayList();
   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 commands = new ArrayList();
 
 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 badges = new ArrayList();
   for (Iterator 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


___
rules-users mailing list
rules-users@lists.jboss.org 
https://lists.jboss.org/mailman/listinfo/rules-users


___
rules-users mailing list
rules-users@lists.jboss.org 
https://lists.jboss.org/mailman/listinfo/rules-users



___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Query in stateless knowledge session returns no results

2011-07-31 Thread Heijink, Hank
Aha! I missed the line about the dispose. That makes a lot of sense. What I 
don't understand is why the example 3.37 in the docs would work. If I 
understand what you're saying, it shouldn't.

Thanks!
Hank

Sent from my iPhone

On Jul 30, 2011, at 8:27 AM, "Wolfgang Laun" 
mailto:wolfgang.l...@gmail.com>> wrote:

StatelessKnowledgeSession.execute(...) executes the command(s) and finally 
calls dispose() on the session. Use a stateful session or a global (filled with 
a low-salience rule) or  -  simply use the getObjects command.
-W

On 29 July 2011 22:47, Heijink, Hank 
<heij...@audible.com> 
wrote:
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 events = new ArrayList();
   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 commands = new ArrayList();
   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 badges = new ArrayList();
   for (Iterator 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


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Rule Task

2011-07-31 Thread S.M.H.Jamali
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 !


Is there any stable version of Jbpm with its bug fixes ? 

 
S.M.H.Jamali



From: Tihomir Surdilovic 
To: rules-users@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@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users