Discussion:
How to call an AL and pass a hash map to the AL from another AL located in same project
(too old to reply)
p***@gmail.com
2018-05-16 11:56:02 UTC
Permalink
Hi All,

I have 2 ALs, created under same project.
I need to call second AL from first AL's 'End of Data' hook in the FileConnector.
I tried using AssemblyLine Connector, but its not working.
Actually from first AL i need to pass a hashmap to second AL, so that it can be used there.
Could any one tell me how to achieve this from TDI
Eddie Hartman
2018-05-16 17:20:46 UTC
Permalink
The simpleat approach is to pass it to the called AL via the Initial Work Entry:

var map = new java.util HashMap()
...
var iwe = system.newEntry();
iwe.map = map;
al = main.startAL(iwe)

If you use the AssemblyLine FC then pass the map in the Output Map.

Note that the called AL will skip the first read of the Itterator unless you do task.setWork(null);

Hope this helps
p***@gmail.com
2018-05-17 08:04:44 UTC
Permalink
Hi Eddie,

Thanks for the info. As per your suggestion we used Initial Work entry approach and called AL using main.startAL() . Below is the code i used.
var roleMap= new. java.util.HashMap() ;
.....
.....
var secondAL=system.newEntry();
secondAL.roleMap=roleMap;
AL=main.startAL(secondAL);

But we are getting below error

java. lang. Exception: CTGDISO67E Unable to find configuration for AssemblyLine.

Could you please assist. Thank you in Advance
p***@gmail.com
2018-05-17 12:29:00 UTC
Permalink
Hi Eddie,

Please ignore above post. Below is the latest code I am using.I am not getting any error while executing the first AL, but it is not calling the second AL at all.

Below code is in the 'End of Data' Hook of feed connector of first AL


var roleMap= new. java.util.HashMap() ;
.....
.....
var params=system.newEntry();
params.roleMap=roleMap;
var al=main.startAL("secondAL", params);
Eddie Hartman
2018-05-18 08:07:52 UTC
Permalink
Post by p***@gmail.com
Hi Eddie,
Please ignore above post. Below is the latest code I am using.I am not getting any error while executing the first AL, but it is not calling the second AL at all.
Below code is in the 'End of Data' Hook of feed connector of first AL
var roleMap= new. java.util.HashMap() ;
.....
.....
var params=system.newEntry();
params.roleMap=roleMap;
var al=main.startAL("secondAL", params);
There is a technique to debug called ALs. You do this in the CE by right-clicking on the Default server (bottom left panel) and choosing 'Debug server'. This opens up an empty debugger. Now whenever an AL is started you get a sub-tab for that AL.

So, with the Debug server window open, step through your calling AL - or just put a breakpoint in the EOD Hook - and when you step over the main.startAL() call see if the other AL is started. It may be starting up, but failing for some reason.
Loading...