Example with tArrayIn

Not applicable

Example with tArrayIn

hi, it's possible to have an example with the using of tArrayIn ?
i looked into the Components Manual but there's no description for this component !!!
i tried to use it but with no success..
Thanks,
JamesB
One Star

Re: Example with tArrayIn

Hi JamesB,
tArrayOut and tArrayIn operate in pairs and provide temporary storage within a job. I assume that you've already added the components via 3120
Firstly, you must flow data from another component into the tArray and match the schema to the source component. This will put the data into an array (the Destination) within the job.
Then use a tArrayIn and make sure that the Destination matches the Destination from tArray. Another trick is to copy the schema of the tArray using the clipboard and then paste into the tArrayIn schema. Then add subsequent components that flow from tArrayIn.
I tend to use tArray when I need to pass data between sub jobs.
Although these components have been established for some time I have never seen them documented. I assume that esabot still maintains the documentation so can these components please be added?
Cheers,
c0utta
One Star

Re: Example with tArrayIn

you should probably submit a bug request if you want documentation put in for those components
Employee

Re: Example with tArrayIn

I assume that esabot still maintains the documentation so can these components please be added?

esabot is currently taking care of here young baby :-) hmassy is currently in charge of documentation.
Of course these components can be added and the best way to make them come fast is to submit a feature request in the bugtracker, as strpdsnk suggests.
You will find usage examples of tArray in:
- 1012
- 995
Not applicable

Re: Example with tArrayIn

Hi JamesB,
tArrayOut and tArrayIn operate in pairs and provide temporary storage within a job. I assume that you've already added the components via this forum entry.
Firstly, you must flow data from another component into the tArray and match the schema to the source component. This will put the data into an array (the Destination) within the job.
Then use a tArrayIn and make sure that the Destination matches the Destination from tArray. Another trick is to copy the schema of the tArray using the clipboard and then paste into the tArrayIn schema. Then add subsequent components that flow from tArrayIn.
I tend to use tArray when I need to pass data between sub jobs.
Although these components have been established for some time I have never seen them documented. I assume that esabot still maintains the documentation so can these components please be added?
Cheers,
c0utta

Hi c0utta !
my jobs are a little bit complicated but i tried a simple example and it doesn't work this tArrayIn!!
Here's my job :
http://picasaweb.google.it/gjergjD/Talend#5243929509301547074
http://picasaweb.google.it/gjergjD/Talend#5243929506907402114
tFileInputExcel-----tFilterRow---tMap---tArray
|
|
OnSubJobOk
|
|
tArrayIn----tLogRow
but i have this error :
Exception in component tArrayIn_2
java.lang.ClassCastException: conversione_tracciati_sp_da_np_07_08_mattina.prova_1_0_1.prova_1$StructStruct
at myProject.prova_1_0_1.prova_1.tArrayIn_2Process(prova_1.java:988)
at myProject.prova_1_0_1.prova_1.tFileInputExcel_2Process(prova_1.java:7054)
at myProject.prova_1_0_1.prova_1.runJobInTOS(prova_1.java:7174)
at myProject.prova_1_0_1.prova_1.main(prova_1.java:7087)
this because of the Type of the List of the tArrayIn <OnSubjobOkStructarray_tArray_1>,that its not the same type of the tArray that i'm taking
the type of tArray is :
java.util.List<out_IStruct> array_tArray_1 = new java.util.ArrayList<out_IStruct>();
globalMap.put("array_tArray_1", array_tArray_1);

the type of tArrayIn is:
			java.util.List<OnSubjobOkStructarray_tArray_1> list_tArrayIn_2 = (java.util.List<OnSubjobOkStructarray_tArray_1>) globalMap
.get("array_tArray_1");
if (list_tArrayIn_2 == null) {
list_tArrayIn_2 = new java.util.ArrayList<OnSubjobOkStructarray_tArray_1>();

Am i doing something wrong or is this a bug Smiley Sad ?
thanks to both,
Cheers,JamesB
One Star

Re: Example with tArrayIn

Java code is not something that I read very well, so the code doesn't help me very much. Perl is my language of choice, although I have done this same process in Java and it worked fine.
I am assuming that your schema is identical for tArray and the corresponding tArrayIn. Can you put up a screenshot of your schema?
Cheers,
c0utta
Not applicable

Re: Example with tArrayIn

hi c0utta, yes of course the schema is the same for both :
http://picasaweb.google.it/gjergjD/Talend#5244304002113932050
http://picasaweb.google.it/gjergjD/Talend#5244303997793204418
i was waiting for someone of Talend group to confirm this for the Exception that i have when i run my job :
the ClassCastException is because of the different types of tArray and tArrayIn (<out_IStruct> and <OnSubjobOkStructarray_tArray_1>)
and i can't make a cast on the type of tArrayIn because the type of tArray is inside on a static class(static class in java have no constructor so i can call it and cast the type of tArrayIn)
thanks for your response even you don't use java Smiley Wink
Regards, JamesB
One Star

Re: Example with tArrayIn

Hi JamesB,
I created the most basic job with tArray and confirm that I get the same error using Java. You'll need to raise a bug in the tracker to get this fixed.
Cheers,
Brent

Re: Example with tArrayIn

i am having the same issue....any method to resolve it?

Re: Example with tArrayIn

is this bug resolved ??
One Star

Re: Example with tArrayIn

Are there any workarounds for this class cast exception problem?
Maybe named scheme defenition or smth like that?