optaplanner-core/src/main/java/org/optaplanner/core/impl/score/director/drools/DroolsScoreDirector.java
@Override
    public void afterProblemFactAdded(Object problemFact) {
        if (kieSession.getFactHandle(problemFact) != null) {
            throw new IllegalArgumentException("The problemFact (" + problemFact
                    + ") was already added to this ScoreDirector.\n"
                    + "Maybe that specific instance is already in the "
                    + PlanningSolution.class.getSimpleName() + "'s problem fact members ("
                    + getSolutionDescriptor().getProblemFactMemberAndProblemFactCollectionMemberNames() + ").\n"
                    + "Maybe use before/afterProblemPropertyChanged() instead of before/afterProblemFactAdded().");
        }
        kieSession.insert(problemFact);
        super.afterProblemFactAdded(problemFact);
    }
@Override
    public void afterProblemFactAdded(Object problemFact) {
        if (kieSession.getFactHandle(problemFact) != null) {
            throw new IllegalArgumentException("The problemFact (" + problemFact
                    + ") was already added to this ScoreDirector.\n"
                    + "Maybe that specific instance is already in the "
                    + PlanningSolution.class.getSimpleName() + "'s problem fact members ("
                    + getSolutionDescriptor().getProblemFactMemberAndProblemFactCollectionMemberNames() + ").\n"
                    + "Maybe use before/afterProblemPropertyChanged() instead of before/afterProblemFactAdded().");
        }
        kieSession.insert(problemFact);
        super.afterProblemFactAdded(problemFact);
    }
@ Override public void afterProblemFactAdded ( Object problemFact ) { if ( kieSession . getFactHandle ( problemFact ) != null ) { throw new IllegalArgumentException ( "The problemFact (" + problemFact + ") was already added to this ScoreDirector.\n" + "Maybe that specific instance is already in the " + PlanningSolution . class . getSimpleName ( ) + "'s problem fact members (" + getSolutionDescriptor ( ) . getProblemFactMemberAndProblemFactCollectionMemberNames ( ) + ").\n" + "Maybe use before/afterProblemPropertyChanged() instead of before/afterProblemFactAdded()." ) ; } kieSession . insert ( problemFact ) ; super . afterProblemFactAdded ( problemFact ) ; }
public void beforeProblemFactAdded(Object problemFact) // Do nothing
public void beforeProblemFactAdded ( Object problemFact ) // Do nothing