[rules-users] Can an Object inside a map be used in guvnor
Michael Anstis
michael.anstis at gmail.com
Fri Mar 22 05:21:39 EDT 2013
Hello,
Using Guvnors "guided" features you cannot create constructs like this:
HashMap(this["amount"]!=null)
The only solution is to use a free-format DRL fragment (in either the
Guided Rule Editor, Guided Template Editor or Guided Decision Table).
With Guided Templates and Guided Decision Tables you could make the map key
a "template key" so values can be defined elsewhere:
HashMap(this["@{key}"]!=null)
An alternative to a free-format DRL fragment would be to define a DSL. DSLs
can be used in any of the foregoing editors.
With kind regards,
Mike
On 22 March 2013 09:16, Aditi Hardas <aditi.hardas at gmail.com> wrote:
> Hi Abhinay,
>
> I was also expected the same and still struggling for the right answer .
> see
> my older post
>
>
> http://drools.46999.n3.nabble.com/guvnor-5-5-Guided-decision-tables-web-based-td4022179.html#a4022238
> <
> http://drools.46999.n3.nabble.com/guvnor-5-5-Guided-decision-tables-web-based-td4022179.html#a4022238
> >
>
>
> I would like to ask you that according to your first post you have created
> a
> Hash Map.
>
> Map<String, Integer> map = new HashMap<String,Integer>();
> map.put("amount",12);
>
> My DRL is as follows :
>
> when
> $h : HashMap(this["amount"]!=null)
> then
> //something
>
> So did you created that in Guvnor or in hand coded drl file ? How Guvnor
> will identified HashMap(this["amount"]!=null) statement without creating a
> object of HashMap ?
>
>
>
>
>
> -----
> Aditi
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Can-an-Object-inside-a-map-be-used-in-guvnor-tp4022907p4022982.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20130322/bc452efe/attachment.html
More information about the rules-users
mailing list