Re: [rules-users] Simple question about String comparison in Drool

2012-03-08 Thread shawn
Thank you`

--
View this message in context: 
http://drools.46999.n3.nabble.com/Simple-question-about-String-comparison-in-Drool-tp3808352p3809203.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Simple question about String comparison in Drool

2012-03-07 Thread shawn
I insert several strings into working memory to make a comparison. But how to
compare a anonymous string to another string. code like:

List String s = ArrayList String
String key

function void insertValue( s, KnowledgeHelper kh ) {

for( String string : s ) {
kh.insert( string );
}

}
...
When
not $string : String( toString() == key)
Then
Obviously, toString() can not do this task.
How to get the string's value ?
Cheers.

--
View this message in context: 
http://drools.46999.n3.nabble.com/Simple-question-about-String-comparison-in-Drool-tp3808352p3808352.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Simple question about String comparison in Drool

2012-03-07 Thread Mauricio Salatino
you can just use String( this == key)

On Wed, Mar 7, 2012 at 11:32 PM, shawn youngxiao...@hotmail.com wrote:

 I insert several strings into working memory to make a comparison. But how
 to
 compare a anonymous string to another string. code like:

 List String s = ArrayList String
 String key

 function void insertValue( s, KnowledgeHelper kh ) {

for( String string : s ) {
kh.insert( string );
}

 }
 ...
 When
not $string : String( toString() == key)
 Then
 Obviously, toString() can not do this task.
 How to get the string's value ?
 Cheers.

 --
 View this message in context:
 http://drools.46999.n3.nabble.com/Simple-question-about-String-comparison-in-Drool-tp3808352p3808352.html
 Sent from the Drools: User forum mailing list archive at Nabble.com.
 ___
 rules-users mailing list
 rules-users@lists.jboss.org
 https://lists.jboss.org/mailman/listinfo/rules-users




-- 
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

 - Salatino Salaboy Mauricio -
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users