I think you need to use a little bit of magical casting: ((AbstractRuleBase) ((InternalKnowledgeBase) kbase).getRuleBase()).addProcess(process);
A complete test cold be found here: https://github.com/krisv/jbpm/blob/master/jbpm-flow/src/test/java/org/jbpm/process/ForEachTest.java I know it is a jbpm's test, but if you want to use it in drools-flow you only need to change the imports I think. Best Regards, XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Esteban Aliverti - Developer @ http://www.plugtree.com - Blog @ http://ilesteban.wordpress.com 2011/2/11 Swindells, Thomas <[email protected]> > We are currently defining our knowledge base in a spring context file > like this: > > <drools:kbase id=*"packKbase"*> > > <drools:resources> > > <drools:resource type=*"DRL"* > > source=*"classpath:pack/drools/1.drl"* /> > > <drools:resource type=*"DRL"* > > source=*"classpath:pack/drools/2.drl"* /> > > <drools:resource type=*"DRL"* > > source=*"classpath:pack/drools/3.drl"* /> > > <drools:resource type=*"DRL"* > > source=*"classpath:pack/drools/4.drl"* /> > > <drools:resource type=*"DRF"* > > source=*"classpath:pack/drools/FLOW.rf"* /> > > </drools:resources> > > > > <drools:configuration> > > <drools:mbeans enabled=*"true"* /> > > </drools:configuration> > > </drools:kbase> > > > > Ie a load of drl files and a rulesflow file. > > We’ve now decided that we would rather generate the ruleflow > programmatically rather than in an rf file (the process is very very regular > and so it will be a lot quicker to just generate it). > > > > What is the best way to add a programmatically declared process to the rest > of the knowledge base? > > > > Thanks, > > > > Thomas > > ------------------------------ > > > ************************************************************************************** > This message is confidential and intended only for the addressee. If you > have received this message in error, please immediately notify the > [email protected] and delete it from your system as well as any copies. > The content of e-mails as well as traffic data may be monitored by NDS for > employment and security purposes. To protect the environment please do not > print this e-mail unless necessary. > > NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 > 4EX, United Kingdom. A company registered in England and Wales. Registered > no. 3080780. VAT no. GB 603 8808 40-00 > > ************************************************************************************** > > _______________________________________________ > rules-users mailing list > [email protected] > https://lists.jboss.org/mailman/listinfo/rules-users > >
_______________________________________________ rules-users mailing list [email protected] https://lists.jboss.org/mailman/listinfo/rules-users
