activepivot - Handlers for File Removal -


after loading our initial facts cube, load second file adds measures existing facts (so no new facts created second file). use handler this.

when second file removed filesystem, remove relevant measures facts.

is there way plug directory/file watcher mechanism accomplish this?

you extend

.csvsource.onfileaction(ifilewatcher watcher, collection<string> added, collection<string> modified, collection<string> deleted) 

by calling super.onfileaction(...) process added , modified files, , add more logic handle deleted files.

this can done updating facts has contributed deleted file in deletedfile field. such field filled automatically adding filepath metadata in loadinstructions.csv file:

format,filepattern,filepath,metadata formatname,formatregex.csv,somefolder,filepath=n/a 

and having field like:

<field name="filepath" type="string" indexation="dictionary" nullable="true" defaultvalue="n/a" /> 

Comments