Package oracle.rules.sdk2.decisionpoint
Class MetadataHelper
java.lang.Object
oracle.rules.sdk2.decisionpoint.MetadataHelper
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic final classDFParm is a struct representing parameter options for decision functions.
- 
Method SummaryModifier and TypeMethodDescriptionstatic voidaddDecisionFunctionChild(DecisionFunction parent, DecisionFunction child) Appends a child DecisionFunction to the current DecisionFunction Both DecisionFunction instances must reside in the same dictionary.static voidAppends an input parameter to a decision function's input tablestatic voidAppends an output parameter to a decision function's output tablestatic voidaddDecisionFunctionRuleSet(DecisionFunction df, String alias) Appends a RuleSet name to a decision function's ruleset table.static DecisionFunctioncreateDecisionFunction(RuleDictionary rd, String dfName, String ftName, boolean isWebService, boolean isPAStyle) Creates a new Decision Function, overwriting any previously existing instance.static RuleDictionarycreateDictionary(String name) Create a new empty RuleDictionary with a new empty data model.static RuleDictionarycreateDictionary(String name, DictionaryFinder finder) Create a new empty RuleDictionary with a new empty data model.static DictionaryLinkcreateDictionaryLink(RuleDictionary rd, String dictPackage, String dictName) static voidensureRuleSetIsDefined(RuleDictionary rd, String name) If a RuleSet by the given name is not already in the dictionary instance, this method adds it.static UndoableEditimportAdfBcFactType(RuleDictionary rd, String viewDefName) Creates a new ADF-BC fact type based on a given View Definitionstatic UndoableEditimportAdfBcFactTypes(RuleDictionary rd, List<String> viewDefNames) Creates new ADF-BC fact types based on the given View Definitionsstatic UndoableEditimportJavaFactTypes(RuleDictionary rd, List<String> javaTypeNames) Adds new fact types to the dictionary based on Java classesstatic RuleDictionaryloadDictionary(File file) Loads a dictionary from the specified File using UTF-8 decoding.static RuleDictionaryloadDictionary(File file, DictionaryFinder finder) Loads a dictionary from the specified File using UTF-8 decoding.static RuleDictionaryloadOrCreateDictionary(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 RuleDictionaryloadOrCreateDictionary(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 RuleDictionaryDeprecated.static RuleDictionaryreadDictionary(String pkg, String name) static RuleDictionaryreadDictionary(String pkg, String name, 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.jarstatic voidremoveDecisionFunction(RuleDictionary rd, String name, boolean removeSubordinates) removes a decision function from the dictionarystatic voidremoveRuleset(RuleDictionary rd, String name) removes a named ruleset from the dictionarystatic List<SDKWarning>writeDictionary(String fileName, RuleDictionary rd) Deprecated.static List<SDKWarning>writeDictionary(RuleDictionary rd, File file) Writes a RuleDictionary to the specified File using UTF-8 encoding.
- 
Method Details- 
readDictionarypublic static RuleDictionary readDictionary(String pkg, String name, ClassLoader loader) throws SDKException 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- Parameters:
- pkg- the fully qualified package com.mycompany.rules
- name- the name of the dictionary (without prefix) e.g. MyDictionary
- loader- the classloader instance to be used to load the dictionary
- Returns:
- the dictionary or null if the name is null.
- Throws:
- SDKException- if the dictionary can not be read
 
- 
readDictionary- Throws:
- SDKException
 
- 
addDecisionFunctionInputpublic static void addDecisionFunctionInput(DecisionFunction df, MetadataHelper.DFParm parm) throws SDKException Appends an input parameter to a decision function's input table- Parameters:
- df- a DecisionFunction instance
- parm- the parameter description to be added
- Throws:
- SDKException
 
- 
addDecisionFunctionOutputpublic static void addDecisionFunctionOutput(DecisionFunction df, MetadataHelper.DFParm parm) throws SDKException Appends an output parameter to a decision function's output table- Parameters:
- df- a DecisionFunction instance
- parm- the parameter description to be added
- Throws:
- SDKException
 
- 
addDecisionFunctionRuleSetAppends a RuleSet name to a decision function's ruleset table. The RuleSet must be defined in this dictionary or a linked dictionary- Parameters:
- df- the decision function to be modified
- alias- the alias of the RuleSet to be included
 
- 
addDecisionFunctionChildAppends a child DecisionFunction to the current DecisionFunction Both DecisionFunction instances must reside in the same dictionary.
- 
ensureRuleSetIsDefinedIf a RuleSet by the given name is not already in the dictionary instance, this method adds it. If the RuleSet already exists, it is not affected.
- 
writeDictionarypublic static List<SDKWarning> writeDictionary(RuleDictionary rd, File file) throws SDKException, IOException Writes a RuleDictionary to the specified File using UTF-8 encoding.- Parameters:
- rd- the dictionary to write
- file- the File to write to
- Returns:
- warnings from validating the dictionary
- Throws:
- IOException- if there is an problem writing to the file
- SDKException- if there is an problem updating the dictionary
- See Also:
 
- 
loadDictionaryLoads a dictionary from the specified File using UTF-8 decoding. Includes DecisionPointDictionaryFinder in finder chain- Parameters:
- file- the file to load
- Returns:
- the dictionary instance
- Throws:
- SDKException
- IOException
 
- 
loadDictionarypublic static RuleDictionary loadDictionary(File file, DictionaryFinder finder) throws SDKException, IOException Loads a dictionary from the specified File using UTF-8 decoding.- Parameters:
- file- the file to load
- finder- the finder to use.
- Returns:
- the dictionary instance
- Throws:
- SDKException
- IOException
 
- 
createDictionaryCreate a new empty RuleDictionary with a new empty data model.- Parameters:
- name- the name of the dictionary
- Returns:
- a dictionary instance
- Throws:
- SDKException
- IOException
 
- 
createDictionarypublic static RuleDictionary createDictionary(String name, DictionaryFinder finder) throws SDKException, IOException Create a new empty RuleDictionary with a new empty data model.- Parameters:
- name- the name of the dictionary
- finder- the finder to use when the RuleDictionary is created
- Returns:
- a dictionary instance
- Throws:
- SDKException
- IOException
 
- 
loadOrCreateDictionarypublic static RuleDictionary loadOrCreateDictionary(String fileName) throws SDKException, IOException 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".The dictionary so created is automatically linked to the base DecisionPoint dictionary. - Parameters:
- fileName- the fully qualified path name to the file, e.g., /scratch/Foo.rules
- Returns:
- a dictionary instance
- Throws:
- SDKException
- IOException
 
- 
loadOrCreateDictionarypublic static RuleDictionary loadOrCreateDictionary(String fileName, DictionaryFinder finder) throws SDKException, IOException 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".The dictionary so created is automatically linked to the base DecisionPoint dictionary. - Parameters:
- fileName- the fully qualified path name to the file, e.g., /scratch/Foo.rules
- finder- a finder to add to the chain
- Returns:
- a dictionary instance
- Throws:
- SDKException
- IOException
 
- 
importAdfBcFactTypepublic static UndoableEdit importAdfBcFactType(RuleDictionary rd, String viewDefName) throws SDKException Creates a new ADF-BC fact type based on a given View Definition- Parameters:
- rd- dictionary in which to add the fact types
- viewDefName- this must be the fully qualified name of the ViewDefinition object (not the 'impl class)
- Throws:
- SDKException
 
- 
importAdfBcFactTypespublic static UndoableEdit importAdfBcFactTypes(RuleDictionary rd, List<String> viewDefNames) throws SDKException Creates new ADF-BC fact types based on the given View Definitions- Parameters:
- rd- dictionary in which to add the fact types
- viewDefNames- these must be the fully qualified name of the View Definition objects (not their 'impl classes)
- Throws:
- SDKException
 
- 
importJavaFactTypespublic static UndoableEdit importJavaFactTypes(RuleDictionary rd, List<String> javaTypeNames) throws SDKException Adds new fact types to the dictionary based on Java classes- Throws:
- SDKException
 
- 
createDecisionFunctionpublic static DecisionFunction createDecisionFunction(RuleDictionary rd, String dfName, String ftName, boolean isWebService, boolean isPAStyle) throws SDKException Creates a new Decision Function, overwriting any previously existing instance. It is assumed that the DF has a single input fact tree.- Parameters:
- dfName- the decision function's name
- ftName- the root input fact type's name
- isWebService- whether a web-service wrapper should be created
- isPAStyle- whether to create this Decision Function with PA processing configured (yes for ADF-BC DecisionPoints)
- Throws:
- SDKException
 
- 
removeDecisionFunctionpublic static void removeDecisionFunction(RuleDictionary rd, String name, boolean removeSubordinates) removes a decision function from the dictionary- Parameters:
- removeSubordinates- -- if set, removes any decision functions used by the named decision function
 
- 
removeRulesetremoves a named ruleset from the dictionary- Throws:
- DeleteException
 
- 
createDictionaryLinkpublic static DictionaryLink createDictionaryLink(RuleDictionary rd, String dictPackage, String dictName) 
- 
writeDictionary@Deprecated public static List<SDKWarning> writeDictionary(String fileName, RuleDictionary rd) throws SDKException, IOException Deprecated.Writes a RuleDictionary to disk at the specified location.- Returns:
- warnings from validating the dictionary
- Throws:
- IOException- if there is an problem writing to the file
- SDKException- if there is an problem updating the dictionary
- See Also:
 
- 
readDictionary@Deprecated public static RuleDictionary readDictionary(InputStream is) throws SDKException, IOException Deprecated.- Throws:
- SDKException
- IOException
 
 
-