use of org.drools.core.rule.EntryPointId in project drools by kiegroup.
the class EntryPointBuilder method build.
/* (non-Javadoc)
* @see org.kie.reteoo.builder.ReteooComponentBuilder#build(org.kie.reteoo.builder.BuildContext, org.kie.reteoo.builder.BuildUtils, org.kie.rule.RuleConditionElement)
*/
public void build(BuildContext context, BuildUtils utils, RuleConditionElement rce) {
final EntryPointId entry = (EntryPointId) rce;
context.setCurrentEntryPoint(entry);
EntryPointNode epn = context.getKnowledgeBase().getRete().getEntryPointNode(entry);
if (epn == null) {
NodeFactory nFactory = context.getComponentFactory().getNodeFactoryService();
context.setObjectSource(utils.attachNode(context, nFactory.buildEntryPointNode(context.getNextId(), context.getKnowledgeBase().getRete(), context)));
} else {
context.setObjectSource(epn);
}
}
Aggregations