I have to implement a solution using spring batch. The domain object is order, order can be shipped from certain DC. Based on the qty I should equally split across DCs.
- In reader step, I will identify the DCs.
- In the processor step, I will calculate the qty by dividing the qty/total_number_of_dc
- If there are decimals then round down.
- In the writer step, I will write it back to the DB.
In the 3 step I will round down the units. It is possible that sum of the allocated units to each DC will be less than the total order.
How to create a validator to check this? and if it is less than the order qty then I want to add the units to any of the DC.
How to solve this?
Spring batch has validator but, in the step context how to validate the business logic? I tried to lookup for examples and all I could find is that there are validation step for reading files.
mksp is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.