The basic idea of the DSL implementation in Drools is to use phrases (and
not just single
keywords) with a translation into DRL. These phrases can have parameters.
On 9 August 2012 19:08, san_drools <pathasantosh(a)yahoo.co.in> wrote:
Laune, the problem is when i define a keyword like i said above
"PersonMobileContact" for Object1($ContactNum : contactNumber &&
contacttype
== "mobile"). In business rule, i can use this keyword.
This is ok, but if i want to set this $ContactNum into another object
i.e. Object2. I think i need to define the key for this action too (like
"setContactNo" --> $Object2.setAccessPoint($ContactNum));) Because we
cannot
access $ContactNum directly. Or is any other way to do this.
You can use "$ContactNum" from the DRL translation. It's not
"hidden".
And another point to achieve is we will have to refer different
objects for
a keyword based on context. If we see above example, For
"PersonMobileContact" if the context is "productdelivery" i need to
refer
Object1. and if the context is "meetingschedule" i need to refer Object2.
Here you might use a parameter. Your DSL phrase can be
[when] PersonMobileContact with {X} ={X} ($ContactNum : contactNumber &&
contacttype
== "mobile")
and you can write
PersonMobileContact with Object1
PersonMobileContact with Object2
-W
I am just beginner in drools, so the things are new to me. Please
suggest.
--
View this message in context:
http://drools.46999.n3.nabble.com/How-to-define-keywords-that-represent-o...
Sent from the Drools: User forum mailing list archive at
Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users