Skip to content

Commit da1e786

Browse files
committed
fix and extend the documentation
1 parent eb6555a commit da1e786

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

docs/developer/plugins.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,14 +351,19 @@ class MyObserverFactory implements TraceObserverFactory {
351351
// MyObserver.groovy
352352
import java.nio.file.Path
353353
354+
import nextflow.Session
354355
import nextflow.processor.TaskHandler
355356
import nextflow.trace.TraceObserver
356357
import nextflow.trace.TraceRecord
357358
358359
class MyObserver implements TraceObserver {
360+
private Session session
359361
360362
@Override
361-
void onFlowBegin() {
363+
void onFlowCreate(Session session) {
364+
// store the session for later use
365+
this.session = session
366+
362367
println "Okay, let's begin!"
363368
}
364369
@@ -372,9 +377,14 @@ class MyObserver implements TraceObserver {
372377
println "I found a task in the cache! It's name is '${handler.task.name}'"
373378
}
374379
380+
@Override
381+
void onFileStage(Path destination, Path source) {
382+
println("I staged a file from '${source.toUriString()}' to '${destination.toUriString()}'")
383+
}
384+
375385
@Override
376386
void onFilePublish(Path destination, Path source) {
377-
println "I published a file! It's located at ${path.toUriString()}"
387+
println "I published a file! It's located at '${destination.toUriString()}'"
378388
}
379389
380390
@Override

0 commit comments

Comments
 (0)