I am working with workflow and trying to set values in the form attributes . but getting compilation error on setValues method. please refer issue.txt for code snippet and png files for screen shots. The issue is setValues method is showing in API reference docs but its not populating/visible when calling.
Hi Rama,
This is a pretty odd case, looking through the definition.
The member for "values", does exist in the class, and although it's protected, you may be able to extend the class in order to set the values on your own.
It just doesn't seem to have a SetValues method for MultiLineAttribute in 16.0 and 16.2, as far as I can see. Very strange.
It extends Attribute, which also does not have this defined.
Perhaps the setValues is actually referring to the fValues array, instead? Anyhow, it's a little bit misleading.
However, I'll defer to the experience of the CWS experts who frequent these forums. Maybe there's a reason, for this?
Thanks,
Nizar
You’ll want to use getValues() and then update the backing store that’s returned directly.
-chris
From: eLink Entry: Content Web Services Forum [mailto:otdncontentwebservices971forum@elinkkc.opentext.com]Sent: Thursday, November 02, 2017 1:04 AMTo: eLink RecipientSubject: setValue methods in Attribute
setValue methods in Attribute
Posted by Kolli, Rama On 11/02/2017 03:58 AM
Hi Nizar,
Can you please help me with a code snippet. SetAttribute is already inheriting Attributes, So which class we can use to extend and redefine methods?
Thanks
Madhurya
Hi chris,
I absolutely have no idea what you are talking about. I am trying to use CWS API straightforward and use setValue.can you please elaborate on what you said with code snippet or pseudo code.
Hi Madhurya/Rama,
You may want to read up on inheritance in Java: https://docs.oracle.com/javase/tutorial/java/IandI/subclasses.html
You will probably need to do something like this:
public class MLAExtend extends MultiLineAttribute { public void setValues(List<String> values) { this.values = values; }}
Hi Rama/Madhurya,
There is sample code for this kind of thing, along with the documentation, at http://otdn.opentext.com , following the Content Web Services link.
From: eLink Entry: Content Web Services Forum [mailto:otdncontentwebservices971forum@elinkkc.opentext.com]Sent: Friday, November 03, 2017 12:22 AMTo: eLink RecipientSubject: RE setValue methods in Attribute
RE setValue methods in Attribute
Please check below code snippet If I can do like this for setting Values
if (subSetAttdata instanceof StringAttribute) {
StringAttribute subStrAttr = (StringAttribute) subSetAttdata;
if (subStrAttr.getDisplayName().equalsIgnoreCase("DAT_CUT_LINE_ITEM_WAIV_RM_INIT")) {
subStrAttr.getValues().add(0,"StringValue");
} }