Batch processing must be written using the chunked batch processing architecture (see the Curam Batch Performance Mechanisms document).
Write these batch programs:
You must decide on appropriate metrics to capture during the stream processing, such as the number of cases processed, and/or the number of cases reassessed which did/did not result in a changed determination result. Your chunker and streamer must share data structures so that the stream processing can capture metrics and the chunker can accumulate them into its report.
// class member @Inject protected DeterminationCalculatorFactory determinationCalculatorFactory; public void yourBatchMethod(...yourparameters...) throws AppException, InformationalException { // process an identified case final long caseID = ...; final DeterminationCalculator determinationCalculator = determinationCalculatorFactory .newInstanceForCaseID(caseID); final DetermineEligibilityKey determineEligibiltyKey = new DetermineEligibilityKey(); determineEligibiltyKey.caseID = caseID; /* * reassess the case and determine whether the decision has * changed */ final boolean decisionChanged = determinationCalculator .hasDecisionChanged( determineEligibiltyKey, CASEASSESSMENTDETERMINATIONREASONEntry.SOMEREASON); }
For simple database queries this is unlikely to be challenging; however for non-trivial queries you might consider using SQL's DISTINCT keyword, e.g. SELECT DISTINCT(caseID) FROM....
This extra code is beyond the scope of this guide.