cancel
Showing results for 
Search instead for 
Did you mean: 

Passing a value from one dc to another dc in webdynpro

Former Member
0 Kudos

Hi,

I have a wdj application it is creted using two dcs so when in the first dc after model is executed it returns a process id and i want that processid to be in my second dc so plz help me how can i catch that process id from first dc and get it from second dc.

Thanks,

santhosh.

Accepted Solutions (1)

Accepted Solutions (1)

former_member186016
Active Contributor
0 Kudos

Suppose you have following scenario:

1) DC2 having component Comp2. In this dc you read the process id and stores it in context variable "ProcessId".

2) DC1 having component Comp1. Here you want to read the process id from comp2.

In Comp2 create a method getProcessId()

  //@@begin javadoc:getProcessId()
  /** Declared method. */
  //@@end
  public java.lang.String getProcessId( )
  {
    //@@begin getProcessId()
    return (String) wdContext.getCurrentElement().getAttributeValue("ProcessId");
    //@@end
  }

In the interface controller of Comp2 create controller dependency to Comp2 controller. Then in interface controller create method getProcessId()

  //@@begin javadoc:getProcessId()
  /** Declared method. */
  //@@end
  public java.lang.String getProcessId( )
  {
    //@@begin getProcessId()
    return wdThis.wdGetWd2CompController().getProcessId();
    //@@end
  }

Expose the Comp2 as public part now.

In DC1 create DC dependency to DC2.

Build both dc's

In Comp1 create Component usage by name Comp2Usage to Comp2.

Now you can access the method getProcessId() from interface controller of Comp2.

wdThis.wdGetComp2UsageInterface().getProcessId();

Best Regards,

Ashwani Kr Sharma

Former Member
0 Kudos

Hi ,

Ashwin thank you for your reply,but i did every thing like what you said but

i m unable to call the getprocessid method of previous dc ie

return wdThis.wdGetWd2CompController().getProcessId();

after wd.getwd2CompController i m unable to see the getprocessid method ,

plz help me

Thanks & Regards,

santhosh.

Former Member
0 Kudos

Hi Vanama,

This statement will come inside the interface controller of the same comp2.

return wdThis.wdGetWd2CompController().getProcessId();

Regards,

Murtuza

Answers (2)

Answers (2)

Former Member
0 Kudos

hi ashwin,

i m sorry , ie im not getting the method in another dc wdthis.wdget<name>componentusage.method of interface controller but im unable to see this method name,

Thanks & Regards,

santhosh

Former Member
0 Kudos

Hi Santosh,

If you want to see that method in another DC.. goto the component of the DC click on properties tab and click on ADD button and select the interface controller of the first DC.

Now you would be able to see the method in your another DC.

Regards,

Murtuza

Former Member
0 Kudos

hi ashwin,

i m sorry , ie im not getting the method in another dc wdthis.wdget<name>componentusage.method in interface controller but im unable to see this method name,

Thanks & Regards,

santhosh