Using tArray in tSetGlobalVar

One Star

Using tArray in tSetGlobalVar

When i try to use tArray variable (month) in tSetGlobalVar:
(String)((java.util.ArrayList)globalMap.get( "month" )).get(0)
i get error message:
java.lang.ClassCastException: zarplata.salary3.salary3$row6Struct cannot be cast to java.lang.String
Community Manager

Re: Using tArray in tSetGlobalVar

Hello
The tArray/tArrayIn/tSortIn are the virtual components. Please read this 2569 to learn more information.
After you define variables via tSetGlobalVar, you can use them like this in tJava/tJavaRow or other components:
globalMap.get("month")

Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: Using tArray in tSetGlobalVar

How can i get First element in tArray????
globalMap.get("month") doesn't work, error:
The type of the expression must be an array type but it resolved to Object
Community Manager

Re: Using tArray in tSetGlobalVar

Hello
How can i get First element in tArray????
globalMap.get("month") doesn't work, error:

tArray is a virtual component, you can't use it alone in a job and you can't get First element in tArray via the expression below:
globalMap.get("month")
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business