Hi All,
I have problems with adding an context structure to an output structure.
Defining Code in execution-method:
IGPStructureInfo outputStructure = technicalDescription.getOutputStructureInfo(); IGPStructureInfo structure = outputStructure.addStructure("UserStructure"); structure.setMultiplicity(IGPAttributeInfo.MULITIPLICITY_0_N ); structure.addAttribute("UserID", IGPAttributeInfo.BASE_STRING);
The context structure is designed in the following way:
TableStructure -->USERID -->USERNAME
How can I add the values from the context to my output structure?
Thanks for valueable helps
Bye Steve
Hi Steve,
try this:
IGPStructure outputStructure = technicalDescription.getOutputStructure(); IGPStructure userStruct = outputStructure.addStructure("UserStructure") ; userStruct.setAttributeValue("UserID", value);
Aliaskei
My own soltuion doesnt work
for(int i=0; i<wdContext.nodeTableStructure().size() ; i++){ ITableStructureElement element = wdContext.nodeTableStructure().getTableStructureElementAt(i); outputStructure.getStructure("UserStructure").setAttributeValue("UserId", element.getUSERID()); }
Sorry, I was in hurry...
I thought you want to add values to output structure at runtime.
So,
IGPStructureInfo structureInfo = desc.getInputStructureInfo() ;
IGPAttributeInfo attr = structureInfo.addAttribute("UserID", 0) ;
attr.setMultiplicity(IGPAttributeInfo.MULITIPLICITY_1_N) ;
attr.setType(IGPAttributeInfo.BASE_STRING) ;
attr.setNameKey(TXT_CO_INSTANCE_ID) ;
Aliaksei
Add a comment