|
Rule Execution Server API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ilog.rules.archive.IlrRulesetArchiveBuilderBase
public class IlrRulesetArchiveBuilderBase
Builder of a simple ruleset archive. This class builds an archive without having the engine.jar
in the
classpath. Therefore, the signature of the ruleset is not computed. The hierarchical property, property type
declaration, and rule overriding declaration cannot be managed by this class. The
ilog.rules.engine.IlrRulesetArchiveBuilder
provides such an API.
Constructor Summary | |
---|---|
IlrRulesetArchiveBuilderBase()
Creates an IlrRulesetArchiveBuilderBase . |
Method Summary | |
---|---|
void |
addBusinessModelEntry(String businessModelName,
InputStream businessModelStream)
Adds a business object model to the archive. |
void |
addDynamicModelEntry(String modelName,
InputStream modelStream)
Adds a dynamic object model to the archive. |
void |
addFunctionEntry(String pkgName,
String fctName,
InputStream inputStream)
Adds a function to the ruleset archive. |
void |
addFunctionEntry(String pkgName,
String fctName,
String code)
Adds a function to the ruleset archive. |
void |
addIRLEntry(String irlName,
InputStream inputStream)
Stores the given IRL code in a single archive entry in the archive. |
void |
addMappingEntry(String b2XPath,
InputStream bom2XomStream)
Adds a mapping "Business to Execution" to the archive. |
void |
addRuleEntry(String pkgName,
String ruleName,
InputStream inputStream)
Adds a rule to the ruleset archive. |
void |
addRuleEntry(String pkgName,
String ruleName,
String code)
Adds a rule to the ruleset archive. |
void |
addRuleflowEntry(String pkgName,
String flowName,
InputStream inputStream)
Adds a flow to the ruleset archive. |
void |
addRuleflowEntry(String pkgName,
String flowName,
String code)
Adds a flow to the ruleset archive. |
void |
addSchema(String schemaNamespace,
String name,
InputStream inputStream)
Adds an XSD document to the archive. |
void |
addSchema(String schemaNamespace,
String name,
URL location)
Adds an XSD document URL to the archive. |
void |
addUserDataEntry(String userDataName,
InputStream userDataStream)
Adds a user data content to the archive. |
void |
addWsdlEntry(String wsdlName,
InputStream wsdlStream)
Adds a WSDL content to the archive. |
void |
addXsdEntry(String xsdName,
InputStream xsdStream)
Adds an XSD file to the archive. |
protected void |
defineCurrentArchiveBusiness(boolean isBusiness)
|
void |
enableBusinessXMLService(boolean enable)
|
IlrRulesetArchive |
generate()
Generates the ruleset archive with the contents given through the IlrRulesetArchiveBuilderBase API. |
String |
getEncoding()
Returns the encoding used to generate the archive for the archive elements that contain data provided by the user. |
String[] |
getErrors()
Returns the errors resulting from the archive building. |
void |
printErrors()
Prints errors on the message writer. |
void |
reset()
Resets the archive builder. |
void |
setBusinessModelPath(ArrayList businessModelPath)
Sets the business object model path. |
void |
setEncoding(String encoding)
Sets the encoding used to generate the archive for the archive elements that contain data provided by the user. |
void |
setEngineConfEntry(InputStream config)
Sets the engine configuration. |
void |
setMessageWriter(PrintWriter writer)
Sets the error message writer of the ruleset archive parser. |
void |
setVersion(int major,
int minor)
Sets the ruleset archive version with a major and minor version number. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IlrRulesetArchiveBuilderBase()
IlrRulesetArchiveBuilderBase
.
Method Detail |
---|
public void setEncoding(String encoding)
encoding
- The encoding used for the archive.public String getEncoding()
public void reset()
public void setMessageWriter(PrintWriter writer)
writer
- The writer to which error messages are printed.public void addIRLEntry(String irlName, InputStream inputStream)
irlName
- The IRL name used as the entry in the archive.inputStream
- The IRL code as a stream.public void addRuleEntry(String pkgName, String ruleName, String code)
credit.analysis
and a given entry name ComputeBenefits
, the
code is stored in the archive in the path credit/analysis/ComputeBenefits.irl
. The given code can
contain several rules. The entry name is not used by the engine during parsing. Therefore, there is no obligation
to give the rule name as an entry name.
pkgName
- The name of the package to which the rule belongs.ruleName
- The entry name.code
- The IRL rule code.public void addRuleEntry(String pkgName, String ruleName, InputStream inputStream)
credit.analysis
and a given entry name ComputeBenefits
, the
code is stored in the archive in the path credit/analysis/ComputeBenefits.irl
. The given code can
contain several rules. The entry name is not used by the engine during parsing. Therefore, there is no obligation
to give the rule name as an entry name. The given stream is closed after its contents have been archived.
pkgName
- The name of the package to which the rule belongs.ruleName
- The entry name.inputStream
- The IRL rule code as a stream.public void addFunctionEntry(String pkgName, String fctName, String code)
credit.analysis
and a given entry identifier
computeRate
, the code is stored in the archive in the path credit/analysis/computeRate.irl
.
The given code can contain several functions. The entry name is not used by the engine during parsing. Therefore,
there is no obligation to give the function name as an entry name.Note that the identifier must identify the function without ambiguity; therefore, in most cases this identifier cannot be the function name, but it may be the function signature because you can have several functions with the same name.
pkgName
- The name of the package to which the function belongs.fctName
- The entry identifier.code
- The IRL function code.public void addFunctionEntry(String pkgName, String fctName, InputStream inputStream)
credit.analysis
and a given entry identifier
computeRate
, the code is stored in the archive in the path credit/analysis/computeRate.irl
.
The given code can contain several functions. The entry name is not used by the engine during parsing. Therefore,
there is no obligation to give the function name as an entry name.Note that the identifier must identify the function without ambiguity; therefore, in most cases this identifier cannot be the function name, but it may be the function signature because you can have several functions with the same name.
The given stream is closed after its contents have been archived.
pkgName
- The name of the package to which the function belongs.fctName
- The entry identifier.inputStream
- The IRL function code as a stream.public void addRuleflowEntry(String pkgName, String flowName, String code)
credit.analysis
and a
given entry identifier ComputeCredit
, the code is stored in the archive in the path
credit/analysis/ComputeCredit.irl
. The entry name is not used by the engine during parsing. Therefore,
there is no obligation to give a task name as an entry name.
pkgName
- The name of the package to which the ruleflow belongs.flowName
- The entry name.code
- The IRL task code.public void addRuleflowEntry(String pkgName, String flowName, InputStream inputStream)
credit.analysis
and a
given entry identifier ComputeCredit
, the code is stored in the archive in the path
credit/analysis/ComputeCredit.irl
. The entry name is not used by the engine during parsing. Therefore,
there is no obligation to give a task name as an entry name. The given stream is closed after its contents have
been archived.
pkgName
- The name of the package to which the ruleflow belongs.flowName
- The entry name.inputStream
- The IRL task code as a stream.public void setVersion(int major, int minor)
major
- The major number of the version.minor
- The minor number of the version.public void setEngineConfEntry(InputStream config)
config
- The stream that contains the engine configuration.protected void defineCurrentArchiveBusiness(boolean isBusiness)
public void setBusinessModelPath(ArrayList businessModelPath)
java.lang.String
s. It
indicates the order in which the business models are loaded. Providing this information is mandatory as soon as
there is at least one business model, to ensure the model loading.
businessModelPath
- The business object model path to set.public void addBusinessModelEntry(String businessModelName, InputStream businessModelStream)
businessModelName
- The business object model name.businessModelStream
- The stream that contains the business object model.public void addMappingEntry(String b2XPath, InputStream bom2XomStream)
model.bom
business object model name, the mapping name must be model.b2x
. The
mappings are loaded in the order defined by the business object model path. The given stream is closed after its
contents have been archived.
b2XPath
- The mapping name.bom2XomStream
- The stream that contains the BOM to XOM mapping.public void addDynamicModelEntry(String modelName, InputStream modelStream)
modelName
- The model name.modelStream
- The stream that contains the model.public void enableBusinessXMLService(boolean enable)
public void addXsdEntry(String xsdName, InputStream xsdStream)
xsdName
- The XSD name.xsdStream
- The stream that contains the XSD.public void addSchema(String schemaNamespace, String name, InputStream inputStream)
schemaNamespace
- of the XSD documentname
- name used to identified the document.inputStream
- open stream to the document.public void addSchema(String schemaNamespace, String name, URL location)
schemaNamespace
- of the XSD document.name
- name used to identified the document.location
- URL to the XSD document.public void addWsdlEntry(String wsdlName, InputStream wsdlStream)
wsdlName
- The WSDL name.wsdlStream
- The stream that contains the WSDL.public void addUserDataEntry(String userDataName, InputStream userDataStream)
userDataName
- The user data name.userDataStream
- The stream that contains the user datapublic IlrRulesetArchive generate()
IlrRulesetArchiveBuilderBase
API.
The data is stored with the specified encoding; in case no encoding has been specified, UTF-8 is used by default.
IlrRulesetArchive
that contains all artifacts, models, and configurations passed by the
API.public String[] getErrors()
public void printErrors()
System.out
is taken
by default.
|
Rule Execution Server API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |