One Star

Generating dynamic command with tSystem component

There seems to be big issues with the tSystem component. I'm trying to execute an exe with parameters dynamically generated from within talend. The only variables that seems to have any affect inside the tSystem Component are "context"-variables.
However; if I set a context variable inside a tJava or tJavaRow component, the value is not reflected inside the tSystem component; it is still using the default value entered at the context tab.
Trying to avoid this, I tried to use the "Parameters" that you can set in the tSystem component, but I can not get them to work iether and I can not find any documentation regarding them.
Can someone please explain (preferrably with an example) how to create somthing like:
"cmd /c echo " + myName + " is my middle name"
regards,
keif
3 REPLIES
Six Stars

Re: Generating dynamic command with tSystem component

Define a context var....
"cmd /c echo " + context.mycontextvar + " is my middle name"
You can change context var dynamically just be sure where you place the tjava component with the assignement...
ie. tjava----oncomponentok------>tsystem
Six Stars

Re: Generating dynamic command with tSystem component

And I think that what is called "parameters" in tsystem is mislabeled... must be renamed as "environment variables" because actually it defines the environment variables pushed to the spawned process...
bye
One Star

Re: Generating dynamic command with tSystem component

Thank you!
The secret lies within the connection type... Row(Main) can not be used for this. onComponentOk must be used.