<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
<br>This way my rule doesn't match<br><br>At the moment i only provide Foo objects as facts. Do i have to provide also the field prop objects as facts for the rule to match?<br><br><hr id="stopSpelling">Date: Wed, 8 Apr 2009 12:26:01 -0400<br>Subject: Re: [rules-users] Explicit class cast in RHS<br>From: dsinclair@chariotsolutions.com<br>To: rules-users@lists.jboss.org<br><br>rule "abc"<br><br>when<br>&nbsp;&nbsp;&nbsp;&nbsp; Foo($prop : prop)<br>&nbsp;&nbsp;&nbsp;&nbsp; TypeA (this == $prop, name == "PropertyA")<br>then<br>...<br><br><div class="EC_gmail_quote">2009/4/8 Alessandro Terrinoni <span dir="ltr">&lt;<a href="mailto:aleterrinoni@hotmail.com">aleterrinoni@hotmail.com</a>&gt;</span><br>
<blockquote class="EC_gmail_quote" style="padding-left: 1ex;">



<div>
Hello<br><br>in my working memory I insert an object like this<br><br>public class Foo{<br><blockquote>private IntType prop;<br><br>...<br></blockquote>}<br><br>where IntType is a class, but in practice <i>prop</i> is either of type TypeA or TypeB, both extending the IntType class.<br>
<br><br>then i have a rule like this:<br><br>rule "abc"<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; when<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Foo(p : prop, <a href="http://p.name">p.name</a> == "propertyA")<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; then <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // call some method defined only in the TypeA class<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>end<br><br><br>how do i explicitly cast p into a TypeA object to call the method defined only in that class?<br><br>thanks in advance,<br><font color="#888888">Alessandro Terrinoni<br>
<hr>Scegli fra pił di 30 stazioni!  <a href="http://clk.atdmt.com/GBL/go/140630364/direct/01/">Ascolta la radio su Messenger</a></font></div>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br><br /><hr />Scegli fra pił di 30 stazioni!  <a href='http://clk.atdmt.com/GBL/go/140630364/direct/01/' target='_new'>Ascolta la radio su Messenger</a></body>
</html>