Strange issue in Script Connector when using in Recon AL
(too old to reply)
Sufyan Khan
2018-06-21 20:23:49 UTC
Hi All,

I am facing one strange issue in Script Connector in Adapter's Recon AL, please refer below for details -

I have 2 scripts under Resources > Scripts i.e. GenericFunctions and HelperFunctions.

I have a Script Connector in Feed and on connection tab (Include Global Scripts) I have included both the scripts.

While executing AL standalone (not using dispatcher), it is working perfectly fine but when I tried executing the same AL using RMI Dispatcher it gives me error during initialization of the connector -

CTGDIS387E No such script: GenericFunctions (included by <Script Connector Name>).

My Requirement - I am reading Service Form in GenericFunctions script and dynamically setting attributes in one custom entry. So I want to read 3 attributes' values (like targetURL, etc. ) from the same entry inside Script Connector.

2018-06-22 00:51:46 UTC
Please check...
Resources >> Scripts >> GenericFunctions >> Configuration >> Implicitly Included (enabled)
Resources >> Scripts >> HelperFunctions >> Configuration >> Implicitly Included (enabled)

Rgds. YN.
Sufyan Khan
2018-06-22 01:54:24 UTC
Hi YN,

That's the first thing I did, sorry I forgot to mention.

If it wasn't set to implicitly included then while running standalone (without using dispatcher) the results would be unexpected.

2018-06-22 02:49:08 UTC
Hi Sufyan,

a workaround, not pretty, could be to just copy the scripts you need into
the Script Connector.

Here is what I think happen, based on vague memories.
The RMI dispatcher will dynamically construct a new configuration object
in memory, copy the AL you want to run, and maybe some other information,
into that configuration, and then run the AL using the dynamically constructed
configuration. But if the dispatcher does not copy the scripts you need
into the dynamic configuration, the scripts cannot be found, and you will
get the error you mention.
Sufyan Khan
2018-06-22 03:58:51 UTC

Thanks, this would be my last option if I am not able to work this out.
2018-06-22 08:09:14 UTC
Post by Sufyan Khan
Thanks, this would be my last option if I am not able to work this out.
You have to understand that the RMI dispatcher is not a full TDI - so many things working in a full TDI will not work in the RMI dispatcher.

I believe what is happening is that the functions that pulls in the scripts is relying on the "special" objects that is used in TDI (e.g. task,system etc.) - these are not fully available in the RMI dispatcher and you will have to us the real objects instead - this is (from my memory) mostly visible in the script connector environment which is rather annoying as that is what is needed in many cases to write reconciliation routines (search) for adapters where the endpoint is using complex protocols like SOAP/Rest (call/reply type functionality)...

Jens might b able to confirm this - my recommendation is in general to not rely on the special helper objects inside script connectors to be used in the RMI environment, but instead use the full java name...

Franz Wolfhagen