Skip to Content
author's profile photo Former Member
Former Member

Context STructure to GP output structure

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 16, 2006 at 01:29 PM

    Hi Steve,

    try this:

    IGPStructure outputStructure = technicalDescription.getOutputStructure();
    IGPStructure userStruct = outputStructure.addStructure("UserStructure") ;
    userStruct.setAttributeValue("UserID", value);
    

    Aliaskei

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 16, 2006 at 01:25 PM

    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()); 
    		}

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 16, 2006 at 01:57 PM

    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
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.