Details
-
Bug
-
Resolution: Done
-
Major
-
1.2.1.Final
-
None
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']}"/>