1 Reply Latest reply on Aug 25, 2016 10:44 AM by cfang

    Is there a way to access the job@id as a property in the JSL

    richardmoore

      I want to use the job id value in my JSL as a property in one of my steps. Is that accessible?

        • 1. Re: Is there a way to access the job@id as a property in the JSL
          cfang

          In principle, any attribute in job xml can be substituted with dynamic value. But since job id is such a fundamental attribute and so you usually want it to be a static value.

           

          For example, you can try:

           

          <job id="#{jobParameters['myJobName']}?:job1;"

           

          then the rest of your job xml can reference the same jobParameters['myJobName'] as the job id.  If this job param is not passed in, then the default job id job1 is used and will not be accessible.

           

          Or you can add a redundant job-level batch property:

           

          <job id="job1">

             <property name="jobName" value="job1"/>

           

          it can be accessible thru #{jobProperties['jobName']}