2

Is there a syntax to use dynamic values in the JSL (Job Specification Language) file of a JSR-352 Java Batch application?

My specific case is to be able to change the value of the item-count attribute in my chunk element on the fly (no code change, no re-build, no re-deploy...).

maxime.bochon
  • 581
  • 4
  • 14
  • This has been raised as a candidate for improvement before. It's currently tracked in Jakarta Batch as: https://github.com/eclipse-ee4j/batch-api/issues/95 – Scott Kurz Jul 18 '20 at 12:11

1 Answers1

2

You can use any of the 4 property substitutions to achive that. See JSR 352 spec document 8.8.1 Substitution Processing Rules.

  1. jobParameters - specifies to use a named parameter from the job parameters.
  2. jobProperties - specifies to use a named property from among the job's properties.
  3. systemProperties - specifies to use a named property from the system properties.
  4. partitionPlan - specifies to use a named property from the partition plan of a partitioned step.

For example,

item-count = ="#{jobParameters['item-count']}"

If this is not what you want, please elaborate your specific use case.

cheng
  • 1,076
  • 6
  • 6