import "Simantics/DB" import "Simantics/Ontologies" importJava "org.simantics.event.view.EventView" where getEventLogs :: () -> [Resource] findEvents :: [Resource] findEvents = do logs = getEventLogs () slices = map findEventSlices logs slices = join slices events = map findEventsFromSlice slices join events @private findEventSlices :: Resource -> [Resource] findEventSlices log = do collectionToList $ objects_ log L0.ConsistsOf @private findEventsFromSlice :: Resource -> [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 -> ()