From 698e832e0e23100d3a5f1866188ed4681f49ec2a Mon Sep 17 00:00:00 2001
From: greg <greg.h@vidarrcap.com>
Date: Wed, 17 Apr 2024 09:32:15 +0100
Subject: [PATCH] data ingest example - more work. Bump to Fluxtion 9.2.21.
 Move @Nopropagte Function and use @ExportService(propagate = false), possible
 bug in Fluxtion.

Added .jmvm config to cookbook build so google code formatter works when running maven in this project
---
 cookbook/.mvn/jvm.config                      | 10 ++++++++
 .../DataIngestConfigListener.java             |  4 ---
 .../dataingestion/api/DataIngestConfig.java   |  4 +++
 .../api/DataIngestConfigListener.java         |  6 +++++
 .../dataingestion/{ => api}/HouseData.java    |  2 +-
 .../builder/DataIngestionBuilder.java         | 15 ++++++++++-
 .../generated/DataIngestion.java              | 25 ++++++++++++++++---
 .../node/CsvHouseDataValidator.java           |  2 +-
 .../node/HouseDataRecordBinaryWriter.java     | 14 +++++++++--
 .../node/HouseDataRecordCsvWriter.java        | 14 +++++++++--
 .../node/HouseDataRecordTransformer.java      | 14 +++++++++--
 .../node/HouseDataRecordValidator.java        |  5 ++--
 .../dataingestion/node/InvalidLog.java        | 14 ++++++++---
 .../dataingestion/node/ProcessingStats.java   |  4 ++-
 .../generated/OpportunityMlProcessor.java     |  4 +--
 .../generated/BreachNotifierProcessor.java    |  4 +--
 pom.xml                                       |  2 +-
 .../generated/RaceCalculatorProcessor.java    |  4 +--
 18 files changed, 117 insertions(+), 30 deletions(-)
 create mode 100644 cookbook/.mvn/jvm.config
 delete mode 100644 cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/DataIngestConfigListener.java
 create mode 100644 cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/api/DataIngestConfig.java
 create mode 100644 cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/api/DataIngestConfigListener.java
 rename cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/{ => api}/HouseData.java (93%)

diff --git a/cookbook/.mvn/jvm.config b/cookbook/.mvn/jvm.config
new file mode 100644
index 0000000..504456f
--- /dev/null
+++ b/cookbook/.mvn/jvm.config
@@ -0,0 +1,10 @@
+--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
+--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
+--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
+--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED
+--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
+--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED
+--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
+--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
+--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
+--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED
diff --git a/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/DataIngestConfigListener.java b/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/DataIngestConfigListener.java
deleted file mode 100644
index cfa59cb..0000000
--- a/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/DataIngestConfigListener.java
+++ /dev/null
@@ -1,4 +0,0 @@
-package com.fluxtion.example.cookbook.dataingestion;
-
-public interface DataIngestConfigListener {
-}
diff --git a/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/api/DataIngestConfig.java b/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/api/DataIngestConfig.java
new file mode 100644
index 0000000..e954412
--- /dev/null
+++ b/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/api/DataIngestConfig.java
@@ -0,0 +1,4 @@
+package com.fluxtion.example.cookbook.dataingestion.api;
+
+public record DataIngestConfig(String name) {
+}
diff --git a/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/api/DataIngestConfigListener.java b/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/api/DataIngestConfigListener.java
new file mode 100644
index 0000000..8654bfb
--- /dev/null
+++ b/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/api/DataIngestConfigListener.java
@@ -0,0 +1,6 @@
+package com.fluxtion.example.cookbook.dataingestion.api;
+
+public interface DataIngestConfigListener {
+
+    boolean configUpdate(DataIngestConfig config);
+}
diff --git a/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/HouseData.java b/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/api/HouseData.java
similarity index 93%
rename from cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/HouseData.java
rename to cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/api/HouseData.java
index b3e6329..9d9b0f8 100644
--- a/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/HouseData.java
+++ b/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/api/HouseData.java
@@ -1,4 +1,4 @@
-package com.fluxtion.example.cookbook.dataingestion;
+package com.fluxtion.example.cookbook.dataingestion.api;
 
 import com.fluxtion.extension.csvcompiler.annotations.ColumnMapping;
 import com.fluxtion.extension.csvcompiler.annotations.CsvMarshaller;
diff --git a/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/builder/DataIngestionBuilder.java b/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/builder/DataIngestionBuilder.java
index b87974f..f857df5 100644
--- a/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/builder/DataIngestionBuilder.java
+++ b/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/builder/DataIngestionBuilder.java
@@ -1,20 +1,33 @@
 package com.fluxtion.example.cookbook.dataingestion.builder;
 
 import com.fluxtion.compiler.EventProcessorConfig;
+import com.fluxtion.compiler.Fluxtion;
 import com.fluxtion.compiler.FluxtionCompilerConfig;
 import com.fluxtion.compiler.FluxtionGraphBuilder;
 import com.fluxtion.compiler.builder.dataflow.DataFlow;
+import com.fluxtion.compiler.builder.dataflow.FlowBuilder;
+import com.fluxtion.example.cookbook.dataingestion.api.HouseData;
 import com.fluxtion.example.cookbook.dataingestion.node.*;
 
 //@Disabled
 public class DataIngestionBuilder implements FluxtionGraphBuilder {
+
+    public static void main(String[] args) {
+        Fluxtion.interpret(c -> {
+            FlowBuilder<CsvHouseDataValidator> csvFlow = DataFlow.subscribe(String.class).map(new CsvHouseDataValidator()::marshall);
+            FlowBuilder<HouseData> validXformedFlow = csvFlow.map(CsvHouseDataValidator::getHouseData)
+                    .map(new HouseDataRecordTransformer()::transform);
+        });
+    }
+
     @Override
     public void buildGraph(EventProcessorConfig eventProcessorConfig) {
         //flows Csv String -> HouseInputRecord -> x_formed(HouseInputRecord)
         var csvFlow = DataFlow.subscribe(String.class).map(new CsvHouseDataValidator()::marshall);
         var validXformedFlow = csvFlow.map(CsvHouseDataValidator::getHouseData)
                 .map(new HouseDataRecordTransformer()::transform)
-                .map(new HouseDataRecordValidator()::validate);
+                .map(new HouseDataRecordValidator()::validate)
+                ;
 
         //outputs
         var csvWriter = new HouseDataRecordCsvWriter();
diff --git a/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/generated/DataIngestion.java b/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/generated/DataIngestion.java
index ae752e9..461fde2 100644
--- a/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/generated/DataIngestion.java
+++ b/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/generated/DataIngestion.java
@@ -21,6 +21,7 @@
 import com.fluxtion.runtime.lifecycle.Lifecycle;
 import com.fluxtion.runtime.EventProcessor;
 import com.fluxtion.runtime.callback.InternalEventProcessor;
+import com.fluxtion.example.cookbook.dataingestion.api.DataIngestConfigListener;
 import com.fluxtion.example.cookbook.dataingestion.node.CsvHouseDataValidator;
 import com.fluxtion.example.cookbook.dataingestion.node.HouseDataRecordBinaryWriter;
 import com.fluxtion.example.cookbook.dataingestion.node.HouseDataRecordCsvWriter;
@@ -57,13 +58,14 @@
  *
  * <pre>
  * generation time                 : Not available
- * eventProcessorGenerator version : 9.2.18
- * api version                     : 9.2.18
+ * eventProcessorGenerator version : 9.2.21
+ * api version                     : 9.2.21
  * </pre>
  *
  * Event classes supported:
  *
  * <ul>
+ *   <li>com.fluxtion.compiler.generation.model.ExportFunctionMarker
  *   <li>com.fluxtion.runtime.time.ClockStrategy.ClockStrategyEvent
  *   <li>java.lang.String
  * </ul>
@@ -76,7 +78,8 @@ public class DataIngestion
         StaticEventProcessor,
         InternalEventProcessor,
         BatchHandler,
-        Lifecycle {
+        Lifecycle,
+        DataIngestConfigListener {
 
   // Node declarations
   private final CallbackDispatcherImpl callbackDispatcher = new CallbackDispatcherImpl();
@@ -380,6 +383,22 @@ public void handleEvent(String typedEvent) {
   }
   // EVENT DISPATCH - END
 
+  // EXPORTED SERVICE FUNCTIONS - START
+  @Override
+  public boolean configUpdate(
+      com.fluxtion.example.cookbook.dataingestion.api.DataIngestConfig arg0) {
+    beforeServiceCall(
+        "public boolean com.fluxtion.example.cookbook.dataingestion.node.HouseDataRecordTransformer.configUpdate(com.fluxtion.example.cookbook.dataingestion.api.DataIngestConfig)");
+    ExportFunctionAuditEvent typedEvent = functionAudit;
+    houseDataRecordTransformer_3.configUpdate(arg0);
+    houseDataRecordCsvWriter_37.configUpdate(arg0);
+    houseDataRecordBinaryWriter_36.configUpdate(arg0);
+    invalidLog_56.configUpdate(arg0);
+    afterServiceCall();
+    return true;
+  }
+  // EXPORTED SERVICE FUNCTIONS - END
+
   public void bufferEvent(Object event) {
     buffering = true;
     if (event instanceof com.fluxtion.runtime.time.ClockStrategy.ClockStrategyEvent) {
diff --git a/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/node/CsvHouseDataValidator.java b/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/node/CsvHouseDataValidator.java
index ed15eab..2c19954 100644
--- a/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/node/CsvHouseDataValidator.java
+++ b/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/node/CsvHouseDataValidator.java
@@ -1,6 +1,6 @@
 package com.fluxtion.example.cookbook.dataingestion.node;
 
-import com.fluxtion.example.cookbook.dataingestion.HouseData;
+import com.fluxtion.example.cookbook.dataingestion.api.HouseData;
 import lombok.Getter;
 
 @Getter
diff --git a/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/node/HouseDataRecordBinaryWriter.java b/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/node/HouseDataRecordBinaryWriter.java
index 8311f08..8acb7a7 100644
--- a/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/node/HouseDataRecordBinaryWriter.java
+++ b/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/node/HouseDataRecordBinaryWriter.java
@@ -1,10 +1,20 @@
 package com.fluxtion.example.cookbook.dataingestion.node;
 
-import com.fluxtion.example.cookbook.dataingestion.HouseData;
+import com.fluxtion.example.cookbook.dataingestion.api.DataIngestConfig;
+import com.fluxtion.example.cookbook.dataingestion.api.DataIngestConfigListener;
+import com.fluxtion.example.cookbook.dataingestion.api.HouseData;
+import com.fluxtion.runtime.annotations.ExportService;
+import com.fluxtion.runtime.annotations.NoPropagateFunction;
 
-public class HouseDataRecordBinaryWriter {
+public class HouseDataRecordBinaryWriter implements @ExportService DataIngestConfigListener {
 
     public void validHouseDataRecord(HouseData message){
         System.out.println("RecordBinaryWriter::validHousingRecord - " + message);
     }
+
+    @Override
+    @NoPropagateFunction
+    public boolean configUpdate(DataIngestConfig config) {
+        return false;
+    }
 }
diff --git a/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/node/HouseDataRecordCsvWriter.java b/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/node/HouseDataRecordCsvWriter.java
index f025c4c..6fc789e 100644
--- a/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/node/HouseDataRecordCsvWriter.java
+++ b/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/node/HouseDataRecordCsvWriter.java
@@ -1,10 +1,20 @@
 package com.fluxtion.example.cookbook.dataingestion.node;
 
-import com.fluxtion.example.cookbook.dataingestion.HouseData;
+import com.fluxtion.example.cookbook.dataingestion.api.DataIngestConfig;
+import com.fluxtion.example.cookbook.dataingestion.api.DataIngestConfigListener;
+import com.fluxtion.example.cookbook.dataingestion.api.HouseData;
+import com.fluxtion.runtime.annotations.ExportService;
+import com.fluxtion.runtime.annotations.NoPropagateFunction;
 
-public class HouseDataRecordCsvWriter {
+public class HouseDataRecordCsvWriter implements @ExportService DataIngestConfigListener {
 
     public void validHouseDataRecord(HouseData message){
         System.out.println("RecordCsvWriter::validHousingRecord - " + message);
     }
+
+    @Override
+    @NoPropagateFunction
+    public boolean configUpdate(DataIngestConfig config) {
+        return false;
+    }
 }
diff --git a/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/node/HouseDataRecordTransformer.java b/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/node/HouseDataRecordTransformer.java
index 34140b1..ecd9796 100644
--- a/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/node/HouseDataRecordTransformer.java
+++ b/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/node/HouseDataRecordTransformer.java
@@ -1,10 +1,14 @@
 package com.fluxtion.example.cookbook.dataingestion.node;
 
-import com.fluxtion.example.cookbook.dataingestion.HouseData;
+import com.fluxtion.example.cookbook.dataingestion.api.DataIngestConfig;
+import com.fluxtion.example.cookbook.dataingestion.api.DataIngestConfigListener;
+import com.fluxtion.example.cookbook.dataingestion.api.HouseData;
+import com.fluxtion.runtime.annotations.ExportService;
+import com.fluxtion.runtime.annotations.NoPropagateFunction;
 import lombok.Getter;
 
 @Getter
-public class HouseDataRecordTransformer {
+public class HouseDataRecordTransformer implements @ExportService(propagate = false) DataIngestConfigListener {
 
     private HouseData record;
 
@@ -13,4 +17,10 @@ public HouseData transform(HouseData record) {
         this.record = record;
         return this.record;
     }
+
+    @Override
+//    @NoPropagateFunction
+    public boolean configUpdate(DataIngestConfig config) {
+        return false;
+    }
 }
diff --git a/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/node/HouseDataRecordValidator.java b/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/node/HouseDataRecordValidator.java
index eee0c01..b372c3d 100644
--- a/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/node/HouseDataRecordValidator.java
+++ b/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/node/HouseDataRecordValidator.java
@@ -1,13 +1,12 @@
 package com.fluxtion.example.cookbook.dataingestion.node;
 
-import com.fluxtion.example.cookbook.dataingestion.HouseData;
+import com.fluxtion.example.cookbook.dataingestion.api.HouseData;
 import lombok.Getter;
 
+@Getter
 public class HouseDataRecordValidator {
 
-    @Getter
     private boolean inValidRecord = false;
-    @Getter
     private HouseData record;
 
     public HouseDataRecordValidator validate(HouseData record){
diff --git a/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/node/InvalidLog.java b/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/node/InvalidLog.java
index 936bd49..151866d 100644
--- a/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/node/InvalidLog.java
+++ b/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/node/InvalidLog.java
@@ -1,9 +1,11 @@
 package com.fluxtion.example.cookbook.dataingestion.node;
 
-import lombok.RequiredArgsConstructor;
+import com.fluxtion.example.cookbook.dataingestion.api.DataIngestConfig;
+import com.fluxtion.example.cookbook.dataingestion.api.DataIngestConfigListener;
+import com.fluxtion.runtime.annotations.ExportService;
+import com.fluxtion.runtime.annotations.NoPropagateFunction;
 
-@RequiredArgsConstructor
-public class InvalidLog {
+public class InvalidLog implements @ExportService DataIngestConfigListener {
 
     public void badCsvRecord(CsvHouseDataValidator message){
         System.out.println("InvalidLog::badCsvInput - " + message.getHouseData());
@@ -12,4 +14,10 @@ public void badCsvRecord(CsvHouseDataValidator message){
     public void badHouseDataRecord(HouseDataRecordValidator message){
         System.out.println("InvalidLog::badHousingRecord - " + message.getRecord());
     }
+
+    @Override
+    @NoPropagateFunction
+    public boolean configUpdate(DataIngestConfig config) {
+        return false;
+    }
 }
diff --git a/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/node/ProcessingStats.java b/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/node/ProcessingStats.java
index ebb5ca5..0c0728a 100644
--- a/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/node/ProcessingStats.java
+++ b/cookbook/src/main/java/com/fluxtion/example/cookbook/dataingestion/node/ProcessingStats.java
@@ -1,6 +1,7 @@
 package com.fluxtion.example.cookbook.dataingestion.node;
 
-import com.fluxtion.example.cookbook.dataingestion.HouseData;
+import com.fluxtion.example.cookbook.dataingestion.api.DataIngestConfig;
+import com.fluxtion.example.cookbook.dataingestion.api.HouseData;
 
 public class ProcessingStats {
 
@@ -15,4 +16,5 @@ public void badHouseDataRecord(HouseDataRecordValidator message){
     public void validHousingRecord(HouseData message){
         System.out.println("ProcessingStats::validHousingRecord - " + message);
     }
+
 }
diff --git a/cookbook/src/main/java/com/fluxtion/example/cookbook/ml/linearregression/generated/OpportunityMlProcessor.java b/cookbook/src/main/java/com/fluxtion/example/cookbook/ml/linearregression/generated/OpportunityMlProcessor.java
index c2062c4..078dfca 100644
--- a/cookbook/src/main/java/com/fluxtion/example/cookbook/ml/linearregression/generated/OpportunityMlProcessor.java
+++ b/cookbook/src/main/java/com/fluxtion/example/cookbook/ml/linearregression/generated/OpportunityMlProcessor.java
@@ -61,8 +61,8 @@
  *
  * <pre>
  * generation time                 : Not available
- * eventProcessorGenerator version : 9.2.18
- * api version                     : 9.2.18
+ * eventProcessorGenerator version : 9.2.21
+ * api version                     : 9.2.21
  * </pre>
  *
  * Event classes supported:
diff --git a/imperative-helloworld/src/main/java/com/fluxtion/example/imperative/helloworld/generated/BreachNotifierProcessor.java b/imperative-helloworld/src/main/java/com/fluxtion/example/imperative/helloworld/generated/BreachNotifierProcessor.java
index ea34451..d842004 100644
--- a/imperative-helloworld/src/main/java/com/fluxtion/example/imperative/helloworld/generated/BreachNotifierProcessor.java
+++ b/imperative-helloworld/src/main/java/com/fluxtion/example/imperative/helloworld/generated/BreachNotifierProcessor.java
@@ -51,8 +51,8 @@
  *
  * <pre>
  * generation time                 : Not available
- * eventProcessorGenerator version : 9.2.18
- * api version                     : 9.2.18
+ * eventProcessorGenerator version : 9.2.21
+ * api version                     : 9.2.21
  * </pre>
  *
  * Event classes supported:
diff --git a/pom.xml b/pom.xml
index baa76a7..dc98a8d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -43,7 +43,7 @@ along with this program.  If not, see
 
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <fluxtion.version>9.2.18</fluxtion.version>
+        <fluxtion.version>9.2.21</fluxtion.version>
         <fluxtion.mavenplugin.version>3.0.14</fluxtion.mavenplugin.version>
         <maven.compiler.source>21</maven.compiler.source>
         <maven.compiler.target>21</maven.compiler.target>
diff --git a/reference-examples/racing-aot/src/main/java/com/fluxtion/example/reference/racing/generated/RaceCalculatorProcessor.java b/reference-examples/racing-aot/src/main/java/com/fluxtion/example/reference/racing/generated/RaceCalculatorProcessor.java
index 62f395e..206e7ca 100644
--- a/reference-examples/racing-aot/src/main/java/com/fluxtion/example/reference/racing/generated/RaceCalculatorProcessor.java
+++ b/reference-examples/racing-aot/src/main/java/com/fluxtion/example/reference/racing/generated/RaceCalculatorProcessor.java
@@ -50,8 +50,8 @@
  *
  * <pre>
  * generation time                 : Not available
- * eventProcessorGenerator version : 9.2.18
- * api version                     : 9.2.18
+ * eventProcessorGenerator version : 9.2.21
+ * api version                     : 9.2.21
  * </pre>
  *
  * Event classes supported: