private void renderSubPattern( final CompositeFactPattern pattern,
final int subIndex ) {
if ( pattern.getPatterns() == null || pattern.getPatterns().length == 0 ) {
return;
}
IFactPattern subPattern = pattern.getPatterns()[ subIndex ];
if ( subPattern instanceof FactPattern ) {
final LHSGeneratorContext gctx = generatorContextFactory.newChildGeneratorContext( rootContext,
subPattern );
this.generateFactPattern( (FactPattern) subPattern,
gctx );
} else if ( subPattern instanceof FromAccumulateCompositeFactPattern ) {
this.visitFromAccumulateCompositeFactPattern( (FromAccumulateCompositeFactPattern) subPattern,
true );
} else if ( subPattern instanceof FromCollectCompositeFactPattern ) {
this.visitFromCollectCompositeFactPattern( (FromCollectCompositeFactPattern) subPattern,
true );
} else if ( subPattern instanceof FromCompositeFactPattern ) {
this.visitFromCompositeFactPattern( (FromCompositeFactPattern) subPattern,
true );
} else {
throw new IllegalStateException( "Unsupported Pattern: " + subPattern.getClass().getName() );
}
}