Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] context variable of type Object not handled correctly

I am trying to pass an Object context variable from a parent job to a sub job, they seem to be converted to String.
I see this bug: http://www.talendforge.org/bugs/view.php?id=11310 was filed and fixed in 3.2.4, I'm using 4.1.2
Am I missing anything? Is there a better way? Please take a look at the short recording I made here to show the issue: http://youtu.be/O4Tx6aOZTXI
Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi
If you want to pass an Object from parent job, don't type new Object() in Contexts tag.
Use tJava or tJavaRow before tRunJob.
Regards,
Pedro

View solution in original post

4 Replies
Anonymous
Not applicable
Author

Hi
I don't think this is a bug.
Because you will find these code in Talend job.
context.new1 = (Object) context.getProperty("new1");

The return data type of getProperty() method is String.
So this Object will be converted into java.lang.String.
Regards,
Pedro
Anonymous
Not applicable
Author

Thanks for the response Pedro, I don't think I understand it though - you're saying that it's not a bug because the generated code turns it into a string? How would I pass an object then from a parent job?
Anonymous
Not applicable
Author

Hi
If you want to pass an Object from parent job, don't type new Object() in Contexts tag.
Use tJava or tJavaRow before tRunJob.
Regards,
Pedro
Anonymous
Not applicable
Author

Thanks pedro, perfect!