Uploaded image for project: 'JBeret'
  1. JBeret
  2. JBERET-462

Unable to inject Long as @BatchProperty if a property with type long is in jobParameters

    Details

      Description

      See the method start(String jobXMLName, Properties jobParameters) has Properties but values can be any Object. We use long in the injection point.

      Problem:
      If we inject our job-id (from our internal jobs application), we obtain 0.
      If we use type Long in jobParameters, we obtain null.

      Actual status (jberet:1.2.1.Final):
      If we set String in jobParameters, we obtain expected number.

      Expected:
      Setting long in jobParameters can inject long as well.

      But no success with any other type.

          @Inject
          @BatchProperty(name = "job-id")
          @SuppressWarnings("CdiInjectionPointsInspection")
          private long jobId;
      

      This is a code fragment how we start the job with properties:

      public void runBillCreation(long jobId) {
              Properties jobParameters = new Properties();
              jobParameters.put("job-id", jobId);
              jobOperator.start("verification-job", jobParameters);
      

      The XML is attached, see:

      <property name="job-id" value="#{jobParameters['job-id']}"/>
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                cfang Cheng Fang
                Reporter:
                tibor17 Tibor Digana
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: