A few questions.

Hello all, awesome product!

1. I was wondering where I can find the source code for the basic nodes and for the CDK nodes. I'd like to have a look at how these are done so I can see how they do things.

2. The basic "Database Writer" can only do simple adds. Is there a Database Updater node already written or will I have to create that myself?

3. Can workflows be exported in some way so that a project can just be excecuted from command line?

Cheers

Hi,

n_fitzgerald wrote:

1. I was wondering where I can find the source code for the basic nodes and for the CDK nodes. I'd like to have a look at how these are done so I can see how they do things.

If you go to the Update Manager (or "Update KNIME...") then you will see a category "KNIME Development". Inside there are the source-feature for all features. You may install them and have a look at the sources that are inside the JAR files. Even better, if you use the Developer version, Eclipse will show the sources if you open a class file.

n_fitzgerald wrote:

2. The basic "Database Writer" can only do simple adds. Is there a Database Updater node already written or will I have to create that myself?

I don't think so, but Thomas is our database nodes guru.

n_fitzgerald wrote:

3. Can workflows be exported in some way so that a project can just be excecuted from command line?

If you want to execute flows via the Batch Executor you may either use the workflow directories directly, or export the workflow (File->Export KNIME workflow). The export is just a ZIP of the workflow directory. The Batch Executor can handle both.

Regards,

Thorsten

Thank you for the quick response,
I have the source code packages. Could you direct me to the folder which has the source code for the standard nodes, specifically database reader/writer?

Also, I found the FAQ on BatchExecutor, wondering if this can be run with developer mode, ie, where is knime.sh in the developer kit?
Cheers

Currently we don't have a Database Update node, but we have it on our list of future enhancements.

Regarding the source code for the DB Reader/Writer, after you have updated KNIME, please have look into your knime plugin's folder:
plugins\org.knime.features.base.source_1.3.3\src\org.knime.base_1.3.3
and extract the jar file; within the following folder, you will find the sources:
org\knime\base\node\io\database

Regards, Thomas

You may find it more convenient to use eclipse to find the sources. (Assuming that you are using the developer version of KNIME). What you need to do: Create a knime plugin project (in order to have the dependencies to the KNIME core classes in the build path), then use eclipses "open type..." short cut (located in the menu "Navigate" -> "Open Type...").

The classes of interest are (enter the name in the search field): DBConnection, DBWriterNodeModel and DBReaderNodeModel.

Regards
Bernd

n_fitzgerald wrote:
Also, I found the FAQ on BatchExecutor, wondering if this can be run with developer mode, ie, where is knime.sh in the developer kit?

knime.sh is just wrapper around the knime/eclipse executable that makes sure, the right workspace is selected. You may also call the executable directly, providing the workspace in the data-parameter:
./eclipse -data  -nosplash -application org.knime.product.KNIME_BATCH_APPLICATION ...

Thorsten

Okay, I got the workflow executing from command line, but there was one issue: the workflow uses Database Reader and Writer which trigger a dialogue box asking for an encryption code. This GUI dialogue box even came up when running the workflow through the BatchExecutor. I'm worried about the implications of this when I go to run my workflow on the server (no gui).

We are aware of that. The batch executor in KNIME 2.0 will have an additional option, which allows you to enter the password on the command prompt.

Thanks!
Bernd

Does that mean that the workflow will not execute without a GUI? Like, for instance, if I try to execute it on a remote server through ssh?

That's correct. If the workflow needs password information and no X connection is available, the workflow will fail with KNIME 1.3.x. It will work with 2.0, though.

Is it an urgent requirement for you right now?

Well it was between implementing the program in KNIME or directly with CDK so I think the latter will be easier at this point.

I can't judge how difficult it is to do it in CDK but if the password prompt of the batch executor is the only issue that prevents you from doing it in KNIME then we can probably workaround it.

I see two possibilities:
- You copy the batch executor and the application definition (KNIMEBatchApplication and BatchExecutor) and change them accordingly. This requires some work, I guess.

- You change the plugin loader of your new plugin (you have created one, right?) and set your own encryption key supplier (using a environment variable for instance). I have yet to test this code but it could work:

    public void start(final BundleContext context) throws Exception {
        super.start(context);
        final String encryptionKey = System.getProperty("encryptionKey");
        if (encryptionKey != null && encryptionKey.length() > 0) {
            KnimeEncryption.setEncryptionKeySupplier(
                    new EncryptionKeySupplier() {
                /** {@inheritDoc} */
                public String getEncryptionKey() {
                    return encryptionKey;
                }
            });
        }
    }

Gah, it turns out I can use an X connection afterall, *doh*. Thanks for all your help.

Just as a quick update: The password option in the batch executor ("-masterKey" as argument) did make it into 1.3.5 (which was released yesterday). Please ignore more code snippet above (if anyone was about to try it).

Hi,
I've tried with different combinations of passing the encryption key for the "database writer" using the masterkey option. However, the input dialog always pops up and prompts for the key.

I've tried writing the following
knime.exe -nosplash -consoleLog -noexit -reset -application org.knime.product.KNIME_BATCH_APPLICATION -workflowDir="workspace/myworkspace" -masterkey="myencryptionkey"

and

knime.exe -nosplash -consoleLog -noexit -reset -application org.knime.product.KNIME_BATCH_APPLICATION -workflowDir="workspace/myworkspace" -masterkey=["myencryptionkey"]

Could you point me in the direction of proper syntax?

Regards,
Johannes

Did you tried it exactly as you posted it here?
Maybe you try it with masterKey?
Since Java is case-sensitive it should work then. :wink:

dill wrote:
Maybe you try it with masterKey?

I looked into the code and it is definitely lowercase (my previous post was incorrect). Johannes, we try to reproduce the behavior and report as soon as we know more.

Bernd

Thanks guys,
If it can be of any further assistance my workflow goes:

Database Reader --> Molecule Typecast --> Smiles to CDK --> Lipinski's rule of five --> column filter --> Rename --> Database Writer

Best Regards,
Johannes

Bad news. The masterkey option in KNIME 1.3.5 does not work, since the UI plugins - which are also loaded - override the encryption key set by the BatchExceutor. Sorry for this trouble. Let me know, if you need further help. Regards, Thomas

Has there been any further development on this workaround?

Thanks

Iqbal