Produced by Araxis Merge on 11/14/2017 6:57:19 AM Central Standard 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.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | cbs.zip\cbs\cbs\src\main\java\gov\va\cpss\job\cbs | CbsProcessStmtDataCompletionTasklet.java | Thu Nov 9 14:19:54 2017 UTC |
| 2 | cbs.zip\cbs\cbs\src\main\java\gov\va\cpss\job\cbs | CbsProcessStmtDataCompletionTasklet.java | Tue Nov 14 12:26:16 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 230 |
| Changed | 1 | 2 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| 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 |
No regular expressions were active.
| 1 | package go v.va.cpss. job.cbs; | |
| 2 | ||
| 3 | import sta tic gov.va .cpss.job. CbssJobPro cessingCon stants.DAT A_ERROR_ST ATUS; | |
| 4 | import sta tic gov.va .cpss.job. cbs.CbsPro cessingCon stants.CBS _TOTAL_INI TIAL_STATE MENT_COUNT _KEY; | |
| 5 | ||
| 6 | import jav a.util.Lis t; | |
| 7 | ||
| 8 | import org .springfra mework.bat ch.core.sc ope.contex t.ChunkCon text; | |
| 9 | ||
| 10 | import gov .va.cpss.s ervice.Cbs Service; | |
| 11 | import gov .va.cpss.s ervice.Fps Service; | |
| 12 | ||
| 13 | /** | |
| 14 | * Complet e processi ng by sett ing the pr ocessed co nsolidated statement s to NEW | |
| 15 | * state a nd setting the proce ssed PSRec eived to P ROCESSED s tate. | |
| 16 | * | |
| 17 | * @author DN S BROWNL | |
| 18 | */ | |
| 19 | public cla ss CbsProc essStmtDat aCompletio nTasklet e xtends Cbs JobBaseCom pletionTas klet { | |
| 20 | ||
| 21 | pr ivate CbsR untimeStat e cbsRunti meState; | |
| 22 | ||
| 23 | pr ivate FpsS ervice fps Service; | |
| 24 | ||
| 25 | pr ivate CbsS ervice cbs Service; | |
| 26 | ||
| 27 | pu blic CbsRu ntimeState getCbsRun timeState( ) { | |
| 28 | retu rn cbsRunt imeState; | |
| 29 | } | |
| 30 | ||
| 31 | pu blic void setCbsRunt imeState(C bsRuntimeS tate cbsRu ntimeState ) { | |
| 32 | this .cbsRuntim eState = c bsRuntimeS tate; | |
| 33 | } | |
| 34 | ||
| 35 | pu blic FpsSe rvice getF psService( ) { | |
| 36 | retu rn fpsServ ice; | |
| 37 | } | |
| 38 | ||
| 39 | pu blic void setFpsServ ice(FpsSer vice fpsSe rvice) { | |
| 40 | this .fpsServic e = fpsSer vice; | |
| 41 | } | |
| 42 | ||
| 43 | pu blic CbsSe rvice getC bsService( ) { | |
| 44 | retu rn cbsServ ice; | |
| 45 | } | |
| 46 | ||
| 47 | pu blic void setCbsServ ice(CbsSer vice cbsSe rvice) { | |
| 48 | this .cbsServic e = cbsSer vice; | |
| 49 | } | |
| 50 | ||
| 51 | @O verride | |
| 52 | pr otected bo olean exec uteLogic(C hunkContex t chunkCon text) { | |
| 53 | ||
| 54 | bool ean succes sful = tru e; | |
| 55 | ||
| 56 | task letLogger. info("Stmt Completio n Tasklet Running!") ; | |
| 57 | ||
| 58 | // P ublish all INITIAL s tatements to NEW sta tus. | |
| 59 | long newStatem entCount = cbsServic e.publishA llNewState ments(); | |
| 60 | ||
| 61 | // V erify the number pub lished mat ched the r unning tot al from th e | |
| 62 | // w riter. | |
| 63 | fina l long exp ectedNewSt atementCou nt = chunk Context.ge tStepConte xt().getSt epExecutio n().getJob Execution( ) | |
| 64 | .getExec utionConte xt().getLo ng(CBS_TOT AL_INITIAL _STATEMENT _COUNT_KEY ); | |
| 65 | ||
| 66 | if ( newStateme ntCount == expectedN ewStatemen tCount) { | |
| 67 | taskle tLogger.in fo("CBSStm t Records New Count: " + newSt atementCou nt); | |
| 68 | } el se { | |
| 69 | // If the counts do not ma tch then t his is an unexpected and | |
| 70 | // unr ecoverable error. | |
| 71 | final String err or = "Roll back Trigg ered - Upd ated (" + newStateme ntCount | |
| 72 | + ") INITI AL to NEW rows but e xpected to update (" + expecte dNewStatem entCount | |
| 73 | + ") rows for CBSStm t"; | |
| 74 | setFai lureStatus (chunkCont ext.getSte pContext() .getStepEx ecution(). getJobExec ution(), D ATA_ERROR_ STATUS, | |
| 75 | error); | |
| 76 | ||
| 77 | // Fla g to do ro llback. | |
| 78 | succes sful = fal se; | |
| 79 | } | |
| 80 | ||
| 81 | // P ublish the processed PSReceive d records to PROCESS ED status. | |
| 82 | fina l List<Lon g> psRecei vedIDL = c bsRuntimeS tate.getPS ReceivedID List(); | |
| 83 | ||
| 84 | // V erify the number pub lished mat ched the r unning tot al from th e | |
| 85 | // w riter. | |
| 86 | fina l int rece ivedUpdate Count = fp sService.p rocessPSRe ceivedList (psReceive dIDL); | |
| 87 | ||
| 88 | if ( receivedUp dateCount == psRecei vedIDL.siz e()) { | |
| 89 | taskle tLogger.in fo("PSRece ived Recor ds Process ed Count: " + receiv edUpdateCo unt); | |
| 90 | } el se { | |
| 91 | // If the counts do not ma tch then t his is an unexpected and | |
| 92 | // unr ecoverable error. | |
| 93 | final String err or = "Roll back Trigg ered - Upd ated (" + receivedUp dateCount | |
| 94 | + ") NEW t o PROCESSE D rows but expected to update (" + psRec eivedIDL.s ize() | |
| 95 | + ") rows for PSRece ived"; | |
| 96 | setFai lureStatus (chunkCont ext.getSte pContext() .getStepEx ecution(). getJobExec ution(), D ATA_ERROR_ STATUS, | |
| 97 | error); | |
| 98 | ||
| 99 | // Fla g to do ro llback. | |
| 100 | succes sful = fal se; | |
| 101 | } | |
| 102 | ||
| 103 | // I f a databa se error o ccurred a rollback w ill be ini tiated so set new | |
| 104 | // s tatement c ount to ze ro. | |
| 105 | // S tatements will remai n in INITI AL state. | |
| 106 | if ( !successfu l) { | |
| 107 | newSta tementCoun t = 0; | |
| 108 | } | |
| 109 | ||
| 110 | // S et the com pletion st atistics. | |
| 111 | upda teStatisti cs(chunkCo ntext.getS tepContext ().getStep Execution( ).getJobEx ecution(), newStatem entCount); | |
| 112 | ||
| 113 | retu rn success ful; | |
| 114 | } | |
| 115 | ||
| 116 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.