[rules-users] Custom-Operator - No access to FactHandles?

Edson Tirelli ed.tirelli at gmail.com
Fri Jun 10 11:28:47 EDT 2011


   I think there is a fundamental misunderstanding in the use you are trying
to do with custom operators. Custom operators are supposed to be used to
correlate 2 values, that may be lists, but not do "search" in the working
memory, as that would be extremely inefficient. If you need to process sets
of facts, then you probably need an accumulate function, not an operator...

   Can you clarify what kind of operator are you trying to implement?

   Edson

2011/6/10 Martin, Matthias <martin at adesso.de>

> Exactly! I need to iterate over a bunch of objects/facts in the Working
> Memory.
>
>
>
> *Von:* rules-users-bounces at lists.jboss.org [mailto:
> rules-users-bounces at lists.jboss.org] *Im Auftrag von *Vincent Legendre
> *Gesendet:* Freitag, 10. Juni 2011 12:04
> *An:* Rules Users List
> *Betreff:* Re: [rules-users] Custom-Operator - No access to FactHandles?
>
>
>
> And why not accessing the object itself directly ?
> Because the evaluation of one object field depends on others objects in WM
> ?
>
> Le 10/06/2011 11:54, Martin, Matthias a écrit :
>
> Hello,
>
>
>
> some of our custom operators need to access already inserted facts at
> runtime. Therefore we extended *org.drools.base.BaseEvaluator*. The
> provide methods, i. e.
>
> *public boolean evaluate(InternalWorkingMemory workingMemory,
> InternalReadAccessor extractor, Object object,  FieldValue value)*, state,
> amongst others, a parameter “workingMemory” of type *
> org.drools.common.InternalWorkingMemory*.
>
> When calling *workingMemory.getObjects()* we receive a
> “UnsupportedOperationException”. The question is whether it is possible to
> access facts in a KnwoledgeSession at runtime or not. Alternatively we could
> provide the objects in question as globals and call
> workingMemory.getGlobal(), but that seems to me like somewhat bad
> architecture.
>
>
>
> Any suggestions are welcome.
>
> Many thanks,
>
> -Matthias
>
>
>
>
>
>
>
> _______________________________________________
>
> rules-users mailing list
>
> rules-users at lists.jboss.org
>
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
> --
> Vincent LEGENDRE
> *Consultant Sénior*
>
> EURODECISION
> 9A rue de la Porte de Buc 78000 VERSAILLES
> Tél. : +33 (0)1 39 07 12 40
> Direct : +33 (0)1 39 07 26 16
> www.eurodecision.com
> [image: EURODECISION] <http://www.eurodecision.com/>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
  Edson Tirelli
  JBoss Drools Core Development
  JBoss by Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110610/a13ce16c/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 3345 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/rules-users/attachments/20110610/a13ce16c/attachment.gif 


More information about the rules-users mailing list