Your autowire both jobs:
@Autowired
private Job procesaClientesJob;
@Autowired
private Job procesaParcialClientesJob;
Your web annotated method would look like this:
@GetMapping("/invokejob/{processType}/{strFecha}")
public String invokejob(@PathVariable String processType, @PathVariable String strFecha) throws Exception {
And the code calling the job would look like this:
JobParameters jobParameters = new JobParametersBuilder().addLong("time",System.currentTimeMillis()).addDate("fecha", fecha).toJobParameters();
if ("full".equals(processType) {
jobLauncher.run(procesaClientesJob, jobParameters);
} else {
jobLauncher.run(procesaParcialClientesJob, jobParameters);
}
And then you call the method like this
curl -v localhost:8080/invokeJob/full/fetchaNotSureWhatThisIs
to fire the "full" job and
curl -v localhost:8080/invokeJob/parcial/thisEither
to fire the "parcial" job