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)

alevy
2011-08-11 01:52:31

Use tFixedFlowInput to create a row(s) containing your output and link it to tFileOutputDelimited

brandon_stubbs93
2011-08-10 11:21:31

Hi I got the duration working in a job a while ago

See post
http://www.talendforge.org/forum/viewtopic.php?id=15187

Regards
Brandon

Kyaw Lwin Phyo
2011-08-10 11:15:35

Hi,
I want to write the duration n start time into a file,
how can I do that?
right now, i'm thinking like having 2 context variables liek duration n start_time
which will be assigned values using tJava during run time,
but I don't know how to write into a file.

Please advice.

ytao
2010-01-29 04:38:32

Hi,

Other related report at [Bugtracker] bug 10978.

For using last components, it can be download from:

TOS Trunk component directory

After updates for this two components, input code likes:

Code:

System.out.println(new Date((Long)globalMap.get("tChronometerStart_1_STARTTIME"))); 
System.out.println((Long)globalMap.get("tChronometerStop_1_DURATION"));

Regards.

Serpico
2010-01-28 21:36:34

Thanks Shong for your answer. For now I'll stick to the workaround.

This issue has been reported as a bug (id 11390) on the bugtracker.
Link to the bug: http://www.talendforge.org/bugs/view.php?id=11390

Thanks.

shong
2010-01-28 04:03:29

Hello
Yes, the two global vars are not avaliable now, you can report a bug on our bugtracker.
((String)globalMap.get("tChronometerStop_1_DURATION"))
((String)globalMap.get("tChronometerStart_1_STARTTIME"))
For now, you can extract those values on tJava like this:

Code:

long startTime=(Long)globalMap.get("tChronometerStart_1");
java.util.Calendar c=java.util.Calendar.getInstance();
c.setTimeInMillis(startTime);
java.util.Date date=c.getTime();
System.out.println("Start Time : " +TalendDate.formatDate("yyyy-MM-dd HH:mm:ss",date));

System.out.println("Duration : " +(((Long)globalMap.get("tChronometerStop_1"))-((Long)globalMap.get("tChronometerStart_1")))+"milliseconds");

output result:

Code:

Start Time : 2010-01-28 11:00:17
Duration : 125milliseconds

Best regards

           shong

Serpico
2010-01-27 19:42:13

Hi,

Could it be a bug? Was anyone able to extract those values?

Serpico
2010-01-25 20:28:21

Hi,

I haven't found any post mentioning this, and I have no idea where the problem is.

I am using a tChronometerStart and tChronometerStop in my job to get the start time and execution time of the job, and i am trying to access those values from a tJava component but I am always getting null values even though the tChronometerStop is displaying correctly the result on the console.

I have attached a picture of my simple job. As you can see on the console, the values in the Java code are null, but the tChronometerStop is displaying correctly the result.

The code in my tJava_1 component is the following:

Code:

System.out.println("Duration : " + ((String)globalMap.get("tChronometerStop_1_DURATION")));
System.out.println("Start Time : " + ((String)globalMap.get("tChronometerStart_1_STARTTIME")));

Does anyone know where the problem is and how to access those values from a Java component?

Thank you in advance.

System:
OS: Windows XP
Talend version: TIS 3.2.2r33000
Generated language: Java

Board footer

Powered by FluxBB