InternalKnowledgePackage pkg = new KnowledgePackageImpl( "org.drools" );
final RuleDescr ruleDescr = pkgDescr.getRules().get( 0 );
final RuleBuilder builder = new RuleBuilder();
final KnowledgeBuilderImpl pkgBuilder = new KnowledgeBuilderImpl( pkg );
final KnowledgeBuilderConfigurationImpl conf = pkgBuilder.getBuilderConfiguration();
DialectCompiletimeRegistry dialectRegistry = pkgBuilder.getPackageRegistry( pkg.getName() ).getDialectCompiletimeRegistry();
Dialect dialect = dialectRegistry.getDialect( "mvel" );
RuleBuildContext context = new RuleBuildContext( pkgBuilder,
ruleDescr,
dialectRegistry,
pkg,
dialect );
builder.build( context );
assertTrue( context.getErrors().toString(),
context.getErrors().isEmpty() );
final RuleImpl rule = context.getRule();