Generating dynamic command with tSystem component

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"
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...
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.

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables


How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration


Why Companies Move to the Cloud: 7 Success Stories

Learn how and why companies are moving to the Cloud

Read Now

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach