Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Calling an AL from another AL

62 views
Skip to first unread message

Rodrigo Almeida

unread,
Dec 10, 2009, 12:54:32 PM12/10/09
to
Hi all,

I'm developing a manual reconciliation and I'd like to know how I can
call an AL from another AL. The first AL executed is in Interator
Mode, reading data from CSV file. This AL has a LDAP connector as
Lookup mode an another LDAP connector as Update mode. In the lookup
connector, I need to call another AL in the same TDI config file in
case of "On no match" Hook. How can I do that?

I read a post here from Eddie Hartman talking about that command:

var al = main.startAL("AL name");
al.join();

Is just that command or I need more than that?

Thank You,
Rodrigo

Eddie Hartman

unread,
Dec 11, 2009, 3:34:48 AM12/11/09
to
That's all you need, Rodrigo.

// start a new AL
al = main.startAL("MyAL");
// wait for it to complete
al.join();
// get Work Entry as it was at end of called AL run
resWork = al.getResult();
// get stats object (numGet(), numAdd(), numLookup(), ...)
resStats = al.getStats();
// get exception from called AL (== null if no error)
resError = stats.getError();

-Eddie

Rodrigo Almeida

unread,
Dec 11, 2009, 8:06:45 AM12/11/09
to
Hi Eddie,

Thanks again. But while I was waiting for an answer, another question
came to my mind.
Imagine that a I have an AL with a lot of component in his Flow. I'l
like to know if I can call
one of these components from a Hook. For example, In a "On no match"
hook from a LDAP connector,
I want call directly another component.

Thanks,
Rodrigo

bjvd

unread,
Dec 11, 2009, 8:51:18 AM12/11/09
to
By "call directly another component", do you mean that the AL should
jump to this flow component, skipping what's in between?
If so, in your hook, use system.skipTo("Your component's name");
/Ben

bjvd

unread,
Dec 11, 2009, 8:52:16 AM12/11/09
to
By "call directly another component", do you mean that the AL should
jump to this flow component, skipping what's in between?
If so, in your hook, use system.skipTo("Your component's name");
/Ben

Rodrigo Almeida

unread,
Dec 11, 2009, 3:16:23 PM12/11/09
to
Yes, I made it.
Thanks.

Eddie Hartman

unread,
Dec 12, 2009, 5:51:53 AM12/12/09
to
On Dec 11, 2:51 pm, bjvd <bj_other_q_st...@yahoo.fr> wrote:
> By "call directly another component", do you mean that the AL should
> jump to this flow component, skipping what's in between?
> If so, in your hook, use system.skipTo("Your component's name");
> /Ben
>
>
>
In addition to system.skipTo(), you can invoke the
operation of another component from script:

MyJDBCConnector.add(work);

or if the Connector's name in the AL contains spaces
or is otherwise non-conformant with variable naming, you
can as the AL for it:

myConn = task.getConnector("My JDBC Connector");
myConn.add(work);

The AssemblyLineComponent and AssemblyLineConnector
classes in the JavaDocs will show you how to invoke the
various operations.

-Eddie

Rodrigo Almeida

unread,
Dec 17, 2009, 6:48:20 AM12/17/09
to
Hi Eddie,

The system.SkiptTo() works fine into my AL.
But in some of my connectors I need to stop the current processing.
So, I used the system.exitFlow(), just to drop the current entry and
get the next one.

But I'm getting the error:

CTGDIS077I Failed with error: Flow.
CTGDIS281E Error caused by: com.ibm.jscript.InterpretException: Script
interpreter error, line=1, col=8
Error calling method 'exitFlow()' on java class
'com.ibm.di.function.UserFunctions'.

Do you know something about that?

Thanks again,
Rodrigo

0 new messages