After taking a look at existing python scripting node, I am thinking about using python as below to create node extensions:
Purpose - user can config nodes dialog components instead of creating/changing scripts and achieve data reading/processing/saving target.
Of cause, python and required python package should be installed before using this node. And the prerequisites would be indicated in node description.
User would also need to put java SQLite driver in visible path to Java
- use java to create the dialog, save/load/validate settings
- get code to create tempdir
- load settings, required flow variables, required data into SQLite database(in tempdir)
- create the python script to process data. (I’d like to put it in the final droppins jar file, and hope the script can be executed. But I don’t know how. Any advice?)
- the result processed by python script should be save to another SQLite database by the exact same script
- create Java code to execute the python script
- create Java code to load results from SQLite database, push to out-port.
of cause, I would hope that those codes of saving data to SQLite and loading data from SQLite can be re-used on new extension easily.
May anyone have comments on the way to do it? and question in flow step 4?