This is my first attempt at creating a batch job. The code to start the job is
Properties jobParams = new Properties();
jobParams.setProperty("metadataFile", group.getMetaFilename());
...
long jobId = jobOperator.start(DB_UPDATE_JOB, jobParams);
but when the job accesses the parameters
@Dependent
@Named("MetafileReader")
public class MetafileReader
extends AbstractItemReader {
@Inject
private JobContext jobCtx;
...
@Override
public void open(
Serializable checkpoint)
throws Exception {
String metadataFile =
jobCtx.getProperties().getProperty("metadataFile");
The value is not what was set above but is the value in the DbUpdateJob.xml
<job id="DbUpdateJob" xmlns="http://xmlns.jcp.org/xml/ns/javaee"
version="1.0">
<properties>
...
<property name="metadataFile" value="wrongValue" />
</properties>
What I’m I doing wrong? What is the purpose of JobOperator.start() Properties parameter if it doesn’t allow runtime values to be passed? Thanks for any help with this. Bernie