on 09-22-2005 7:01 AM
Hi all,
I have a Model Node Structure
Bapi_Project_GetInfo (Model node)
|
-->Output_Project_GetInfo (Model node) |
--->E_Activity_Table_Project_GetInfo (Model node) |
|
-
> Network (Model Attribute)
-
> Short text (Model Attribute)
My Value node Structure
Project_GetInfo (Value node)
|
-->Output_Project_GetInfo_VN (Value node) |
--->E_Activity_Table_Project_GetInfo_VN (Value node) |
|
-
> Network (Value Attribute)
-
> Short Text (Value Attribute)
I want to copy the model attribute to Value attribute.
See my code below..
IWDNodeElement elemSrc, elemDest;
int sizeAccAss = wdContext.nodeE_Activity_Table_Project_GetInfo().size();
for (int i = 0; i < sizeAccAss; i++) {
wdContext
.nodeE_Activity_Table_Project_GetInfo().setLeadSelection(i);
elemSrc = wdContext.currentE_Activity_Table_Project_GetInfoElement();
elemDest = wdContext.createE_Activity_Table_Project_GetInfo_VNElement();
wdContext.nodeE_Activity_Table_Project_GetInfo_VN().addElement(elemDest);
WDCopyService.copyCorresponding(elemSrc, elemDest);
}
This is giving the exception as
Node(NetworkSchedulingDAMR3Comp.Project_GetInfo.Output_Project_GetInfo_VN.E_Activity_Table_Project_GetInfo_VN): cannot bind or add elements because the node has no valid parent
How to debug this..any sample code please.
Thankyou all,
Karthick.K.E
Hi Karthick,
Try the following code
for(int i=0 ; i<wdContext.E_Activity_Table_Project_GetInfo().size() ; i++){
wdContext.currentE_Activity_Table_Project_GetInfo_VNElement targetElem = wdContext.createcurrentE_Activity_Table_Project_GetInfo_VNElement();
wdContext.currentE_Activity_Table_Project_GetInfoElement srcElem = wdContext.nodeE_Activity_Table_Project_GetInfo().getE_Activity_Table_Project_GetInfoElementAt(i);
WDCopyService.copyCorresponding(srcElem,targetElem);
wdContext.nodenodeE_Activity_Table_Project_GetInfo_VN().addElement(targetElem);
}
Regards
Prakash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Karthick,
When you are copying data to destination. destination object should be created. But, here, You have not cretae object for Project_GetInfo. So, first create object of this node using,
wdcontext.createProject_GetInfoElement() method and then bind this ele to the "Project_GetInfo" node using,
wdcontext.nodeProject_GetInfo().bind(<element>);
Now, you need to do same thing for node "E_Activity_Table_Project_GetInfo_VN".
Here, instead of bind method use AddElement() method, because you need to add multiple elements for this.
Then your code will work fine.
Regards,
Bhavik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.