How to use dynamic values in JSL in a JSR-352 Java Batch application

285 views Asked by At

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...).

1

There are 1 answers

0
cheng On

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.