jbatch

JEE Batch Job Specification with many optional Steps

限于喜欢 提交于 2020-01-05 08:27:28
问题 Is there a way to achieve the following logic with JSR 352 Batch API? I have a series of Steps that each need to be executed based on a different condition known when starting the job. ConditionsEntity is provided by an external system. public List<Steps> createStepSequence(ConditionsEntity conditions) { if (conditions.isStep1Enabled()) { steps.add(step1) } if (conditions.isStep2Enabled()) { steps.add(step2) } if (conditions.isStep3Enabled()) { steps.add(step3) } //many more ifs return steps;