]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.event/scl/Simantics/Event.scl
Added SCL functions for exporting event log contents to CSV
[simantics/platform.git] / bundles / org.simantics.event / scl / Simantics / Event.scl
index 01a520d52e71c2e8a57967db4aa69c0ad4c95fb5..6839c964c33d0a74c760ba3d675942e0d3c7727b 100644 (file)
@@ -20,4 +20,25 @@ findEventSlices log = do
 @private
 findEventsFromSlice :: Resource -> <ReadGraph, Proc> [Resource]
 findEventsFromSlice slice = do
-    collectionToList (objects_ slice L0.ConsistsOf)
\ No newline at end of file
+    collectionToList (objects_ slice L0.ConsistsOf)
+
+importJava "org.simantics.event.util.EventExporter" where
+    """
+        exportCurrentEvents "\t" "X:/events.txt"
+    
+    exports the currently visible events into the specified
+    text file using the specified column separator string.
+    This function should be used when invoking outside of
+    a database transaction.
+    """
+    exportCurrentEvents :: String -> String -> ()
+
+    """
+        exportCurrentEventsG "\t" "X:/events.txt"
+    
+    exports the currently visible events into the specified
+    text file using the specified column separator string.
+    This variant must be used when invoking the method with
+    DB transaction.
+    """
+    exportCurrentEventsG :: String -> String -> <ReadGraph> ()