Skip to Content
Former Member
Dec 18, 2006 at 07:48 AM

GP - Pass a stucture output from a WD CO



I've a scenario where in I need to pass a set of values entered by the user on a WD table. i.e effectively as a structure containing a collection of data. I tried using the following code but without any success.

In the action handler I've the followng code:

IGPStructure output = executionContext.getOutputStructure();
IGPStructure struct = output.addStructure("OUTPUT") ;

for(int i=0; i<wdContext.nodeTable().size() ; i++)
            ITableElement element = wdContext.nodeTable().getTableElementAt(i); 
            struct.setAttributeValue("param1",  element.getP1()); 
            struct.setAttributeValue("param2",  element.getP2()); 
            struct.setAttributeValue("param3",  element.getP3()); 

Through this code I got only the last record in the structure. I cannot use setAttributeValues(String,collection) as the attributes' cardinality should be 0:1.

Any leads in this regard will be highly appreciated.