使用Node:Java Snippet
WFの例と解説
▼配置例▼
1. Node【Table Creator】でWFを開始
2. Node【Java Snippet】で外部ファイル「rename.bat」を起動
▼参考:【Table Creator】設定例▼
Node【Java Snippet】でバッチファイルを起動
▼記述例▼
// Your custom imports: import java.io.*; "--------------------------"; // Enter your code here:" String command = "cmd.exe /c start C:\\Users\\user\\Desktop\\ken_all\\bat\\rename.bat";//execute command Runtime runtime = Runtime.getRuntime();//get runtime object try { if(ROWCOUNT != 0){ runtime.exec(command);//file execute } } catch (IOException e){ throw new Abort(e); }
----解説----
1. 入出力を行うjava.ioパッケージをインポート -->2行目
2. 実行するコマンドを指定 -->5行目
3. runtime objectの取得 -->6行目
4. レコードが0ではない場合に実行するif文 -->8行目
5. 指定ファイルを実行 -->9行目
▼Node設定例▼
▼KNIME Hub▼
kni.me
■External Toolを使用した外部プログラムの起動方法は以下
tama-shi.hatenadiary.com