This uses several terms I&#39;m not familiar with in this context, but it seems that<br><ol><li>a ule uniquely determines a Class to be instantiated on its RHS</li><li>a set of parameters is required that, in turn, depends on the Class determined according to (1).</li>
</ol>I do not understand why these parameters cannot be inserted as facts.<br><br>Each parameter set (!) would be a fact with one field containing the Class, and this could be matched in the rule, passing parameters to the processing to be done in the same rule.<br>
<br>      $p: Params( clazz == (FactorType1.class), $pSet: paramSet )<br><br>-W<br><br><br><div class="gmail_quote">On 27 September 2011 15:11, JohnnyCaimbridge <span dir="ltr">&lt;<a href="mailto:nbower@nycm.com">nbower@nycm.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">NOTE: Reposted because I only just subscribed to the mailing list.<br>
<br>
Hello,<br>
<br>
I have a set of Fact types which represent factors matched and used<br>
throughout the other rules.  Each of these Fact types may be derived in a<br>
variety of mutually exclusive ways--ie based on the line of business or<br>
other factors.  The rules are all well-defined for these Facts.  Something<br>
like this:<br>
<br>
declare FactorType1<br>
   value : BigDecimal<br>
end<br>
<br>
rule &quot;FactorType1&quot;<br>
when<br>
   LineOfBusiness( this == LineOfBusiness.LOB1 )<br>
   // some other conditions<br>
   $prms : Params() // ***provisional*** where to specify needed context<br>
dependent parameters? see below<br>
then<br>
   BigDecimal value = new BigDecimal(&quot;0&quot;);<br>
   // ... determine value based on conditions and $prms<br>
   insert( new FactorType1(value) );<br>
end<br>
<br>
// &lt;some other mutually exclusive rules to derive FactorType1 here&gt;<br>
<br>
The problem is that in the rules which match these Facts, there are many<br>
context dependent (ie *always* unique to that particular rule) parameters<br>
which must be &quot;passed&quot; to the derivation of those Facts.  I&#39;m referring to<br>
these as &quot;Params&quot; above.  Now, a rule that uses FactorType1:<br>
<br>
rule &quot;a rule that uses FactorType1&quot;<br>
when<br>
   // some conditions<br>
   FactorType1( $value )<br>
   $prms : Params(prm1,prm2,prm3,...) // ***provisional*** how to indicate<br>
that FactorType1 should use these parameters in its derivation?<br>
then<br>
   // perform some calculation with $value<br>
end<br>
<br>
The parameters which these Facts use cannot be asserted as Facts themselves.<br>
They are unique to the rules which match on the FactorTypes, so that would<br>
mean I&#39;d need a duplicate rule for every rule that uses a FactorType (even<br>
with &quot;rule inheritance&quot;, this is excessive).<br>
<br>
It&#39;s almost as if I need to specify a &quot;partial derivation&quot; or &quot;partial<br>
unification&quot; of the Fact type, which is only asserted once a rule indicates<br>
that it is providing the &quot;unbound&quot; portion of the derivation.  I understand<br>
queries can be used for some sort of partial unification, but I have no clue<br>
how to apply them to my problem and I can&#39;t find any good examples or<br>
documentation on their usage/behavior.<br>
<br>
Thanks in advance<br>
<font color="#888888"><br>
<br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Partial-Unification-Derivation-of-Facts-tp3372546p3372546.html" target="_blank">http://drools.46999.n3.nabble.com/Partial-Unification-Derivation-of-Facts-tp3372546p3372546.html</a><br>

Sent from the Drools: User forum mailing list archive at Nabble.com.<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" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</font></blockquote></div><br>