Oracle Fusion Middleware Java API Reference for Oracle Business Rules
11g Release 1 (11.1.1.7)

E10663-11

oracle.rules.sdk2.decisionpoint
Class MetadataHelper

java.lang.Object
  extended by oracle.rules.sdk2.decisionpoint.MetadataHelper

public final class MetadataHelper
extends java.lang.Object


Nested Class Summary
static class MetadataHelper.DFParm
          DFParm is a struct representing parameter options for decision functions.
 
Method Summary
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.  
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

readDictionary

public static RuleDictionary readDictionary(java.lang.String pkg,
                                            java.lang.String name,
                                            java.lang.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

public static RuleDictionary readDictionary(java.lang.String pkg,
                                            java.lang.String name)
                                     throws SDKException
Throws:
SDKException

addDecisionFunctionInput

public 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

addDecisionFunctionOutput

public 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

addDecisionFunctionRuleSet

public static void addDecisionFunctionRuleSet(DecisionFunction df,
                                              java.lang.String alias)
Appends 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

addDecisionFunctionChild

public static void addDecisionFunctionChild(DecisionFunction parent,
                                            DecisionFunction child)
Appends a child DecisionFunction to the current DecisionFunction Both DecisionFunction instances must reside in the same dictionary.


ensureRuleSetIsDefined

public 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. If the RuleSet already exists, it is not affected.


writeDictionary

public static java.util.List<SDKWarning> writeDictionary(RuleDictionary rd,
                                                         java.io.File file)
                                                  throws SDKException,
                                                         java.io.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:
java.io.IOException - if there is an problem writing to the file
SDKException - if there is an problem updating the dictionary
See Also:
MetadataHelper.writeDictionary(RuleDictionary, File)

loadDictionary

public static RuleDictionary loadDictionary(java.io.File file)
                                     throws SDKException,
                                            java.io.IOException
Loads 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
java.io.IOException

loadDictionary

public static RuleDictionary loadDictionary(java.io.File file,
                                            DictionaryFinder finder)
                                     throws SDKException,
                                            java.io.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
java.io.IOException

createDictionary

public static RuleDictionary createDictionary(java.lang.String name)
                                       throws SDKException,
                                              java.io.IOException
Create a new empty RuleDictionary with a new empty data model.

Parameters:
name - the name of the dictionary
Returns:
a dictionary instance
Throws:
SDKException
java.io.IOException

createDictionary

public static RuleDictionary createDictionary(java.lang.String name,
                                              DictionaryFinder finder)
                                       throws SDKException,
                                              java.io.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
java.io.IOException

loadOrCreateDictionary

public static RuleDictionary loadOrCreateDictionary(java.lang.String fileName)
                                             throws SDKException,
                                                    java.io.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
java.io.IOException

loadOrCreateDictionary

public static RuleDictionary loadOrCreateDictionary(java.lang.String fileName,
                                                    DictionaryFinder finder)
                                             throws SDKException,
                                                    java.io.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
java.io.IOException

importAdfBcFactType

public static UndoableEdit importAdfBcFactType(RuleDictionary rd,
                                               java.lang.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

importAdfBcFactTypes

public static UndoableEdit importAdfBcFactTypes(RuleDictionary rd,
                                                java.util.List<java.lang.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

importJavaFactTypes

public static UndoableEdit importJavaFactTypes(RuleDictionary rd,
                                               java.util.List<java.lang.String> javaTypeNames)
                                        throws SDKException
Adds new fact types to the dictionary based on Java classes

Throws:
SDKException

createDecisionFunction

public static DecisionFunction createDecisionFunction(RuleDictionary rd,
                                                      java.lang.String dfName,
                                                      java.lang.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

removeDecisionFunction

public static void removeDecisionFunction(RuleDictionary rd,
                                          java.lang.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

removeRuleset

public static void removeRuleset(RuleDictionary rd,
                                 java.lang.String name)
                          throws DeleteException
removes a named ruleset from the dictionary

Throws:
DeleteException

createDictionaryLink

public static DictionaryLink createDictionaryLink(RuleDictionary rd,
                                                  java.lang.String dictPackage,
                                                  java.lang.String dictName)

writeDictionary

@Deprecated
public static java.util.List<SDKWarning> writeDictionary(java.lang.String fileName,
                                                                    RuleDictionary rd)
                                                  throws SDKException,
                                                         java.io.IOException
Deprecated. 

Writes a RuleDictionary to disk at the specified location.

Returns:
warnings from validating the dictionary
Throws:
java.io.IOException - if there is an problem writing to the file
SDKException - if there is an problem updating the dictionary
See Also:
MetadataHelper.writeDictionary(RuleDictionary, File)

Oracle Fusion Middleware Java API Reference for Oracle Business Rules
11g Release 1 (11.1.1.7)

E10663-11

Copyright © 2013, Oracle and/or its affiliates. All rights reserved.