From 7589ad356ec1b2a6c2c82e50adb971b96e2d4383 Mon Sep 17 00:00:00 2001 From: Mark Payne Date: Tue, 30 Dec 2014 10:29:38 -0500 Subject: [PATCH] NIFI-174: Always 'enrich' the Provenance SEND event, regardless of whether or not we are commiting ot he repository immediately --- .../repository/StandardProvenanceReporter.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/nar-bundles/framework-bundle/framework/core/src/main/java/org/apache/nifi/controller/repository/StandardProvenanceReporter.java b/nar-bundles/framework-bundle/framework/core/src/main/java/org/apache/nifi/controller/repository/StandardProvenanceReporter.java index 01fb3dc028..23d090cf2d 100644 --- a/nar-bundles/framework-bundle/framework/core/src/main/java/org/apache/nifi/controller/repository/StandardProvenanceReporter.java +++ b/nar-bundles/framework-bundle/framework/core/src/main/java/org/apache/nifi/controller/repository/StandardProvenanceReporter.java @@ -159,14 +159,12 @@ public class StandardProvenanceReporter implements ProvenanceReporter { try { final ProvenanceEventRecord record = build(flowFile, ProvenanceEventType.SEND).setTransitUri(transitUri).setEventDuration(transmissionMillis).setDetails(details).build(); + final ProvenanceEventRecord enriched = eventEnricher.enrich(record, flowFile); + if (force) { - if (eventEnricher == null) { - repository.registerEvent(record); - } else { - repository.registerEvent(eventEnricher.enrich(record, flowFile)); - } + repository.registerEvent(enriched); } else { - events.add(record); + events.add(enriched); } } catch (final Exception e) { logger.error("Failed to generate Provenance Event due to " + e);