Re: [rules-users] Validation in Guvnor fails due to unrecognized method of implemented interface

2009-07-10 Thread Toni Rikkola

Hi Brody,

Some things that you can try:
1. Try refreshing the browser after you have moved to 5.0.1. Maybe it is 
still using the old javascripts and that is why it is not showing the 
editors.

2. Try rebuilding the packages.
3. Move repository from 5.0.0.CR1 to 5.0.1 using the export/import that 
is under admin.


Toni

Brody bach wrote:

Hi Edson, thanks for the reply..
how can I contact the guvnor people than? :)
Or are they reading this too?

Regards
bb


Edson Tirelli-3 wrote:
  

   Brody,

   This seems to be a serialization problem. Please, talk to the guvnor
people on how to migrate between versions.

[]s
Edson

2009/7/9 Brody bach brodyb...@yahoo.com



Sooryfor reposting this one, Edson was expecting a feedback :)



Hi Edson,
sorry for the very late reply

As I mentioned before, I had this problem in Guvnor. So I undeployed my
old
guvnor and redeploy a new one (the one I take fresh from website :), so
it
should be the latest version).
Now I get a new problem: I can't open any rules I've created using the
previous version. The exception I got:

12:06:26,171 INFO  [STDOUT] [] DEBUG 01-07 12:06:26,171
(ServiceImplementation.java:loadRuleAsset:491)   Load time taken for
asset:
62
12:06:26,171 INFO  [STDOUT] [] ERROR 01-07 12:06:26,171
(RepositoryServiceServlet.java:doUnexpectedFailure:69)
com.google.gwt.user.client.rpc.SerializationException: Type
'org.drools.guvnor.client.rpc.RuleAsset' was not assignable to
'com.google.gwt.user.client.rpc.IsSerializable' and did not have a custom
field serializer.  For security purposes, this type will not be
serialized.
12:06:26,171 ERROR [STDERR] []
com.google.gwt.user.client.rpc.SerializationException: Type
'org.drools.guvnor.client.rpc.RuleAsset' was not assignable to
'com.google.gwt.user.client.rpc.IsSerializable' and did not have a custom
field serializer.  For security purposes, this type will not be
serialized.
12:06:26,171 ERROR [STDERR] []  at

com.google.gwt.user.server.rpc.impl.LegacySerializationPolicy.validateSerialize(LegacySerializationPolicy.java:140)
12:06:26,171 ERROR [STDERR] []  at

com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:581)
12:06:26,171 ERROR [STDERR] []  at

com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:129)
12:06:26,171 ERROR [STDERR] []  at

com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter$ValueWriter$8.write(ServerSerializationStreamWriter.java:146)
12:06:26,171 ERROR [STDERR] []  at

com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeValue(ServerSerializationStreamWriter.java:520)
12:06:26,171 ERROR [STDERR] []  at
com.google.gwt.user.server.rpc.RPC.encodeResponse(RPC.java:573)
12:06:26,171 ERROR [STDERR] []  at
com.google.gwt.user.server.rpc.RPC.encodeResponseForSuccess(RPC.java:441)
12:06:26,171 ERROR [STDERR] []  at
com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:529)
12:06:26,171 ERROR [STDERR] []  at

com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:164)
12:06:26,171 ERROR [STDERR] []  at

com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86)
12:06:26,171 ERROR [STDERR] []  at
javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
12:06:26,171 ERROR [STDERR] []  at
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
12:06:26,171 ERROR [STDERR] []  at

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
12:06:26,171 ERROR [STDERR] []  at

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
12:06:26,171 ERROR [STDERR] []  at
org.jboss.seam.web.ContextFilter$1.process(ContextFilter.java:42)
12:06:26,171 ERROR [STDERR] []  at

org.jboss.seam.servlet.ContextualHttpServletRequest.run(ContextualHttpServletRequest.java:53)
12:06:26,171 ERROR [STDERR] []  at
org.jboss.seam.web.ContextFilter.doFilter(ContextFilter.java:37)
12:06:26,171 ERROR [STDERR] []  at

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
12:06:26,171 ERROR [STDERR] []  at

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
12:06:26,171 ERROR [STDERR] []  at

org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
12:06:26,171 ERROR [STDERR] []  at

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
12:06:26,171 ERROR [STDERR] []  at

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
12:06:26,171 ERROR [STDERR] []  at

org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
12:06:26,171 ERROR [STDERR] []  at

org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
12:06:26,171 ERROR [STDERR] []  at


Re: [rules-users] Using field values of an ENUM in the decision table

2009-07-10 Thread Visu Nageswaran

Is the following rule in-valid?

when 
$c: Computer()
eval($c.getMemory().getValue() == 512)
then
System.out.println( THIS IS IT XXX );
___
Can someone help me understand if eval is used incorrectly to invoke the
nested accessor method getValue()? Null pointer exceptions are thrown in
method org.drools.rule.EvalCondition.isAllowed

Thanks in advance,
-Visu




Visu Nageswaran wrote:
 
 Hello, I am posting a simpler version of the actual requirement: 
 Class Computer has a field 'memory' of the enum type 'Memory' which is
 defined over integer values 
 - - - - - - - - - - 
 public enum Memory{ 
 MEM1(512), MEM2(1024), MEM3(2048); 
 public int value; 
 Memory(int i){this.value = i;} 
 public int getValue(){return value;} 
 } 
 - - - - - - - - - - 
 There is a requirement to model a decision table between memory and price 
 I am looking for the field constraint on the memory field to match to the
 values:
  
 memory.???-- Price 
 512 -- 100 
 1024 -- 200 
 2048 -- 300 
 
 I tried memory.name, memory.name(), memory.value, memory.getValue(); Does
 this have to be done using template expressions say something like memory
 == Memory.reverseLookupEnum($param)
 
 Any help, pointers in this regard would be appreciated. thanks. 
 -Visu
 

-- 
View this message in context: 
http://www.nabble.com/Using-field-values-of-an-ENUM-in-the-decision-table-tp24391112p24424994.html
Sent from the drools - user 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] Hibernate Query delivers wrong values

2009-07-10 Thread Thomas Zwifl
Hi there!

I'm working with the latest snapshot-releas of v5.1 
(build3098-rev27324-20090630-0403).
My application consists of two independent processes, 
both are repeated periodically (timer-node).
the processes both have ruleset-nodes. some rules are
querying a database with hibernate in the rule condition (LHS).
the queried objects are then inserted into workinmemory (insert(object)), 
then some computation follows, the objects are modified and written
back to db, and then the objects are retracted (retract(object)).

Now to the problem: when I start the application, everything works 
correct, and leads to the right results. But when I change a field of a
db-record manually, the hibernate-query delivers the old values!!
(of course the changes are committed.)

Anyone has an idea whats going wrong here? Is there some kind of 
caching mechanism that delivers the old objects instead of querying
the database?

greetz!
tom 
-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] Hibernate Query delivers wrong values

2009-07-10 Thread Anstis, Michael (M.)
I assume ...but when I change a field of a db-record manually... means you go 
into the database and tweak a field?

In which case this is definitely a hibernate session usage issue and I'd 
suggest you read up on the latter.

With kind regards,

Mike 

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Thomas Zwifl
Sent: 10 July 2009 11:46
To: rules-users@lists.jboss.org
Subject: [rules-users] Hibernate Query delivers wrong values

Hi there!

I'm working with the latest snapshot-releas of v5.1 
(build3098-rev27324-20090630-0403).
My application consists of two independent processes, 
both are repeated periodically (timer-node).
the processes both have ruleset-nodes. some rules are
querying a database with hibernate in the rule condition (LHS).
the queried objects are then inserted into workinmemory (insert(object)), 
then some computation follows, the objects are modified and written
back to db, and then the objects are retracted (retract(object)).

Now to the problem: when I start the application, everything works 
correct, and leads to the right results. But when I change a field of a
db-record manually, the hibernate-query delivers the old values!!
(of course the changes are committed.)

Anyone has an idea whats going wrong here? Is there some kind of 
caching mechanism that delivers the old objects instead of querying
the database?

greetz!
tom 
-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
___
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] Using field values of an ENUM in the decision table

2009-07-10 Thread Visu Nageswaran

Modifying the eval expression to include a check for NULL got it working:

when
$c: Computer()
eval( $c.getMemory()!=null  $c.getMemory().getValue().equals(512) )
then
System.out.println( THIS IS IT XXX );
end



Visu Nageswaran wrote:
 
 Hello, I am posting a simpler version of the actual requirement: 
 Class Computer has a field 'memory' of the enum type 'Memory' which is
 defined over integer values 
 - - - - - - - - - - 
 public enum Memory{ 
 MEM1(512), MEM2(1024), MEM3(2048); 
 public int value; 
 Memory(int i){this.value = i;} 
 public int getValue(){return value;} 
 } 
 - - - - - - - - - - 
 There is a requirement to model a decision table between memory and price 
 I am looking for the field constraint on the memory field to match to the
 values:
  
 memory.???-- Price 
 512 -- 100 
 1024 -- 200 
 2048 -- 300 
 
 I tried memory.name, memory.name(), memory.value, memory.getValue(); Does
 this have to be done using template expressions say something like memory
 == Memory.reverseLookupEnum($param)
 
 Any help, pointers in this regard would be appreciated. thanks. 
 -Visu
 

-- 
View this message in context: 
http://www.nabble.com/Using-field-values-of-an-ENUM-in-the-decision-table-tp24391112p24426652.html
Sent from the drools - user mailing list archive at Nabble.com.

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


Re: [rules-users] Hibernate Query delivers wrong values

2009-07-10 Thread Greg Barton

Yes, Hibernate caches in several ways.  Go here:

http://docs.jboss.org/hibernate/stable/core/reference/en/html_single/

Search for cache. :)  

Some caching you can disable. (The 2nd level session factory cache.)  

http://docs.jboss.org/hibernate/stable/core/reference/en/html_single/#configuration-optional-cacheprovider

The cache on the session cannot be disabled, but you shouldn't be using 
hibernate sessions for the long term anyway. (i.e. a new one should be opened 
up each time the rule condition is evaluated.)

--- On Fri, 7/10/09, Thomas Zwifl tom...@gmx.at wrote:

 From: Thomas Zwifl tom...@gmx.at
 Subject: [rules-users] Hibernate Query delivers wrong values
 To: rules-users@lists.jboss.org
 Date: Friday, July 10, 2009, 5:46 AM
 Hi there!
 
 I'm working with the latest snapshot-releas of v5.1
 (build3098-rev27324-20090630-0403).
 My application consists of two independent processes, 
 both are repeated periodically (timer-node).
 the processes both have ruleset-nodes. some rules are
 querying a database with hibernate in the rule condition
 (LHS).
 the queried objects are then inserted into workinmemory
 (insert(object)), 
 then some computation follows, the objects are modified and
 written
 back to db, and then the objects are retracted
 (retract(object)).
 
 Now to the problem: when I start the application,
 everything works 
 correct, and leads to the right results. But when I change
 a field of a
 db-record manually, the hibernate-query delivers the old
 values!!
 (of course the changes are committed.)
 
 Anyone has an idea whats going wrong here? Is there some
 kind of 
 caching mechanism that delivers the old objects instead of
 querying
 the database?
 
 greetz!
 tom 
 -- 
 GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
 Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
 ___
 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] ClassCastException when using an accumulate function on a locally declared type

2009-07-10 Thread Edson Tirelli
   This was a bug. It is fixed now. Thanks for reporting.

https://jira.jboss.org/jira/browse/JBRULES-2202

   Edson

2009/7/9 bill simms sitri...@gmail.com

 Hello,

 Recently I've been working with Drools version 5.0.1 to set up an event
 processor.  While doing so I have come
 across difficulties with the accumulate function, in that it will always
 throw a ClassCastException
 when inserting events that are declared within my drl file.  To illustrate
 this I've set up an example which is
 shown below.  I've search Google and the mailing list for several hours,
 but the only way past this problem
 appears to be that I will have to declare a class externally and make sure
 it implements Serializable.  Does
 anyone has suggestions for another approach?  Secondly, I would have
 assumed that since Drools was
 compiling these internally declared classes, that Serializable would have
 been implemented automatically.  So
 is this a result of the generated class not implementing Serializable, or
 have I missed something in my rules
 file?  Thanks.

 The important part of my drl file is:

 declare TestEvent
@role( event )
@expires(10s)
id : String
 end

 #This rule works fine when 'Accumulate Count' is commented out, and is used
 to make
 #sure that the event inserting has worked.
 rule Is It There
 when
 TestEvent() from entry-point test
 then
 System.out.println(Found a TestEvent.);
 end

 #This rule throws a ClassCastException when a TestEvent is inserted.
 rule Accumulate Count
 when
 $n : Number() from accumulate($t : TestEvent() from entry-point
 test,count($t))
 then
 System.out.println(Found  + $n +  events.);
 end

 The unit test does this:

 FactType testEventType =
 session.getKnowledgeBase().getFactType(com.drools.test, TestEvent);
 for(int i = 0; i  10; i++){
 Object testEvent = testEventType.newInstance();
 testEventType.set(testEvent, id, id);
 WorkingMemoryEntryPoint mainStream =
 session.getWorkingMemoryEntryPoint(test);
 mainStream.insert(event);
 session.fireAllRules();
 }

 The exception I receive is:

 org.drools.RuntimeDroolsException: java.lang.ClassCastException:
 com.drools.test.TestEvent cannot be cast to java.io.Serializable
 at org.drools.rule.Accumulate.accumulate(Accumulate.java:172)
 at
 org.drools.reteoo.AccumulateNode.modifyTuple(AccumulateNode.java:424)
 at
 org.drools.reteoo.AccumulateNode.assertObject(AccumulateNode.java:284)
 at
 org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:42)
 at
 org.drools.reteoo.PropagationQueuingNode$AssertAction.execute(PropagationQueuingNode.java:326)
 at
 org.drools.reteoo.PropagationQueuingNode.propagateActions(PropagationQueuingNode.java:221)
 at
 org.drools.reteoo.PropagationQueuingNode$PropagateAction.execute(PropagationQueuingNode.java:394)
 at
 org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:1486)
 at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:158)
 at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:122)
 at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:80)
 at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:28)
 at com.drools.test.MyUnitTest.testEvents(EvaluationTest.java:66)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at
 org.springframework.test.context.junit4.SpringTestMethod.invoke(SpringTestMethod.java:160)
 at
 org.springframework.test.context.junit4.SpringMethodRoadie.runTestMethod(SpringMethodRoadie.java:233)
 at
 org.springframework.test.context.junit4.SpringMethodRoadie$RunBeforesThenTestThenAfters.run(SpringMethodRoadie.java:333)
 at
 org.springframework.test.context.junit4.SpringMethodRoadie.runWithRepetitions(SpringMethodRoadie.java:217)
 at
 org.springframework.test.context.junit4.SpringMethodRoadie.runTest(SpringMethodRoadie.java:197)
 at
 org.springframework.test.context.junit4.SpringMethodRoadie.run(SpringMethodRoadie.java:143)
 at
 org.springframework.test.context.junit4.SpringJUnit4ClassRunner.invokeTestMethod(SpringJUnit4ClassRunner.java:160)
 at
 org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
 at
 org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
 at
 org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
 at
 org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
 at
 org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
 at
 org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:97)
 at
 

[rules-users] Drools Roadmap - Planned Release 5.1 release date

2009-07-10 Thread McDonald, Daniel
Hi,

I was wondering if there is a planned release date for Release 5.1?

 

 

Thank you,

 

Daniel McDonald

Fidelity National Information Services - Research  Development

Office phone: (972) 691-6593

Mobile phone (214) 697-8163

_

The information contained in this message is proprietary and/or confidential. 
If you are not the 
intended recipient, please: (i) delete the message and all copies; (ii) do not 
disclose, 
distribute or use the message in any manner; and (iii) notify the sender 
immediately. In addition, 
please be aware that any message addressed to our domain is subject to 
archiving and review by 
persons other than the intended recipient. Thank you.
_
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools Roadmap - Planned Release 5.1 release date

2009-07-10 Thread Mark Proctor

McDonald, Daniel wrote:


Hi,

I was wondering if there is a planned release date for Release 5.1?

end of this month, beginning of next. I high level overview, nothing 
concrete, is probably something like:

BPM Process Console (embedded in Guvnor)
BPMN2 (subset of) as default skin  + extensions
Embeded BPEL (ODE) + value add (guvnor storage, guvnor BPEL editor, 
unified deployment, integrated audit viwer).

Simulation Test (with excel front end).
WS/Rest  Services
Virtual Service Manager. Not sure on best name for this, but it should 
be the main way to request a session. All sessions support idle 
time/time to next job. This means we can create a priority queue of 
sessions and evict, for GC, sessions not doing much. This allows instant 
access to often used sessions and little often used sessions will be 
loaded from the DB and placed into the priority queue (think of it as a 
sort of cache).

Incremental Changeset Support
return of the .ddj deployment jar (5.2)
RIO(jini) remoting which includes directory services.
HA - load balancing and fault tollerance (5.2).
Oryx web based flow editor (5.2)


 

 


Thank you,

 


Daniel McDonald

Fidelity National Information Services - Research  Development

Office phone: (972) 691-6593

Mobile phone (214) 697-8163

_

The information contained in this message is proprietary and/or 
confidential. If you are not the
intended recipient, please: (i) delete the message and all copies; 
(ii) do not disclose,
distribute or use the message in any manner; and (iii) notify the 
sender immediately. In addition,
please be aware that any message addressed to our domain is subject to 
archiving and review by

persons other than the intended recipient. Thank you.
_


___
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] Detect rules changes at runtime using a push mechanism

2009-07-10 Thread rviswanathan

Hi 

I read the drools documentation and this is what I find 
quote
The KnowlegeAgent is created by the KnowlegeAgentFactory. The KnowlegeAgent
provides automatic loading, caching and re-loading, of resources and is
configured from a properties files. The KnowledgeAgent can update or rebuild
this KnowlegeBase as the resources it uses are changed. The strategy for
this is determined by the configuration given to the factory, but it is
typically pull based using regular polling. We hope to add push based
updates and rebuilds in future versions. 
unquote

Is the push based update available in the latest version? or is there a way
to get this done thru custom code? 

Thanks 
Ram




rviswanathan wrote:
 
 Hi 
 
 I am trying to detect rule changes (that I edit using Guvnor) at runtime
 in my java program. 
 I was able to use the resource scanner (as provided in the drools
 documentation) to poll and get the changes. 
 
 I am also trying to see the possibility of using a push based approach,
 instead of the polling. I see the classes for the ResourceChangeMonitor,
 ResourceChangeNotifier and ResourceChangeListener, but I am not sure how I
 should go about using these. 
 
 I tried to use the following method on the ResourceChangeNotifier by
 passing in a listener implementation and the ChangeSet as the resource -
 but what do I implement inside this method? 
 
 void subscribeResourceChangeListener(ResourceChangeListener listener, 
  Resource resource) 
 
 
 Is this approach correct? 
 
 Thanks 
 Ram 
 
 

-- 
View this message in context: 
http://www.nabble.com/Detect-rules-changes-at-runtime-using-a-push-mechanism-tp24421172p24432129.html
Sent from the drools - user 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] W3C published Last Call working drafts for Rule Interchange Format

2009-07-10 Thread Gary Hallmark
The W3C RIF working group has published six Last Call working drafts [1].

Of particular interest here is the RIF Production Rule Dialect[2]
which defines a language
dialect for exchange of production rules.

Please send any comments to public-rif-comme...@w3.org by July 31, 2009.

Gary

[1] http://www.w3.org/News/2009#item123
[2] http://www.w3.org/TR/rif-prd/ http://www.w3.org/TR/rif-core/
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] looking for more information on drools expert

2009-07-10 Thread Edson Tirelli
   Hi Aldian,

   I think you misunderstood the semantics of forall(). Forall in Drools is
the same forall quantifier from the First Order Logic.

http://en.wikipedia.org/wiki/First-order_logic

   So, if you want to write a rule that says: When for all equipments of
type 'router' there is an alarm, then raise a general failure alarm.

when
forall( $e : Equipment( type == router )
 Alarm( source == $e ) )
then
// raise a general failure alarm
end

So, if you have 10 routers in the working memory and only 9 of them have
associated alarms, this rule will NOT fire, because the condition is not
matched. But, if an alarm is raised for the 10th router, then all of them
have an associated alarm and the rule will fire.

So, as you can see, forall is a quantifier CE, in the same way that
not and exists are quantifiers. They operate on multiple facts at once,
and as so, you can not use the variables bound inside their scope outside of
it. In the above example, if you tried to use $e in the consequence, which
of the 10 routers would it be bound to? So, since it makes no sense, the
engine disallow the usage of variables bound inside quantifiers outside of
them.

Just to be easier to remember I call quantifier CEs scope delimiters.
The general rule is: variables bound inside a scope delimiter are never
available outside of them.

I don't understand what you are trying to do in your first rule in your
example. If you write your rule in plain English, the people from the list
can help you write it correctly.

Finally, just for completeness, be careful with the semantics of time.
Your Alarm class is using the system clock to define timeout, and that will
give you all kinds of headaches, not to mention wrong/unexpected results.
But this e-mail is already too long. I suggest you take a look at the Drools
Fusion docs on temporal reasoning.

[]s
Edson


2009/7/10 Gab Aldian aldian...@gmail.com

 Hi everybody

 I have read with attention the drools expert documentation, which was
 very interesting, but a little 'too simple. For example, most
 examples don't present rules with the keyword forall. I also met big
 difficulties mixing the references on the objects to my javacode. This
 is why I would need some more documentation with examples that go
 deeper into drools capacities.


 To give you clues about my plan, here is an example (which works
 perfectly in drools 5) that I have developed:
 java code - http://drools.pastebin.com/m1a705614
 rule code - http://drools.pastebin.com/m3f30cbdc

 As you can see I am studying the case where drools is used for the
 monitoring of a network of equipments that send alarms about their
 problems. But I have big difficulties, because I would like to get
 references on the objects of the forall, and to execute javacode
 such as $toto.method($titi, $tata), but such things seems impossible
 (systematic failed of compilation)

 Could you please help me?

 Thank you very much!

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




-- 
 Edson Tirelli
 JBoss Drools Core Development
 JBoss by Red Hat @ www.jboss.com
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] WebService invocation from Drools Flow

2009-07-10 Thread Mark Proctor

bdoshi wrote:

Hi,

We have situation where we would like to invoke webservice call from our
process flow.

Is there out of box component like email, log, WS-HumanTask etc. for
invoking webservice? 


Seems like we have to make use of WorkItem and implement within
WorkItemHandler. Is that the right and recommended approach?
  
I think so. If you make a WS invocation work items, ideally with CXF, 
then do please contribute it back.


Mark

Thanks,
  



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