public final class MetadataHelper
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
MetadataHelper.DFParm
DFParm is a struct representing parameter options for decision functions.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
addDecisionFunctionChild(DecisionFunction parent, DecisionFunction child)
Appends a child DecisionFunction to the current DecisionFunction Both DecisionFunction instances must reside in the same dictionary.
|
static void |
addDecisionFunctionInput(DecisionFunction df, MetadataHelper.DFParm parm)
Appends an input parameter to a decision function's input table
|
static void |
addDecisionFunctionOutput(DecisionFunction df, MetadataHelper.DFParm parm)
Appends an output parameter to a decision function's output table
|
static void |
addDecisionFunctionRuleSet(DecisionFunction df, java.lang.String alias)
Appends a RuleSet name to a decision function's ruleset table.
|
static DecisionFunction |
createDecisionFunction(RuleDictionary rd, java.lang.String dfName, java.lang.String ftName, boolean isWebService, boolean isPAStyle)
Creates a new Decision Function, overwriting any previously existing instance.
|
static RuleDictionary |
createDictionary(java.lang.String name)
Create a new empty RuleDictionary with a new empty data model.
|
static RuleDictionary |
createDictionary(java.lang.String name, DictionaryFinder finder)
Create a new empty RuleDictionary with a new empty data model.
|
static DictionaryLink |
createDictionaryLink(RuleDictionary rd, java.lang.String dictPackage, java.lang.String dictName) |
static void |
ensureRuleSetIsDefined(RuleDictionary rd, java.lang.String name)
If a RuleSet by the given name is not already in the dictionary instance, this method adds it.
|
static UndoableEdit |
importAdfBcFactType(RuleDictionary rd, java.lang.String viewDefName)
Creates a new ADF-BC fact type based on a given View Definition
|
static UndoableEdit |
importAdfBcFactTypes(RuleDictionary rd, java.util.List<java.lang.String> viewDefNames)
Creates new ADF-BC fact types based on the given View Definitions
|
static UndoableEdit |
importJavaFactTypes(RuleDictionary rd, java.util.List<java.lang.String> javaTypeNames)
Adds new fact types to the dictionary based on Java classes
|
static RuleDictionary |
loadDictionary(java.io.File file)
Loads a dictionary from the specified File using UTF-8 decoding.
|
static RuleDictionary |
loadDictionary(java.io.File file, DictionaryFinder finder)
Loads a dictionary from the specified File using UTF-8 decoding.
|
static RuleDictionary |
loadOrCreateDictionary(java.lang.String fileName)
Loads a dictionary from file path parameter if it exists, or creates a new RuleDictionary with the un-suffixed name of the file, but does not write it to the disk (e.g., the path "/scratch/Foo.rules" will create a a dictionary with the name "Foo".
|
static RuleDictionary |
loadOrCreateDictionary(java.lang.String fileName, DictionaryFinder finder)
Loads a dictionary from file path parameter if it exists, or creates a new RuleDictionary with the un-suffixed name of the file, but does not write it to the disk (e.g., the path "/scratch/Foo.rules" will create a a dictionary with the name "Foo".
|
static RuleDictionary |
readDictionary(java.lang.String pkg, java.lang.String name) |
static RuleDictionary |
readDictionary(java.lang.String pkg, java.lang.String name, java.lang.ClassLoader loader)
Loads a named dictionary using the specified classloader This loads the dictinoary from the configured MDS repository and finds the DecisionPointDictionary on the classpath from the file rulesdk2.jar
|
static void |
removeDecisionFunction(RuleDictionary rd, java.lang.String name, boolean removeSubordinates)
removes a decision function from the dictionary
|
static void |
removeRuleset(RuleDictionary rd, java.lang.String name)
removes a named ruleset from the dictionary
|
static java.util.List<SDKWarning> |
writeDictionary(RuleDictionary rd, java.io.File file)
Writes a RuleDictionary to the specified File using UTF-8 encoding.
|
static java.util.List<SDKWarning> |
writeDictionary(java.lang.String fileName, RuleDictionary rd)
Deprecated.
|
public static RuleDictionary readDictionary(java.lang.String pkg, java.lang.String name, java.lang.ClassLoader loader) throws SDKException
pkg - the fully qualified package com.mycompany.rulesname - the name of the dictionary (without prefix) e.g. MyDictionaryloader - the classloader instance to be used to load the dictionarySDKException - if the dictionary can not be readpublic static RuleDictionary readDictionary(java.lang.String pkg, java.lang.String name) throws SDKException
SDKExceptionpublic static void addDecisionFunctionInput(DecisionFunction df, MetadataHelper.DFParm parm) throws SDKException
df - a DecisionFunction instanceparm - the parameter description to be addedSDKExceptionpublic static void addDecisionFunctionOutput(DecisionFunction df, MetadataHelper.DFParm parm) throws SDKException
df - a DecisionFunction instanceparm - the parameter description to be addedSDKExceptionpublic static void addDecisionFunctionRuleSet(DecisionFunction df, java.lang.String alias)
df - the decision function to be modifiedalias - the alias of the RuleSet to be includedpublic static void addDecisionFunctionChild(DecisionFunction parent, DecisionFunction child)
public static void ensureRuleSetIsDefined(RuleDictionary rd, java.lang.String name)
public static java.util.List<SDKWarning> writeDictionary(RuleDictionary rd, java.io.File file) throws SDKException, java.io.IOException
rd - the dictionary to writefile - the File to write tojava.io.IOException - if there is an problem writing to the fileSDKException - if there is an problem updating the dictionaryMetadataHelper.writeDictionary(RuleDictionary, File)public static RuleDictionary loadDictionary(java.io.File file) throws SDKException, java.io.IOException
file - the file to loadSDKExceptionjava.io.IOExceptionpublic static RuleDictionary loadDictionary(java.io.File file, DictionaryFinder finder) throws SDKException, java.io.IOException
file - the file to loadfinder - the finder to use.SDKExceptionjava.io.IOExceptionpublic static RuleDictionary createDictionary(java.lang.String name) throws SDKException, java.io.IOException
name - the name of the dictionarySDKExceptionjava.io.IOExceptionpublic static RuleDictionary createDictionary(java.lang.String name, DictionaryFinder finder) throws SDKException, java.io.IOException
name - the name of the dictionaryfinder - the finder to use when the RuleDictionary is createdSDKExceptionjava.io.IOExceptionpublic static RuleDictionary loadOrCreateDictionary(java.lang.String fileName) throws SDKException, java.io.IOException
The dictionary so created is automatically linked to the base DecisionPoint dictionary.
fileName - the fully qualified path name to the file, e.g., /scratch/Foo.rulesSDKExceptionjava.io.IOExceptionpublic static RuleDictionary loadOrCreateDictionary(java.lang.String fileName, DictionaryFinder finder) throws SDKException, java.io.IOException
The dictionary so created is automatically linked to the base DecisionPoint dictionary.
fileName - the fully qualified path name to the file, e.g., /scratch/Foo.rulesfinder - a finder to add to the chainSDKExceptionjava.io.IOExceptionpublic static UndoableEdit importAdfBcFactType(RuleDictionary rd, java.lang.String viewDefName) throws SDKException
rd - dictionary in which to add the fact typesviewDefName - this must be the fully qualified name of the ViewDefinition object (not the 'impl class)SDKExceptionpublic static UndoableEdit importAdfBcFactTypes(RuleDictionary rd, java.util.List<java.lang.String> viewDefNames) throws SDKException
rd - dictionary in which to add the fact typesviewDefNames - these must be the fully qualified name of the View Definition objects (not their 'impl classes)SDKExceptionpublic static UndoableEdit importJavaFactTypes(RuleDictionary rd, java.util.List<java.lang.String> javaTypeNames) throws SDKException
SDKExceptionpublic static DecisionFunction createDecisionFunction(RuleDictionary rd, java.lang.String dfName, java.lang.String ftName, boolean isWebService, boolean isPAStyle) throws SDKException
dfName - the decision function's nameftName - the root input fact type's nameisWebService - whether a web-service wrapper should be createdisPAStyle - whether to create this Decision Function with PA processing configured (yes for ADF-BC DecisionPoints)SDKExceptionpublic static void removeDecisionFunction(RuleDictionary rd, java.lang.String name, boolean removeSubordinates)
removeSubordinates - -- if set, removes any decision functions used by the named decision functionpublic static void removeRuleset(RuleDictionary rd, java.lang.String name) throws DeleteException
DeleteExceptionpublic static DictionaryLink createDictionaryLink(RuleDictionary rd, java.lang.String dictPackage, java.lang.String dictName)
@Deprecated public static java.util.List<SDKWarning> writeDictionary(java.lang.String fileName, RuleDictionary rd) throws SDKException, java.io.IOException
java.io.IOException - if there is an problem writing to the fileSDKException - if there is an problem updating the dictionaryMetadataHelper.writeDictionary(RuleDictionary, File)