11-12-2012 12:47 PM
Hi,
I would like to add string into a property defined into a document type without new operation definition.
We can't easily add the item as:
Thanks
11-12-2012 12:59 PM
The following solution is not the most maintainable one (it uses prefixed java classes, even if it is quite stable packages)but works and is 100% Studio
Here is how I did it:
I get the document that stores the list
parameters:
name: listOfSringTmp
Value: @{new java.util.ArrayList()}
Temporary variable where the list of all elements will be stored.
parameters:
script: java.util.Collections.addAll(Context["listOfSringTmp"], Document.getProperty("mySchema:myField"))
We add values stored into your document
parameters:
script: Context["listOfSringTmp"].add("MyNewValue")
And we add the new value
parameters:
script: Document.doc.setPropertyValue("mySchema:myField", Context["listOfSringTmp"].toArray())
And we set back the list into the document
I save my modification.
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.