236. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 6/11/2019 10:54:14 AM Eastern Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

236.1 Files compared

# Location File Last Modified
1 HTRE_P3_v14.5_iter_4_build_14.zip\java\gov\va\med\fw\rule\impl AbstractRuleEngineAwareService.java Wed May 29 15:26:14 2019 UTC
2 HTRE_P3_v14.5_iter_4_build_14.zip\java\gov\va\med\fw\rule\impl AbstractRuleEngineAwareService.java Mon Jun 10 19:27:47 2019 UTC

236.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 2 306
Changed 1 2
Inserted 0 0
Removed 0 0

236.3 Comparison options

Whitespace
Character case Differences in character case are significant
Line endings Differences in line endings (CR and LF characters) are ignored
CR/LF characters Not shown in the comparison detail

236.4 Active regular expressions

No regular expressions were active.

236.5 Comparison detail

  1   package go v.va.med.f w.rule.imp l;
  2  
  3   // Java cl asses
  4   import jav a.util.Col lection;
  5   import jav a.util.Ite rator;
  6   import jav a.util.Map ;
  7  
  8   import org .apache.co mmons.lang .Validate;
  9   import org .springfra mework.bea ns.factory .NoSuchBea nDefinitio nException ;
  10  
  11   import gov .va.med.fw .rule.Rule DataAware;
  12   import gov .va.med.fw .rule.Rule Engine;
  13   import gov .va.med.fw .rule.Rule Exception;
  14   import gov .va.med.fw .rule.Rule Parameter;
  15   import gov .va.med.fw .rule.Rule Parameters ;
  16   import gov .va.med.fw .rule.Rule State;
  17   import gov .va.med.fw .service.A bstractCom ponent;
  18   import gov .va.med.fw .service.S erviceExce ption;
  19   import gov .va.med.fw .validatio n.Validata ble;
  20   import gov .va.med.fw .validatio n.Validati onMessages ;
  21  
  22   // EDB cla sses
  23  
  24   /**
  25    * Provide s access t o a rule f low and me thods to i nvoke a ru le set usi ng the
  26    * injecte d rule flo w.
  27    * 
  28    * @author   DN S
  29    * @versio n 1.0
  30    */
  31   public abs tract clas s Abstract RuleEngine AwareServi ce extends  AbstractC omponent {
  32  
  33           pr ivate Rule Engine rul eEngine =  null;
  34  
  35           /* *
  36            *  A default  construct or for a b ase servic e that kno ws about a n instance  of
  37            *  a Rule Fl ow.
  38            * /
  39           pr otected Ab stractRule EngineAwar eService()  {
  40                    supe r();
  41           }
  42  
  43           /* *
  44            *  Returns a  rule flow  that is u sed to inv oke a rule  set
  45            *  
  46            *  @return R eturns the  ruleFlow.
  47            * /
  48           pu blic RuleE ngine getR uleEngine( ) {
  49                    retu rn ruleEng ine;
  50           }
  51  
  52           /* *
  53            *  Sets a ru le flow to  be used f or invokin g a rule s et
  54            *  
  55            *  @param ru leEngine
  56            *              The rule Flow to se t.
  57            * /
  58           pu blic void  setRuleEng ine(RuleEn gine ruleE ngine) {
  59                    this .ruleEngin e = ruleEn gine;
  60           }
  61  
  62           /* *
  63            *  @see org. springfram ework.bean s.factory. Initializi ngBean#aft erProperti esSet()
  64            * /
  65           pu blic void  afterPrope rtiesSet()  throws Ex ception {
  66                    Vali date.notNu ll(ruleEng ine, "A ru le engine  must not b e null");
  67           }
  68  
  69           /* *
  70            *  Invokes a  rule flow  to proces s a rule s et
  71            *  
  72            *  @param pa rameters
  73            *              A collec tion of ru le paramet ers
  74            *  @param ru leData
  75            *              A data c lass encap sulates in surance da ta
  76            *  @throws S erviceExce ption
  77            *               In case  of errors  in proces sing insur ance data
  78            * /
  79           pr otected Va lidationMe ssages inv okeRuleFlo w(RulePara meters par ameters, R uleDataAwa re ruleDat a)
  80                             throws  ServiceEx ception {
  81                    retu rn this.in vokeRuleFl ow(paramet ers, ruleD ata, Valid atable.ELI MINATION);
  82           }
  83  
  84           /* *
  85            *  Invokes a  rule flow  to proces s a rule s et
  86            *  
  87            *  @param pa rameters
  88            *              A collec tion of ru le paramet ers
  89            *  @param ru leData
  90            *              A data c lass encap sulates in surance da ta
  91            *  @param va lidationMo de
  92            *              Validata ble.EXHAUS TIVE or Va lidatable. ELIMINATIO N
  93            *  @throws S erviceExce ption
  94            *               In case  of errors  in proces sing insur ance data
  95            * /
  96           pr otected Va lidationMe ssages inv okeRuleFlo w(RulePara meters par ameters, R uleDataAwa re ruleDat a,
  97                             String  validatio nMode) thr ows Servic eException  {
  98  
  99                    Vali dationMess ages messa ges = null ;
  100  
  101                    try  {
  102                             setExh austiveMod e(paramete rs, Valida table.EXHA USTIVE.equ als(valida tionMode)) ;
  103  
  104                             this.g etRuleEngi ne().execu te(paramet ers, ruleD ata);
  105  
  106                             RuleSt ate ruleSt ate = para meters.get State();
  107  
  108                             // If  a validati on mode is  set exhau stive mode , check fo r validati on
  109                             // mes sages here
  110                             if (ru leState !=  null && r uleState.i sExhaustiv eMode())
  111                                      messages  = ruleSta te.getVali dationMess ages();
  112  
  113                    } ca tch (RuleE xception e ) {
  114                             throw  new Servic eException (
  115                                               "Failed to  invoke ru le flow "  + paramete rs.getRule FlowName() , e);
  116                    }
  117  
  118                    retu rn message s;
  119           }
  120  
  121           /* *
  122            *  @param pa rameters
  123            *  @param ru leData
  124            *  @param va lidationMo de
  125            *  @throws S erviceExce ption
  126            * /
  127           pr otected vo id invokeR uleFlow(Ru leParamete rs paramet ers, Map r uleData) t hrows Serv iceExcepti on {
  128  
  129                    try  {
  130                             this.g etRuleEngi ne().execu te(paramet ers, ruleD ata);
  131                    } ca tch (RuleE xception e ) {
  132                             throw  new Servic eException (
  133                                               "Failed to  invoke ru le flow "  + paramete rs.getRule FlowName() , e);
  134                    }
  135           }
  136  
  137           pr otected Ru leParamete rs getRule Parameters (String na me) throws  NoSuchBea nDefinitio nException  {
  138                    try  {
  139                             return  (RulePara meters) th is.getComp onent(name , RulePara meters.cla ss);
  140                    } ca tch (Servi ceExceptio n e) {
  141                             throw  new NoSuch BeanDefini tionExcept ion("Faile d to obtai n rule par ameters: "  + name);
  142                    }
  143           }
  144  
  145           pr otected vo id setExha ustiveMode (RuleParam eters para meters, bo olean flag ) {
  146  
  147                    Coll ection par ams = para meters.get RuleParame ters().val ues();
  148                    for  (Iterator  i = params .iterator( ); i.hasNe xt();) {
  149                             RulePa rameter pa ram = (Rul eParameter ) i.next() ;
  150                             param. getState() .setExhaus tiveMode(f lag);
  151                    }
  152                    para meters.get State().se tExhaustiv eMode(flag );
  153           }
  154   }