Jason,
once you have your RuleFlowProcess instance you can add it directly
into the KnowledgeBase as follows:
RuleFlowProcess process = new RuleFlowProcess();
// ruleflow definition
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
((AbstractRuleBase) ((InternalKnowledgeBase)
kbase).getRuleBase()).addProcess(process);
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
Hope it helps.
Best.
2010/10/21 Jason van Zyl <jason(a)maven.org>:
Hi,
I have been following the documentation to create a RuleFlowProcess, and I
went the route of creating the flow programmatically, but I can't find an
example of adding this process to the knowledge builder. It seems to want an
external resource of a given type. In my little code scenario below how
would I add this programmatically created RuleFlowProcess?
DefaultFlowGenerator flowGenerator = new DefaultFlowGenerator();
RuleFlowProcess flow = flowGenerator.generateFlow( "flow" );
KnowledgeBuilder knowledgeBuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder();
knowledgeBuilder.add( flow.getResource() /* this is null */, null /*
what do i put here*/ );
Do I have to serialize to an external form and deserialize?
Thanks,
Jason
----------------------------------------------------------
Jason van Zyl
Founder, Apache Maven
http://twitter.com/jvanzyl
---------------------------------------------------------
Three people can keep a secret provided two of them are dead.
-- Unknown
Thanks,
Jason
----------------------------------------------------------
Jason van Zyl
Founder, Apache Maven
http://twitter.com/jvanzyl
---------------------------------------------------------
We know what we are, but know not what we may be.
-- Shakespeare
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users