[resolved] Is it a bug when using List of Value type context?
Hi,
I defined a context with type "List of Value", however TOS throws cast exception when running the job. And I can see in code that variable actually is defined as "String" under public class ContextProperties. Is this a bug in TOS 6.1?
Please find "userList" and "partyList" from below screenshot.
No, this isn't a bug. This is just down to very poor documentation. The "List of values" option for Context variables isn't to create a List it is to help you create a a drop down menu for users in Studio if you click the "Prompt" tick box in the Context variable config. Try it. When you run the job it will prompt you to select one of your values from a drop down.
If you want to have a list added as a context variable, there are several ways of doing this depending on your ability with Java. The easiest way is to just use a comma separated String and use a tNormalize component to split them. However you can use the Object Context type to hold any Java class. So you can pass an ArrayList to it and make use of that ArrayList in a tJavaRow/tJavaFlex.