3

I am designing a Java applet based application that has to interact with "KNIME".I want to take a file as input in the applet and send that to "KNIME" file reader.I want to generate a histogram from JFreeChart and and writing the output into a JPEG file through image port writer node.I want the image file output to be displayed in the applet.

May i know how i could connect my application with knime(which is already running) for reading input data and execution of workflow.Are there any nodes that could help me in this work.

BarathVutukuri
  • 1,265
  • 11
  • 23

4 Answers4

0

You can run any external application by using the External Tool Node.

philshem
  • 24,761
  • 8
  • 61
  • 127
  • I dont want KNIME to run external application,I want external application to give input to KNIME File reader and also execute it.Through external node,I have to give input file to KNIME which will be sent to the application.But i want to take input from Java Applet and send it to Filereader in KNIME and execute workflow.I do not want to interact with KNIME.Only my application interacts with it. – BarathVutukuri Feb 18 '14 at 05:54
  • OK, then why don't you just create the file in the workdirectory and then pass a variable to the KNIME File Reader? – philshem Feb 18 '14 at 07:31
  • KNIME File reader is a node where in i have to manually configure it to read the file by using filepicker. How could i call the file reader node to accept the file i am sending through applet. Is there any plugin that accepts the file? or which/what plugin code for the node is reading the file in general manual operation? – BarathVutukuri Feb 18 '14 at 09:59
0

To trigger the workflow from your applet, consider running KNIME in CLI mode, as described here. Make use of some workflow variables to set the input/output file path to your workflow as described in the given FAQ. A potential issue I see might be some latency caused by the startup time of the application.

[edit] After thinking for a second time, I have some doubts that it's at all possible to start a local application from an applet. In fact, I strongly assume, it's not possible :) If you want to stick to your applet, you could add some intermediate REST service though, with which the applet interacts. After submitting the input data, the server side triggers the workflow and returns the result. Or you switch to some standard Swing application instead.

qqilihq
  • 10,794
  • 7
  • 48
  • 89
  • I am not opening KNIME in fresh view.It is already started.And i want to interact with the node through applet for giving file input. – BarathVutukuri Feb 18 '14 at 12:29
  • 1) You won't be able to achieve what you want with standard KNIME. I suggested a suitable solution though, which involves running the workflow through CLI. 2) I understood what you want. – qqilihq Feb 18 '14 at 12:30
  • Thanks for your comment. But i have no experience working with REST API – BarathVutukuri Feb 18 '14 at 12:32
0

It is possible to call KNIME in batch mode and pass over parameters as Flow Variables. These Flow Variables can be used to configure node dialogs, such as the File Reader (path to file) automatically. See e.g.: http://tech.knime.org/node/20877 http://tech.knime.org/forum/knime-developers/setting-flow-variables-on-command-line for details.

Kilian
  • 26
  • 3
0

If you have a KNIME server running, then you can achieve what you want via the REST api. There is a fairly detailed introduction to doing that here - https://www.knime.org/blog/the-knime-server-rest-api

SteveR
  • 583
  • 2
  • 12