[rules-users] PMML - Exception excuting consequence for rule xxx in yyy: java.lang.NullPointerException : using KnowledgeAgent

smilk sunghee.bae at meritz.co.kr
Wed Jul 17 20:44:44 EDT 2013


rule "Link RPart_ModelInput"
 
 when
    RPart_ModelInput(
       
          _AC_CSE_TYP_RE   :  AC_CSE_TYP_RE
       ,
          _AC_TYP_RE   :  AC_TYP_RE
       ,
          _COV_CD_RE   :  COV_CD_RE
       ,
          _HDCAP_RATE_RE   :  HDCAP_RATE_RE
       ,
          _AC_STAT_CD_RE   :  AC_STAT_CD_RE
       ,
          _FDS_AC_YN   :  FDS_AC_YN
       ,
          _AGE_GRD   :  AGE_GRD
       ,
          _AC_COT_DAY   :  AC_COT_DAY
       
    )
 then
    	System.out.println("Link RPart_ModelInput");
    
        drools.getEntryPoint("in_AC_CSE_TYP_RE").insert(_AC_CSE_TYP_RE);
    
        drools.getEntryPoint("in_AC_TYP_RE").insert(_AC_TYP_RE);
    
        drools.getEntryPoint("in_COV_CD_RE").insert(_COV_CD_RE);
    
        drools.getEntryPoint("in_HDCAP_RATE_RE").insert(_HDCAP_RATE_RE);
    
        drools.getEntryPoint("in_AC_STAT_CD_RE").insert(_AC_STAT_CD_RE);
    
        drools.getEntryPoint("in_FDS_AC_YN").insert(_FDS_AC_YN);
    
        drools.getEntryPoint("in_AGE_GRD").insert(_AGE_GRD);
    
        drools.getEntryPoint("in_AC_COT_DAY").insert(_AC_COT_DAY);
    
 end


rule "Eval Tree Node RPart_Model - 1 - Down"
salience $children.size() - $children.indexOf( $child )

when
    $node : TreeNode( context == "RPart_Model", $id : id == "1", $children :
children, children.size > 0 )
    $tok  : RPart_ModelTreeToken( context == "RPart_Model", current == "1",
$trail : trail,
                                 ( 1 == 1 ) || ( visitMode ==
"AGGREGATE_NODES" && ( false ) ) )
    $child : String( this not memberOf $trail ) from $children
then
    System.out.println( "Visiting node 1, going down to " + $child );
    modify ( $tok ) {
        getTrail().add( $child ),
        setDownward( true ),
        setCurrent( $child );
    }
end


rule "Eval Tree Node RPart_Model - 1 - True"
salience 3
no-loop
when
    $node : TreeNode( context == "RPart_Model", $id : id == "1", $out :
outcome,
                      children.size == 0, $conf : confidence, $tot :
recordCount )
    $tok  : RPart_ModelTreeToken( context == "RPart_Model", current == "1",
$baseConf : confidence,
                                 $res : results, results.keySet not contains
"1",
                                 visitMode != "AGGREGATE_NODES",
                                 1 == 1
                               )
then
    System.out.println( "TRUE Solution found at 1 !!!! " );
    modify( $tok ) {
       setConfidence( $baseConf * ( $conf.containsKey( $out ) ? (Double)
$conf.get( $out ) : 1.0 ) ),
       setTotalCount( $tot ),
       setOutcome( $out ),
       setCurrent( "null" );
    }
end


rule "Eval Tree Node RPart_Model - 1 - Unknown Weighted"
salience 3
when
    $node : TreeNode( context == "RPart_Model", $id : id == "1", $out :
outcome )
    $tok  : RPart_ModelTreeToken( context == "RPart_Model", current == "1",
                                 visitMode == "WEIGHTED_CONFIDENCE" || ==
"LAST_PREDICTION" || == "NULL_PREDICTION",
                                 results.keySet not contains "1",
                                 false )
then
    System.out.println( "UNKNOWN found at 1, collecting for later evaluation
!!!! " );
    modify ( $tok ) { getResults().put( "1", $out ); }
end


rule "Eval Tree Node RPart_Model - 1 - Default Child"
salience 3
when
    $node : TreeNode( context == "RPart_Model", $id : id == "1", $def :
defaultChld != "null" && != null )
    $tok  : RPart_ModelTreeToken( context == "RPart_Model", current == "1",
visitMode == "DEFAULT_CHILD", downward == true,
                                 results.keySet not contains "1", $conf :
confidence,
                                 false )
then
    System.out.println( "UNKNOWN found at 1 !!!!, JUMPING TO Default Child "
+ $def );
    modify ( $tok ) {
        setConfidence( $conf * 1.0 ),
        setCurrent( $def );
    }
end


rule "Eval Tree Node RPart_Model - 1 - Default Child Undo Jump"
salience 5
no-loop
when
    $node : TreeNode( context == "RPart_Model", $id : id == "1", $def :
defaultChld != "null" && != null )
    $tok  : RPart_ModelTreeToken( context == "RPart_Model", current == "1",
visitMode == "DEFAULT_CHILD", downward == false, $conf : confidence,
                                 false )
then
    System.out.println( "UNKNOWN found at 1 !!!!, UNDOING JUMP penalty " +
$def );
    modify ( $tok ) {
        setConfidence( $conf / 1.0 );
    }
end


rule "Eval Tree Node RPart_Model - 3 - Down"
salience $children.size() - $children.indexOf( $child )

when
    $node : TreeNode( context == "RPart_Model", $id : id == "3", $children :
children, children.size > 0 )
    $tok  : RPart_ModelTreeToken( context == "RPart_Model", current == "3",
$trail : trail,
                                 ( ( mAC_CSE_TYP_RE == false &&
vAC_CSE_TYP_RE in ( "group1" ) ) || ( ( mAC_STAT_CD_RE == true  ) && ( (
mAC_STAT_CD_RE == false && vAC_STAT_CD_RE in ( "emptystar" ) ) ) ) ) || (
visitMode == "AGGREGATE_NODES" && ( ( ( mAC_CSE_TYP_RE == true  ) ) || ( (
mAC_STAT_CD_RE == true  ) ) ) ) )
    $child : String( this not memberOf $trail ) from $children
then
    System.out.println( "Visiting node 3, going down to " + $child );
    modify ( $tok ) {
        getTrail().add( $child ),
        setDownward( true ),
        setCurrent( $child );
    }
end


rule "Eval Tree Node RPart_Model - 3 - True"
salience 3
no-loop
when
    $node : TreeNode( context == "RPart_Model", $id : id == "3", $out :
outcome,
                      children.size == 0, $conf : confidence, $tot :
recordCount )
    $tok  : RPart_ModelTreeToken( context == "RPart_Model", current == "3",
$baseConf : confidence,
                                 $res : results, results.keySet not contains
"3",
                                 visitMode != "AGGREGATE_NODES",
                                 ( mAC_CSE_TYP_RE == false && vAC_CSE_TYP_RE
in ( "group1" ) ) || ( ( mAC_STAT_CD_RE == true  ) && ( ( mAC_STAT_CD_RE ==
false && vAC_STAT_CD_RE in ( "emptystar" ) ) ) )
                               )
then
    System.out.println( "TRUE Solution found at 3 !!!! " );
    modify( $tok ) {
       setConfidence( $baseConf * ( $conf.containsKey( $out ) ? (Double)
$conf.get( $out ) : 1.0 ) ),
       setTotalCount( $tot ),
       setOutcome( $out ),
       setCurrent( "null" );
    }
end




--
View this message in context: http://drools.46999.n3.nabble.com/PMML-Exception-excuting-consequence-for-rule-xxx-in-yyy-java-lang-NullPointerException-using-Knowledt-tp4024963p4025002.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list