KieServices ks = KieServices.Factory.get();
KieFileSystem kfs = ks.newKieFileSystem();
ReleaseId id = ks.newReleaseId( "org.test", "foo", "1.0-SNAPSHOT" );
KieBuilder kieBuilder = ks.newKieBuilder( kfs );
kfs.generateAndWritePomXML( id );
kfs.write( ks.getResources()
.newReaderResource( new StringReader( drl1 ) )
.setResourceType( ResourceType.DRL )
.setSourcePath( "drl1.drl" ) );