How to use script connector with Bonita BPM 7.8 (windows)


I want to use system script connector in windows 10, but I do not get well.
Please give a simple sample.

I tried
Script interpriter:CMD
Execution parameter:/c
Write your script here:where /r D:\test\java_middle\java_middle *.sql

But run the test, output parameter 1.

1 answer


Hi akiko.miyasaka_1367315,

The script connector has two outputs:
* result: contains the actual output (a String most likely) of the script
* exitStatus: contains the return code or RC (an Integer most likely) of the script

Thus, you should map each output onto a variable of your own, so you can use those them outside the connector. You can do this in the "Output operations" panel of the connector definition wizard (for example, using a couple of process variables: scriptOutput (String) and scriptRC (Integer):

However, there is a known issue responsible for the result only returning the content of the "stdout". Thus, any output returned by the script in the "stderr" will go unnoticed.

Now, when you say that your output parameter is 1, I guess that you are referring to the exitStatus, which would mean that the command 'where /r D:\test\java_middle\java_middle *.sql' failed to find any file. In such case, the output message must have been printed in the "stderr", and thus, the result of the connector wouldn't show it anyway.

Unfortunately, until this issue is fixed in the product, there is no way of getting hold of the "stderr" output with the current implementation of the Script Connector.

Of course, you could always replace the current implementation of the connector with an implementation of your own that would take care of this shortage...

I hope this helps.