3 Replies Latest reply on Jan 3, 2017 6:15 PM by cfang

    Resolve systemProperties in string inside batchlet

    richardmoore

      Is there a built in way to resolve the #{systemProperties['VAR']} that are in the contents of a file that is read in by a batchlet?

        • 1. Re: Resolve systemProperties in string inside batchlet
          cfang

          No.  This type of property substitution is specific to JSL.

           

          Your app will need to resolve itself.

          • 2. Re: Resolve systemProperties in string inside batchlet
            sunitha.n

            In job stats listener used 

             

            Job sl = exe.getSubstitutedJob();

              Job uj = ins.getUnsubstitutedJob();

             

            We have job object pulled from SubstitutedJob() and UnsubstitutedJob() Not able display step properties. Inside step properties are not displayed.How to resolve the step properties inside job stats listener

            • 3. Re: Resolve systemProperties in string inside batchlet
              cfang

              job model classes (Job, Step, etc) do not override toString() method.  So if you print out a job or a step, it will not print out human-understandable text.  Once you get hold of a Job, or a Step, you can traverse it and call appropriate methods to display the content you want.

               

              For example, you can call

               

              org.jberet.job.model.Properties props = step.getProperties();

              java.util.Properties  props2 = props.toJavaUtilProperties(props);

              System.out.println(props2);