cancel
Showing results for 
Search instead for 
Did you mean: 

Recursion node and mapping problem

Former Member
0 Kudos

Hi all,

I try to map a node which contains a “Recursion Node” from a controller to the interface:

The controller: ModelComponent

Context
      - TreeNode (a value node)
            - RecNode (a recursion node)
            - Attribute1 (a value attribute)

The interface: ModelComponent Interface

Context
ModelComponent Context
      - TreeNode (a value node)
            - RecNode (a recursion node)
            - Attribute1 (a value attribute)

TreeNode of interface is mapped to TreeNode of controller and Attribute1 of interface is mapped to Attribute1 of controller.

I can’t map RecNode but it seems to be normal.

When I execute the application I get this error:

com.sap.tc.webdynpro.progmodel.context.ContextException:

RecursiveNodeInfo(ModelComponentInterface.TreeNode.RecNode): you cannot add a recursive child to a mapped node mapped to a data node without recursion

at com.sap.tc.webdynpro.progmodel.context.RecursiveNodeInfo.initAfterCompletedMapping(RecursiveNodeInfo.java:197)

at com.sap.tc.webdynpro.progmodel.context.RecursiveNodeInfo.init(RecursiveNodeInfo.java:182)

at com.sap.tc.webdynpro.progmodel.context.NodeInfo.init(NodeInfo.java:674)

at com.sap.tc.webdynpro.progmodel.context.NodeInfo.init(NodeInfo.java:674)

at com.sap.tc.webdynpro.progmodel.context.Context.init(Context.java:40)

... 48 more

Thanks,

Sébastien.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member485701
Active Participant
0 Kudos

Hi,

I got the problem.

Please correct your mapping.

Map TreeNode from cntroller to interface.

and also map the all the attributes including RecNode.

I think you forgot to map RecNode.

Regards,

Praveen

Former Member
0 Kudos

Hello,

Thanks Praveen for your answer.

If I map RecNode, I still have the problem.

The problem doesn't appear if :

TreeNode of controller is mapped to TreeNode of interface and

Attribute1 of controller is mapped to Attribute1 of interface.

Controller -


> Interface

In this case, TreeNode is an input and declared with isInputElement=true in the interface.

But what I want is TreeNode as output of the component.

So I link the interface to the controller and make this mapping :

Controller <----- Interface

TreeNode of interface mapped to TreeNode of controller and

Attribute1 of interface mapped to Attribute1 of controller.

Regards,

Sebastien

former_member485701
Active Participant
0 Kudos

Hi ,

I got your point...

Reset property of node in interface controller's isInputElement to false.

which is the default value.

and populate the values in component controller.

and map Interface controller's node to component controller's node then it will work like output node.

And you can use your interface controller's node as output node.

Regards,

Praveen

Former Member
0 Kudos

That's what I'm trying to do.

But when I "map Interface controller's node to component controller's node"

I get the error : RecursiveNodeInfo(ModelComponentInterface.TreeNode.RecNode): you cannot add a recursive child to a mapped node mapped to a data node without recursion.

Regards,

Sébastien

former_member485701
Active Participant
0 Kudos

Hi,

you want to use youe interface controler's node as output node in some other DC or component.

then we do not need to map it.

>> IsInputElement should be false.

>> Please do not map it.

Use it without mapping.

And when you are using it to some other Component's used component then do mapping from component's controller to interface controller node....

Regards,

Praveen

REgards,

Praveen

Former Member
0 Kudos

Hi,

Steps to follow.

1) Interface Controller

TreeNode InputElement False collection cardinality 0..n

RecNode [Recusive Node] TreeNode

Attribute 1

2) Component Controller

<b>Copy the interface controller Tree node and paste under the root[Context]</b>

3) Write down the following code to create the elements.

ITreeNodeElement t = wdContext.nodeTreeNode().createAndAddTreeNodeElement();

t.setAttribute1("sss");

ITreeNodeElement t1 = t.nodeRecNode().createAndAddTreeNodeElement();

t1.setAttribute1("sss");

It works.....

Regards

Ayyapparaj

Former Member
0 Kudos

If I don't make the mapping : Component Controller <------- Interface Controller, for

TreeNode of Component A. I populate TreeNode in component controller.

But, when I plug Component B to interface of Component A in order to get TreeNode => I don't get the TreeNode value

When I do this :

              "Component A"                                     "Component B"
'Controller                Interface'                'Interface                 Controller'
TreeNode  <--------------   TreeNode   <-----------  TreeNode  <--------------  TreeNode
                          isInput=false             isInput=true

I get the error

If I don't map TreeNode in component A, I can't get the value in Comp B

              "Component A"                                     "Component B"
'Controller                Interface'                'Interface                 Controller'
TreeNode                   TreeNode <-------------- TreeNode  <--------------  TreeNode
                         isInput=false             isInput=true

former_member485701
Active Participant
0 Kudos

Hi,

I can suggest you another way of doing this, you can try it. May be it will solve your problem according to me.

(1)you have created your component A and created the recursion node and same in interface controller as you have created .

(2)Now you have created your component B , Please do the following steps in this.

(a) Add your component A in component B as used component. If both components are in same DC then it's ok but if they are wexisting in different DC's the you have to add the DC of componet A in the depenedencies of component B.

(b)then map componet B's controller to the used componet A's interface controller context. And Please do not need to set isInputElement anywhere.

Best Regards,

Praveen

Former Member
0 Kudos

Thanks for your answer Praveen.

In the project comp A & comp B are used in a master component and don't know each other.

I use this workaround : context copy

WDCopyService.copySubtree(
	wdContext.nodeTreeNode(),
	wdThis.wdGetModelComponentInterfaceController().wdGetContext().nodeTreeNode());

but I have to trigger it when it's necesarry

Sébastien.