WFData is an interface and cannot be constructed. The API documents don’t contain information on implementing classes or their construction (i.e. can they be created with a constructor or are they created by a factory class).
It’s a little obscure (and completely undocumented) but I think I’ve figured it out. If you have a property called “values” that is an array and you want to set it to a new array you do the following:
WFData myDocument = // get your document…
WFData values = myDocument.create(“values”, size);
for (int i = 0; i < values.length; i++) {
values[i] = myDocument.create(“values”);
}
myDocument.setValue(“values”, values);
In order for it to work you have to:
Create the array by calling create(attribute, size).
Call create(attribute) on the array attribute with no index to create each value.
Set the original property.
Without going on a rant, I have to say that the API documents are really poor (using webMethods Workflow 6.1). The create(attribute, size) and create(attribute) methods have zero description. Oh well
Glad you figured it out. I’ve never used WF so my explanation was purely to show how to initialize any type of Java array–I should have explained that in my response.
I’m looking at the WF Client Java API doc now. It is indeed a bit light on description, to put it mildly. It’s a shame that docs simply got the wM branding treatment (WF was acquired) rather than updated to match the normally decent documentation that wM provides with their other products.