with include{MyTest}
Cannot find a component with name 'MyTest' in module: .../20230103.nf.class/./class.nf
-- Check script 'test.nf' at line: 2 or see '.nextflow.log' file for more details
without include{MyTest}
No such variable: MyTest
public class MyTest { | |
private static MyTest INSTANCE = new MyTest(); | |
private MyTest() { | |
} | |
public static MyTest getInstance() { | |
return INSTANCE; | |
} | |
public String getMessage() { | |
return "Hello world"; | |
} | |
} | |
process SAY { | |
input: | |
val(msg) | |
script: | |
""" | |
echo "${msg}" | |
""" | |
} |
include {SAY;MyTest} from './class.nf' | |
nextflow.enable.dsl=2 | |
workflow { | |
SAY( MyTest.getInstance().getMessage() ) | |
} |