I am trying to pass arraylist ie "Values" with multiple values to have an insight attribute updated with multiple values using below command
def new_attribute_value = objectAttributeBeanFactory.createObjectAttributeBeanForObject(InsightObject, Attribute_type_object, Values as String )
objectFacade.storeObjectAttributeBean(new_attribute_value)
First off... it's bad practice in Java/groovy to capitalize variables. Then it becomes too difficult to differentiate between class names and instances of classes.
But if your "Values" variable contains an ArrayList and you want each of them to generate an ObjectAttributeValue, you can't cast it as a String. You must cast it as an Array of strings.
Like this:
def new_attribute_value = objectAttributeBeanFactory.createObjectAttributeBeanForObject(InsightObject, Attribute_type_object, Values as String[] )
objectFacade.storeObjectAttributeBean(new_attribute_value)
Notice "as String[]" instead of "as String"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.