Skip to content

Commit

Permalink
fix(core): execution originalId can be null
Browse files Browse the repository at this point in the history
  • Loading branch information
tchiotludo committed Mar 8, 2023
1 parent a9dc5b6 commit 9145ed4
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions core/src/main/java/io/kestra/core/runners/RunContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,16 @@ protected Map<String, Object> variables(Flow flow, Task task, Execution executio
}

if (execution != null) {
ImmutableMap.Builder<String, Object> executionMap = ImmutableMap.<String, Object>builder()
.put("id", execution.getId())
.put("startDate", execution.getState().getStartDate());

if (execution.getOriginalId() != null) {
executionMap.put("originalId", execution.getOriginalId());
}

builder
.put("execution", ImmutableMap.of(
"id", execution.getId(),
"originalId", execution.getOriginalId(),
"startDate", execution.getState().getStartDate()
));
.put("execution", executionMap.build());

if (execution.getTaskRunList() != null) {
builder.put("outputs", execution.outputs());
Expand Down

0 comments on commit 9145ed4

Please sign in to comment.