Drools bpmn gateway constraints questions

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Drools bpmn gateway constraints questions

mattmadhavan
Hello,
I am trying create a few constraints (XOR).  I have a .DRL file with 3 agenda-group. I am also using a custom evaluator and few global static functions.

Mine is a Stateless Session with bunch of records (Caner records)

1. How do I refer to the current fact?
- Can I do something like this?
$cancerRecord : CancerRecord ()

2. How do I invoke external functions?
Can I do something like

inlist ($cancerRecord.PRIMARY_SITE,  "C500, C501, C502, C503, C504, C505, C506, C508, C509")
containsAny (kcontext, $cancerRecord, "505101,505102,505103,505104,505105,505106,505107,505108")


not inlist ($cancerRecord.PRIMARY_SITE,  "C500, C501, C502, C503, C504, C505, C506, C508, C509")
not containsAny (kcontext, $cancerRecord, "505101,505102,505103,505104,505105,505106,505107,505108")

Please note that inlist and containsAny are valid functions that work. But I am not able to import tham within the constrains.

I not able to locate any documentation in this. Can some one point me to the right documentation. I have been stuck on this for couple of days.

Any help is appreciated.

Thanks in advance!
Matt'm
Reply | Threaded
Open this post in threaded view
|

Anyone? Re: Drools bpmn gateway constraints questions

mattmadhavan
Anyone out there please?

Thanks
Matt
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] Anyone? Re: Drools bpmn gateway constraints questions

salaboy
Hi Matt

so:

"1. How do I refer to the current fact? 
- Can I do something like this? 
$cancerRecord : CancerRecord ()"

The current record where??? If you have multiple CancerRecord(s) each of them will match with that conditional element. If you have a business process with a process variable you should point to that variable instead of using the rules language to filter it. If the CancerRecord is a fact that's the right way to go. 

"2. How do I invoke external functions? 
Can I do something like 

inlist ($cancerRecord.PRIMARY_SITE,  "C500, C501, C502, C503, C504, C505, C506, C508, C509") 
containsAny (kcontext, $cancerRecord, "505101,505102,505103,505104,505105,505106,505107,505108") "

Did you try this:
eval(inlist(.....)) in the RHS?




"I not able to locate any documentation in this. Can some one point me to the right documentation. I have been stuck on this for couple of days. "

All of this is explained in the drools.org documentation site, I'm pretty sure that the eval is there.



On Wed, Aug 13, 2014 at 4:33 PM, mattmadhavan <[hidden email]> wrote:
Anyone out there please?

Thanks
Matt



--
View this message in context: http://drools.46999.n3.nabble.com/Drools-bpmn-gateway-constraints-questions-tp4030640p4030646.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users



--
 - MyJourney @ http://salaboy.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar
 
 - Salatino "Salaboy" Mauricio -

_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] Anyone? Re: Drools bpmn gateway constraints questions

mattmadhavan
Hi Salaboy,
Thank you very much for your reply. I am still not clear on this?

" The current record where??? If you have multiple CancerRecord(s) each of them will match with that conditional element. If you have a business process with a process variable you should point to that variable instead of using the rules language to filter it. If the CancerRecord is a fact that's the right way to go. "

I have a stateless session and I process 500 CancerRecords at a time via batch execute. Please note that I do not change the State of the CancerRecord. I use evey record to compute Cancer treatment "
measures"

So you feel
$cancerRecord : CancerRecord ()  will work?

And what do you mean by a Business Process with a processor variable? Can you point me to the right direction?

Thanks in advance!

Matt'M