[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:25:16 EDT 2013


*3. PMML Source (2)*


// Display Name : null
 
 declare AC_CSE_TYP_RE extends  DataField 
  @role(event)
  @Traitable

    value : java.lang.String @key @position(1) 
    displayValue : String =  "AC_CSE_TYP_RE" 

    weight : double     = 1.0

    
 end


rule "Valid_Values_AC_CSE_TYP_RE"

no-loop
salience 9999
when
    $in : AC_CSE_TYP_RE( $val : value, valid == false,
          
           value == "group0"  ||  value == "group1" 
          )
then
    System.out.println("--- Invalid -> valid " + $in);
    modify ( $in ) {
        setValid( true );
    }
end


rule "Input_AC_CSE_TYP_RE"
when
    $in : java.lang.String() from entry-point "in_AC_CSE_TYP_RE"
    not AC_CSE_TYP_RE( value == $in, context == null )
then
    // java.lang.String
    AC_CSE_TYP_RE input = new AC_CSE_TYP_RE();
        input.setValue( $in );
        input.setName("AC_CSE_TYP_RE");
        input.setMissing(false);
        input.setValid(false);
        input.setContext(null);
    System.out.println("Rule " + drools.getRule().getName() + " for input "
+ $in + " : will insert  " + input.toString());
    retract( $in );
    insert( input );
end


rule "OverrideInput_AC_CSE_TYP_RE"
salience 2
when
    $new: java.lang.String() from entry-point "in_AC_CSE_TYP_RE"
    $old: AC_CSE_TYP_RE( value != $new )
then
    System.out.println(" Overriding previous values " + $old + " because of
" + $new );
    retract( $old );
end


 // Display Name : null
 
 declare AC_STAT_CD_RE extends  DataField 
  @role(event)
  @Traitable

    value : java.lang.String @key @position(1) 
    displayValue : String =  "AC_STAT_CD_RE" 

    weight : double     = 1.0

    
 end


rule "Valid_Values_AC_STAT_CD_RE"

no-loop
salience 9999
when
    $in : AC_STAT_CD_RE( $val : value, valid == false,
          
           value == "emptyStar"  ||  value == "group0"  ||  value ==
"group1"  ||  value == "group2"  ||  value == "group3" 
          )
then
    System.out.println("--- Invalid -> valid " + $in);
    modify ( $in ) {
        setValid( true );
    }
end


rule "Input_AC_STAT_CD_RE"
when
    $in : java.lang.String() from entry-point "in_AC_STAT_CD_RE"
    not AC_STAT_CD_RE( value == $in, context == null )
then
    // java.lang.String
    AC_STAT_CD_RE input = new AC_STAT_CD_RE();
        input.setValue( $in );
        input.setName("AC_STAT_CD_RE");
        input.setMissing(false);
        input.setValid(false);
        input.setContext(null);
    System.out.println("Rule " + drools.getRule().getName() + " for input "
+ $in + " : will insert  " + input.toString());
    retract( $in );
    insert( input );
end


rule "OverrideInput_AC_STAT_CD_RE"
salience 2
when
    $new: java.lang.String() from entry-point "in_AC_STAT_CD_RE"
    $old: AC_STAT_CD_RE( value != $new )
then
    System.out.println(" Overriding previous values " + $old + " because of
" + $new );
    retract( $old );
end


 // Display Name : null
 
 declare AC_TYP_RE extends  DataField 
  @role(event)
  @Traitable

    value : java.lang.String @key @position(1) 
    displayValue : String =  "AC_TYP_RE" 

    weight : double     = 1.0

    
 end


rule "Valid_Values_AC_TYP_RE"

no-loop
salience 9999
when
    $in : AC_TYP_RE( $val : value, valid == false,
          
           value == "A"  ||  value == "B"  ||  value == "Caution"  ||  value
== "Normal" 
          )
then
    System.out.println("--- Invalid -> valid " + $in);
    modify ( $in ) {
        setValid( true );
    }
end


rule "Input_AC_TYP_RE"
when
    $in : java.lang.String() from entry-point "in_AC_TYP_RE"
    not AC_TYP_RE( value == $in, context == null )
then
    // java.lang.String
    AC_TYP_RE input = new AC_TYP_RE();
        input.setValue( $in );
        input.setName("AC_TYP_RE");
        input.setMissing(false);
        input.setValid(false);
        input.setContext(null);
    System.out.println("Rule " + drools.getRule().getName() + " for input "
+ $in + " : will insert  " + input.toString());
    retract( $in );
    insert( input );
end


rule "OverrideInput_AC_TYP_RE"
salience 2
when
    $new: java.lang.String() from entry-point "in_AC_TYP_RE"
    $old: AC_TYP_RE( value != $new )
then
    System.out.println(" Overriding previous values " + $old + " because of
" + $new );
    retract( $old );
end


 // Display Name : null
 
 declare HDCAP_RATE_RE extends  DataField 
  @role(event)
  @Traitable

    value : java.lang.String @key @position(1) 
    displayValue : String =  "HDCAP_RATE_RE" 

    weight : double     = 1.0

    
 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-tp4024963p4024992.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list