cancel
Showing results for 
Search instead for 
Did you mean: 

Context mapping at runtime urgent

Former Member
0 Kudos

Hi all,

I am looking to do context mapping of a value attributes at run time(by coding).

I have one value attribute in my Componet Controller and another value attribute in an interface Controller of another component. I want to do context mapping at runtime.

Any help would be rewarded accordingly.

Regards,

Subu

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Thanks for your replies.

how do I specify which value attribute to context map? I also want to remove the context mapping at runtime.

Regards,

Subu

Former Member
0 Kudos

The value attributes are not created at runtime. They are added at design time. I only want to do the context mapping at runtime.

Regards,

Subu

Former Member
0 Kudos

Hi,

Try this:

//the node in the component controller
IWDNodeInfo destNodeInfo = wdContext.getNodeInfo();

//the node in the interface controller
IWDNodeInfo srcNodeInfo = wdThis.wdGet<external component>Interface().wdGetAPI().getContext().getRootNodeInfo();

//Map alll attributes of the same name.
destNodeInfo.setMapping(srcNodeInfo,true);

Regards,

Satyajit.

Former Member
0 Kudos

Hi,

Thanks for your reply.

I checked the link above it talks about creating a node and then doing context mapping. I would like to do context mapping of a value attribute directly under the root node.

Regards,

Subu.

Former Member
0 Kudos

Hi Subramaniyan,

I think u need this only.

public void wdDoInit()

{

//@@begin wdDoInit()

//Dynamically create a context node

IWDNodeInfo poNodeInfo = wdThis

.wdGetPurchaseOrderCompInterfaceController()

.wdGetAPI()

.getContext()

.getRootNode()

.getChildNode("DynamicPurchaseOrder",

IWDNode.LEAD_SELECTION)

.getNodeInfo();

IWDNodeInfo localNodeInfo = wdThis.wdGetAPI().getContext()

.getRootNodeInfo()

.addMappedChild("DynamicPO", null, true,

false, false, null, false, true);

//Dynamically map the context node

localNodeInfo.setMapping(poNodeInfo, true);

localNodeInfo.addAttributesFromDataNode();

Here for both controllers u can take attribute directly from the context(without node) wdThis.wdGetAPI..getContext.getRootNodeInfo & map the attributes from that.

regards

Sumit