이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 19. Hello World Example
19.1. HelloWorld Example: Creating the KnowledgeBase and Session 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
- A
KnowledgeBuilder
is used to turn a DRL source file intoPackage
objects which the Knowledge Base can consume. - The add method takes a
Resource
interface and a Resource Type as parameters. TheResource
can be used to retrieve a DRL source file from various locations; in this case the DRL file is being retrieved from the classpath using aResourceFactory
, but it could come from a disk file or a URL. - Multiple packages of different namespaces can be added to the same Knowledge Base.
- While the Knowledge Base will validate the package, it will only have access to the error information as a String, so if you wish to debug the error information you should do it on the
KnowledgeBuilder
instance. - Once the builder is error free, get the
Package
collection, instantiate aKnowledgeBase
from theKnowledgeBaseFactory
and add the package collection.