Skip to content

JobExecution returned by SimpleJobExplorer.getLastJobExecution() does not have StepExecutions #3810

Closed
@lucaliechti

Description

@lucaliechti

Expected Behavior

When calling SimpleJobExplorer.getLastJobExecution(JobInstance jobInstance), a JobExecution with all its StepExecutions is returned.

Current Behavior

The stepExecutions variable of the returned JobExecution is empty. Calling SimpleJobExplorer.getJobExecutions(JobInstance jobInstance) and taking the last element from there behaves differently; the StepExecutions are there.

Context

The workaround is described in the section above (just take the last element of the getJobExecutions return value). However, I lost some time until I found out about these different implementations. The documentation does not mention anything about missing StepExecutions. I guess there are good reasons behind this, but they are not clear to me and I didn't see them in the documentation.

As I guess this method is most often used in the process of recovering state from an unfinished job, I would expect the StepExecution to be important here. But maybe there are good reasons which I'm unaware of. In this case I would still at least update the Javadoc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: duplicateIssues that are duplicates of other issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions