// forall can be translated into
// not( basePattern and not( <remaining_patterns>+ ) )
// so we just do that:
final GroupElement and = GroupElementFactory.newAndInstance();
and.addChild( forall.getBasePattern() );
final GroupElement not2 = GroupElementFactory.newNotInstance();
not2.setForallBaseObjectType( forall.getBasePattern().getObjectType() );
if ( forall.getRemainingPatterns().size() == 1 ) {
not2.addChild( (Pattern) forall.getRemainingPatterns().get( 0 ) );
and.addChild( not2 );
} else if ( forall.getRemainingPatterns().size() > 1 ) {
final GroupElement and2 = GroupElementFactory.newAndInstance();
for ( final Iterator it = forall.getRemainingPatterns().iterator(); it.hasNext(); ) {
and2.addChild( (Pattern) it.next() );
}
not2.addChild( and2 );
and.addChild( not2 );
}
final GroupElement not = GroupElementFactory.newNotInstance();
not.addChild( and );
// get builder for the CEs
final ReteooComponentBuilder builder = utils.getBuilderFor( not );
// builds the CEs