Post a reply

Write your message and submit

Options

Click in the dark area of the image to send your post.

Go back

Topic review (newest first)

gvarga
2011-05-06 07:27:23

Hi,

Thanks for the quick reply!

I tried what you suggested and it works fine now! big_smile

tRowGenerator -main--> tJavaRow -main--tFlowToIterate--iterate--> tSystem

Thank you very much! smile

Best regards,

Gabor Varga

shong
2011-05-06 07:11:47

Hi Gabor Varga
Try to use tJavaRow replace tJava, eg:
tRowGenerator -main--> tJavaRow -main--tFlowToIterate--iterate--> tSystem

on tJavaRow:
globalMap.put(''test", input_row.columnName);


Best regards
Shong

gvarga
2011-05-05 21:34:29

Hi,

I would like to use tSystem in same way, but it does not work for me in TOS 4.2RC3. sad

For example:

tRowGenerator -> tJava -> tSystem

tJava code: globalMap.put("test", "hello");
tSystem command: "cmd /c echo " + (String)globalMap.get("test")

expected output: hello
actual output: null

Can you check what's wrong?

Thanks in advance!

Gabor Varga

shong
2009-05-15 08:09:29

Hello

Thanks for sharing your solutions, but I don't see your image. Can you try to upload it again?

Best regards

         shong

sahanakrish
2009-05-14 21:49:36

I found the solution
We have to use the cmdArray(String[]) instead of command(String)
Have a tjava custom object where you build the String array which contains cmd and its parameters and then put that in the globalMap and get the array from globalMap in tsystem

sahanakrish
2009-05-13 15:19:24

Thanks Shong.

If i replace all " " with "_" it will definetly work and it would look like
This_is_my_first_tweet.
But i want the spaces to be retained which i can achieve if i use the curl cmd on the cmd promt
curl -u user:pswd -d status="This is my first tweet"  http://twitter.com/statuses/update.xml

I was wondering how to get the same result(retained spaces)in Talend tsystem_1 component?

Thanks,
Sahana

shong
2009-05-13 07:55:32

Hello guy
To make your job run, you can replace all the " " with "_".

Code:

"curl -u user:pswd -d status="+(String)globalMap.get("cur_post").replaceAll(" ","_")+" http://twitter.com/statuses/update.xml"

Best regards
       
        shong

sahanakrish
2009-05-12 18:19:37

I am trying to auto tweet some values from the database  to my twitter account every 5 min  and i am using the tsystem to  the same

"curl -u user:pswd -d status="+(String)globalMap.get("cur_post")+" http://twitter.com/statuses/update.xml"

this works when the text i want to tweet( (String)globalMap.get("cur_post") ) is just a string like :"Testing_1_2_3"
but if my (String)globalMap.get("cur_post") or tweet has spaces in  it  "Testing 1 2 3" then it tweets only the first word of my text .i.e Testing

i tried all the following
"curl -u user:pswd -d status=Testing 1 2 3 http://twitter.com/statuses/update.xml"
tweets just : Testing
"curl -u user:pswd -d status=\"Testing 1 2 3\" http://twitter.com/statuses/update.xml"
tweets just : "Testing
"curl -u user:pswd -d status=\'Testing 1 2 3\' http://twitter.com/statuses/update.xml"
tweets just : 'Testing

does not work either and i see the following error

curl: (6) Couldn't resolve host '1'

curl: (6) Couldn't resolve host '2'

curl: (6) Couldn't resolve host '3"''
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed


Any help or suggestions?

Board footer

Powered by FluxBB