com.dtrules.compiler.excel.util
Class Excel2XML

java.lang.Object
  extended by com.dtrules.compiler.excel.util.Excel2XML

public class Excel2XML
extends Object


Constructor Summary
Excel2XML(RuleSet ruleSet)
          We assume that the Rule Set provided gives us all the parameters needed to open a set of Excel Files and convert them into XML files.
Excel2XML(String path, String rulesDirectoryXML, String ruleset)
          Opens the RulesDirectory for the caller.
 
Method Summary
 void compile(int NumErrorsToReport, PrintStream err)
          Compiles the RuleSet
static void compile(String path, String rulesConfig, String ruleset, String applicationRepositoryPath)
           
static void compile(String path, String rulesConfig, String ruleset, String applicationRepositoryPath, String[] mappings)
          Helper function for compiling Rule Sets.
 void convertRuleset()
          Converts the RuleSet
static void copyFile(String file1, String file2)
          Copy a file Throws a runtime exception if anything goes wrong.
 void generateMap(int version, String mapping, String filename)
          Generates a default Mapping File.
 void generateMap(String mapping, String filename)
          Deprecated. 
 DTCompiler getDTCompiler()
          Return the Last DecisionTable Compiler used.
 RuleSet getRuleSet()
          Returns the ruleSet being used by this compiler
 void reset()
          We reset the Rules Directory after we have modified the XML used to define the Rules Directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Excel2XML

public Excel2XML(RuleSet ruleSet)
We assume that the Rule Set provided gives us all the parameters needed to open a set of Excel Files and convert them into XML files.

Parameters:
propertyfile -

Excel2XML

public Excel2XML(String path,
                 String rulesDirectoryXML,
                 String ruleset)
Opens the RulesDirectory for the caller.

Parameters:
rulesDirectoryXML -
ruleset -
Method Detail

getRuleSet

public RuleSet getRuleSet()
Returns the ruleSet being used by this compiler

Returns:

reset

public void reset()
We reset the Rules Directory after we have modified the XML used to define the Rules Directory.


getDTCompiler

public DTCompiler getDTCompiler()
Return the Last DecisionTable Compiler used. Null if none exists.

Returns:
Return the Last DecisionTable Compiler used.

convertRuleset

public void convertRuleset()
                    throws Exception
Converts the RuleSet

Throws:
Exception

copyFile

public static void copyFile(String file1,
                            String file2)
Copy a file Throws a runtime exception if anything goes wrong.


compile

public void compile(int NumErrorsToReport,
                    PrintStream err)
Compiles the RuleSet

Parameters:
NumErrorsToReport - How many errors to print
err - The output stream which to print the errors

generateMap

@Deprecated
public void generateMap(String mapping,
                                   String filename)
                 throws Exception
Deprecated. 

Generates a default Mapping File. This file is not complete, but requires adjustments to match XML tags if they differ from the Attribute names used in the EDD. Also, the initial Entity Stack and frequence of Entity types must be examined and updated.

Parameters:
mapping - Tag for the mapping file. Attributes with this tag in the EDD will be mapped in the generated mapping
filename - File name for the mapping file generated
Throws:
Exception

generateMap

public void generateMap(int version,
                        String mapping,
                        String filename)
                 throws Exception
Generates a default Mapping File. This file is not complete, but requires adjustments to match XML tags if they differ from the Attribute names used in the EDD. Also, the initial Entity Stack and frequency of Entity types must be examined and updated.

Parameters:
mapping - Version of EDD to map.
mapping - Tag for the mapping file. Attributes with this tag in the EDD will be mapped in the generated mapping
filename - File name for the mapping file generated
Throws:
Exception

compile

public static void compile(String path,
                           String rulesConfig,
                           String ruleset,
                           String applicationRepositoryPath)
                    throws Exception
Throws:
Exception

compile

public static void compile(String path,
                           String rulesConfig,
                           String ruleset,
                           String applicationRepositoryPath,
                           String[] mappings)
                    throws Exception
Helper function for compiling Rule Sets.

Parameters:
path - The Base Path in the file system. All other files are defined as relative points away from this Base Path
rulesConfig - The name of the Rule Set configuration file
ruleset - The name of the Rule Set to compile. (Most of the parameters to the compiler are pulled from the configuration file
applicationRepositoryPath - This is a relative path to a possibly different version of this Rule Set. Generally, this is the version that is currently deployed. The compile will produce a compare of changes between the Rule Set under development, and this Rule Set. If null, this comparison will be skipped.
Throws:
Exception


Copyright © 2011 DTrules Inc. All Rights Reserved.