Assuming that this part of the API is meant to be used like this:<br><br>   List&lt;String&gt; declIds = );<br>   for( String declId: activation.getDeclarationIDs( ){<br>      Object declVal = activation.getDeclarationValue( declId );<br>
      // ...<br>   }<br><br>I&#39;m using this during ActivationEvent logging. If, however, a<br>fact is retracted, this code, when executed for an<br>AfterActivationFiredEvent, throws a NPE when declId is a<br>binding for a component of the retracted fact.<br>
<br>The optimum solution would be to not get such useless bindings<br>in the List&lt;String&gt; returned by getDeclarationIDs() which<br>is in AgendaItem.java. I have added the if-statement:<br><br>    public List&lt;String&gt; getDeclarationIDs() {<br>
        Declaration[] declArray = this.getRule().getDeclarations(); <br>        List&lt;String&gt; declarations = new ArrayList&lt;String&gt;();<br>        for( Declaration decl : declArray ) {<br>            // return only &quot;sound&quot; declaration IDs<br>
            if( this.tuple.get( decl ).getObject() != null ){<br>                declarations.add( decl.getIdentifier() );<br>            }<br>        }<br>        return Collections.unmodifiableList( declarations );<br>    }<br>
<br>This is untested!<br>-W<br><br><br><br>