-import "Simantics/DB"\r
-import "Simantics/Ontologies"\r
-\r
-importJava "org.simantics.event.view.EventView" where\r
- getEventLogs :: () -> <ReadGraph> [Resource]\r
-\r
-findEvents :: <ReadGraph, Proc> [Resource]\r
-findEvents = do\r
- logs = getEventLogs ()\r
- slices = map findEventSlices logs\r
- slices = join slices\r
- events = map findEventsFromSlice slices\r
- join events\r
-\r
-@private\r
-findEventSlices :: Resource -> <ReadGraph, Proc> [Resource]\r
-findEventSlices log = do\r
- collectionToList $ objects_ log L0.ConsistsOf\r
-\r
-@private\r
-findEventsFromSlice :: Resource -> <ReadGraph, Proc> [Resource]\r
-findEventsFromSlice slice = do\r
- collectionToList (objects_ slice L0.ConsistsOf)
\ No newline at end of file
+import "Simantics/DB"
+import "Simantics/Ontologies"
+
+importJava "org.simantics.event.view.EventView" where
+ getEventLogs :: () -> <ReadGraph> [Resource]
+
+findEvents :: <ReadGraph, Proc> [Resource]
+findEvents = do
+ logs = getEventLogs ()
+ slices = map findEventSlices logs
+ slices = join slices
+ events = map findEventsFromSlice slices
+ join events
+
+@private
+findEventSlices :: Resource -> <ReadGraph, Proc> [Resource]
+findEventSlices log = do
+ collectionToList $ objects_ log L0.ConsistsOf
+
+@private
+findEventsFromSlice :: Resource -> <ReadGraph, Proc> [Resource]
+findEventsFromSlice slice = do
+ 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> ()