Package org.kie.internal.builder
Class KnowledgeBuilderFactory
java.lang.Object
org.kie.internal.builder.KnowledgeBuilderFactory
This factory is used to build the knowledge base resources that are held collectively in
KnowledgePackages. The KnowledgePackage also provides the role of 'namespacing'. An optional
KnowlegeBuilderConfiguration can be supplied. The KnowledgeBuilderConfiguration is itself
created from this factory. The KnowledgeBuilderConfiguration allows you to set the ClassLoader to be used
along with other setting like the default dialect and compiler, as well as many other options.
KnowledgeBuilder kbuilder = KnowlegeBuilderFactory.newKnowledgeBuilder();
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DecisionTableConfigurationDecisionTable resources require a ResourceConfiguration, that configuration instance is created here.static JaxbConfigurationnewJaxbConfiguration(com.sun.tools.xjc.Options xjcOpts, String systemId) static KnowledgeBuilderCreate and return a new KnowledgeBuilder, using the default KnowledgeBuilderConfigurationsstatic KnowledgeBuildernewKnowledgeBuilder(KieBase kbase) static KnowledgeBuildernewKnowledgeBuilder(KieBase kbase, KnowledgeBuilderConfiguration conf) static KnowledgeBuilderCreate and return a new KnowledgeBuilder, using he given KnowledgeBuilderConfigurationsCreate a KnowledgeBuilderConfiguration on which properties can be set.newKnowledgeBuilderConfiguration(ClassLoader classLoader) newKnowledgeBuilderConfiguration(Properties properties, ClassLoader classLoader) Create a KnowledgeBuilderConfiguration on which properties can be set.
-
Constructor Details
-
KnowledgeBuilderFactory
public KnowledgeBuilderFactory()
-
-
Method Details
-
newKnowledgeBuilder
Create and return a new KnowledgeBuilder, using the default KnowledgeBuilderConfigurations- Returns:
- The KnowledgeBuilder
-
newKnowledgeBuilder
Create and return a new KnowledgeBuilder, using he given KnowledgeBuilderConfigurations- Returns:
- The KnowledgeBuilder
-
newKnowledgeBuilder
-
newKnowledgeBuilder
public static KnowledgeBuilder newKnowledgeBuilder(KieBase kbase, KnowledgeBuilderConfiguration conf) -
newKnowledgeBuilderConfiguration
Create a KnowledgeBuilderConfiguration on which properties can be set.- Returns:
- The KnowledgeBuilderConfiguration.
-
newKnowledgeBuilderConfiguration
public static KnowledgeBuilderConfiguration newKnowledgeBuilderConfiguration(ClassLoader classLoader) -
newKnowledgeBuilderConfiguration
public static KnowledgeBuilderConfiguration newKnowledgeBuilderConfiguration(Properties properties, ClassLoader classLoader) Create a KnowledgeBuilderConfiguration on which properties can be set. Use the given properties file and ClassLoader - either of which can be null.- Returns:
- The KnowledgeBuilderConfiguration.
-
newDecisionTableConfiguration
DecisionTable resources require a ResourceConfiguration, that configuration instance is created here. Note that if you are passing a Reader, you must use an InputStreamReader so the encoding can be determined.KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(); DecisionTableConfiguration dtconf = KnowledgeBuilderFactory.newDecisionTableConfiguration(); dtconf.setInputType( DecisionTableInputType.XLS ); dtconf.setWorksheetName( "Tables_2" ); kbuilder.add( new URL( "file://IntegrationExampleTest.xls" ), ResourceType.DTABLE, dtconf ); assertFalse( kbuilder.hasErrors() ); KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();- Returns:
-
newJaxbConfiguration
public static JaxbConfiguration newJaxbConfiguration(com.sun.tools.xjc.Options xjcOpts, String systemId)
-