use of io.kestra.runner.kafka.KafkaMultipleConditionStorage in project kestra by kestra-io.
the class FlowTriggerWithExecutionTransformer method transform.
@Override
public List<Execution> transform(final ExecutorFlowTrigger value) {
MultipleConditionStorageInterface multipleConditionStorage = new KafkaMultipleConditionStorage(this.multipleStore);
// multiple conditions storage
kafkaFlowExecutor.findByExecution(value.getExecution()).ifPresent(flow -> {
flowService.multipleFlowTrigger(Stream.of(value.getFlowHavingTrigger()), flow, value.getExecution(), multipleConditionStorage).forEach(triggerExecutionWindow -> {
this.multipleStore.put(triggerExecutionWindow.uid(), triggerExecutionWindow);
});
});
List<Execution> triggeredExecutions = flowService.flowTriggerExecution(Stream.of(value.getFlowHavingTrigger()), value.getExecution(), multipleConditionStorage);
// Trigger is done, remove matching multiple condition
flowService.multipleFlowToDelete(Stream.of(value.getFlowHavingTrigger()), multipleConditionStorage).forEach(r -> this.multipleStore.delete(r.uid()));
return triggeredExecutions;
}
Aggregations