on 10-16-2006 2:03 PM
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Aliaksei,
the first Line in your is impossible, because you only get OutputStructureInfo with technicalDescription.
It is necessary to take the executionCOntext to get the OutputStructure.
But after correcting your code the problem still exists.
The only difference between our codings ist that you take addStructure, but that also doesnt fix the problem.
The error must exist in the following line, because I commented it out and the code works (but not in the way i want):
outputStructure.addStructure("UserStructure").setAttributeValue("UserId", element.getUSERID())
Bye Steve
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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());
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.