Then part of DRL file can not use Java Generic?

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

Then part of DRL file can not use Java Generic?

wtang
Does Drools DRL file support Java generic?  I have the following in THEN part of the DRL rule file:

import java.util.*;

.....

Then

List<String> stringList = new ArrayList<String>();  // error could not resolve class ArrayList<String>

But If I do:

List stringList = new ArrayList();  // this works fine!


thx!

Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] Then part of DRL file can not use Java Generic?

laune
Drools version? Also, details such as the setting of the "dialect" option?
-W

On 30/12/2013, wtang <[hidden email]> wrote:

> Does Drools DRL file support Java generic?  I have the following in THEN
> part
> of the DRL rule file:
>
> import java.util.*;
>
> .....
>
> Then
>
> List<String> stringList = new ArrayList<String>();  // error could not
> resolve class ArrayList<String>
>
> But If I do:
>
> List stringList = new ArrayList();  // this works fine!
>
>
> thx!
>
>
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Then-part-of-DRL-file-can-not-use-Java-Generic-tp4027465.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
>
_______________________________________________
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] Then part of DRL file can not use Java Generic?

wtang
Drools version 6.0, dialect "mvel":

package com.sample
 
import java.util.*;
import java.util.ArrayList;


rule "Internal Assignment with Map using constant and path"
    dialect "mvel"
        when
       $map: Map(this["EmailED.subject"] == "hello there")
       
    then
   
    ActionParam actionParam = new ActionParam();
    List actionParamList = new ArrayList();
    List actionList = new ArrayList();
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] Then part of DRL file can not use Java Generic?

laune
On 30/12/2013, wtang <[hidden email]> wrote:
> Drools version 6.0, dialect "mvel":

There you are. It's either generics or mvel.
-W

>
> package com.sample
>
> import java.util.*;
> import java.util.ArrayList;
>
>
> rule "Internal Assignment with Map using constant and path"
>     dialect "mvel"
> when
>        $map: Map(this["EmailED.subject"] == "hello there")
>
>     then
>    
>     ActionParam actionParam = new ActionParam();
>     List actionParamList = new ArrayList();
>     List actionList = new ArrayList();
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Then-part-of-DRL-file-can-not-use-Java-Generic-tp4027465p4027468.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
>
_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users