D:\CreditRepair\CreditRepair_PM_Structure\Development\Source\SourcePackages\CreditRepairProject\DynamicBusinessRulesFramework\src\java\business_rules_manager\BusinessRulesManager.java
  1 /*
  2  * To change this template, choose Tools | Templates
  3  * and open the template in the editor.
  4  */
  5 
  6 package business_rules_manager;
  7 
  8 import loaders_business_rules_abstract_factory.*;
  9 import java.util.*;
 10 import applications_processes.*;
 11 import constants.*;
 12 import util.*;
 13 import business_rules_data_objects.*;
 14 
 15 import java.util.Properties;
 16 import java.io.*;
 17 
 18 
 19 /**
 20  *
 21  * @author sameldin
 22  */
 23 public class BusinessRulesManager
 24 {
 25     // these are the static processes name and index values
 26      Hashtable<String, Integer>             static_processNameIndexValuetHashTable      = null;
 27      Hashtable<String, Integer>             static_weightScoreNameIndextValueHashTable  = null;
 28      Hashtable<String, Integer>             static_validationNameIndexValueHashTable    = null;
 29      Hashtable<String, Integer>             static_decisionNameIndexValueHashTable      = null;
 30      //===================================================================
 31      // These are dynamic rules created by the business manager
 32      Hashtable<String, String>             dynamic_processRulesNameKeyListHashTable    = null;
 33      Hashtable<String, String>             dynamic_weightScoreRulesNameKeyListHashTable= null;
 34      Hashtable<String, String>             dynamic_validationRulesNameKeyListHashTable = null;
 35      Hashtable<String, String>             dynamic_decisionRulesNameKeyListHashTable   = null;
 36      //===================================================================
 37      ArrayList<StructuralProcessesRuleDO>   processRulesDO_ArrayList                    = null;
 38      ArrayList<VocabularyDictionaryDO>      vocabularyDictionaryDO_ArrayList            = null;
 39      ArrayList<WeightScoreDo>               weightScoreRulesDO_ArrayList                = null;
 40      ArrayList<validationDO>                validationRulesDO_ArrayList                 = null;
 41      ArrayList <DecisionDO>                 decisionRulesDO_ArrayList                   = null;
 42      //=====================================================================
 43      BusinessRulesAbstractFactory            classBusinessRulesAbstractFactory          = null;
 44      ProcessesAbstractFactory                classProcessesAbstractFactory              = null;
 45      VocabularyDictionaryAbstractFactory     classVocabularyDictionaryAbstractFactory   = null;
 46      WeightScoreAbstractFactory              classWeightScoreAbstractFactory            = null;
 47      ValidationAbstractFactory               classValidationAbstractFactory             = null;
 48      DecisionAbstractFactory                 classDecisionAbstractFactory               = null;
 49      //=====================================================================
 50     Set<StructuralProcessesRuleDO> structuralProcessesRuleDOHashSet = null;
 51     Set <FunctionalProcessesRuleDO> functionalProcessesRuleDOHashSet = null;
 52 
 53 
 54     public BusinessRulesManager()
 55     {
 56 
 57     }
 58     public BusinessRulesManager(int productServiceIndex)
 59     {
 60                 classBusinessRulesAbstractFactory           = new BusinessRulesAbstractFactory(productServiceIndex);
 61                 static_processNameIndexValuetHashTable      = classBusinessRulesAbstractFactory.getStaticNameID_HashTable(Constants.STATIC_NAME_INDEX_VALUE_PROCESS_INDEX);
 62                 structuralProcessesRuleDOHashSet = classBusinessRulesAbstractFactory.getStructuralProcessesRuleDOset(productServiceIndex, true);
 63                 functionalProcessesRuleDOHashSet = classBusinessRulesAbstractFactory.getFunctionalProcessesRuleDOset(productServiceIndex, true);
 64                 if(null == static_processNameIndexValuetHashTable)
 65                 {
 66                     // do exception ?
 67                 }
 68                 //====================================================
 69                 classProcessesAbstractFactory = new ProcessesAbstractFactory(productServiceIndex);
 70                 dynamic_processRulesNameKeyListHashTable    = classProcessesAbstractFactory.getDynamicNameKey_HashTable(productServiceIndex);
 71                 processRulesDO_ArrayList = classProcessesAbstractFactory.getProcessRulesDO_ArrayList();
 72                 //====================================================
 73                 classVocabularyDictionaryAbstractFactory = new VocabularyDictionaryAbstractFactory(productServiceIndex);
 74                 vocabularyDictionaryDO_ArrayList = classVocabularyDictionaryAbstractFactory.getVocabularyDictionaryDO_ArrayList();
 75                 //====================================================
 76                 classWeightScoreAbstractFactory = new WeightScoreAbstractFactory(productServiceIndex);
 77                 weightScoreRulesDO_ArrayList = classWeightScoreAbstractFactory.getWeightScoreRulesDO_ArrayList();
 78                 //====================================================
 79                 classValidationAbstractFactory = new ValidationAbstractFactory(productServiceIndex);
 80                 validationRulesDO_ArrayList = classValidationAbstractFactory.getValidationRulesDO_ArrayList();
 81                 //====================================================
 82                 classDecisionAbstractFactory = new DecisionAbstractFactory(productServiceIndex);
 83                 decisionRulesDO_ArrayList = classDecisionAbstractFactory.getDecisionRulesDO_ArrayList();
 84                 //=============================================================================
 85                 dynamic_weightScoreRulesNameKeyListHashTable  = null;
 86                 dynamic_validationRulesNameKeyListHashTable   = null;
 87                 dynamic_decisionRulesNameKeyListHashTable     = null;
 88     }
 89     /*
 90      * hashtable creator - Sych and Not Synch
 91      */
 92      public Hashtable<String, String> getDynamicNameKey_HashTable()
 93      {
 94         return(dynamic_processRulesNameKeyListHashTable);
 95      }
 96      /*
 97      * hashtable creator - Sych and Not Synch
 98      */
 99      public Hashtable<String, Integer> getStaticNameIndexValuetHashTable()
100      {
101         return(static_processNameIndexValuetHashTable);
102      }
103     /*
104      *
105      */
106      public Set getStructuralProcessesRuleDOset(int processIndex)
107      {
108         return(classBusinessRulesAbstractFactory.getStructuralProcessesRuleDOset(processIndex, true));
109      }
110     /*
111      *
112      */
113      public Set<FunctionalProcessesRuleDO> getFunctionalProcessesRuleDOset(int processIndex)
114      {
115          return(classBusinessRulesAbstractFactory.getFunctionalProcessesRuleDOset(processIndex, true));
116      }
117     /*
118      *
119      */
120      public Set<MiscellaneousProcessesRuleDO> getMiscellaneousProcessesRuleDOset(int processIndex)
121      {
122          return(classBusinessRulesAbstractFactory.getMiscellaneousProcessesRuleDOset(processIndex, true));
123      }
124      /**
125      *
126      */
127      public static void main (String[] args)
128     {
129          BusinessRulesManager localBusinessRulesManager = new BusinessRulesManager();
130          int joe = 0;
131 
132     }
133 }
134 
135