Given that there is a Spring batch table that captures all the job execution params by key value:
create table BATCH_JOB_EXECUTION_PARAMS
(
JOB_EXECUTION_ID BIGINT not null,
TYPE_CD VARCHAR(6) not null,
KEY_NAME VARCHAR(100) not null,
STRING_VAL VARCHAR(250),
DATE_VAL TIMESTAMP(26,6) default NULL,
LONG_VAL BIGINT,
DOUBLE_VAL DOUBLE,
IDENTIFYING CHAR(1) not null,
constraint JOB_EXEC_PARAMS_FK
foreign key (JOB_EXECUTION_ID) references BATCH_JOB_EXECUTION
);
For example:
KEY_NAME correlationId
STRING_VAL eaa81b53-7f7d-4637-9935-b765405756be
I can query to retrieve the JOB_EXECUTION_ID
SELECT JOB_EXECUTION_ID FROM BATCH_JOB_EXECUTION_PARAMS
WHERE KEY_NAME = 'correlationId' AND STRING_VAL = 'eaa81b53-7f7d-4637-9935-b765405756be'
Then I can query the BATCH_JOB_EXECUTION table for full details of the job execution.
I have a rest endpoint where client provided this correlationId from which I need to grab the results of the job execution that includes BatchStatus, ExitStatus etc to build my response object.
My question is, how can I query to grab the JobExecution object from this param value provided? Is there anyway I can do this using JobExplorer?