cancel
Showing results for 
Search instead for 
Did you mean: 

WDA Component Usage - used component's point of view

Former Member
0 Kudos

Hi folks!

Component Usage is a real nice feature of WDA. The using component knows exactly, when which other components are used.

But what about the used component's point of view:

How can a used component find out if it is currently running natively or as a used component and who is the using component?

Alternatively: How can the using component hand over initialization information (parameter) to the used component the used component has access to in component controller method DOINIT?

Background: In my scenario the used component has to "turn right" when it is used by component A and it has to "turn left" when it is used by component B and it has to go straight forward when it is running in "native" mode..

Thanx in advance for any hint!

Kind Regards,

Volker

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Volker,

I would suggest you to do this:

1) In ur used component's component controller have a attribute M_USNG_COMPNAME of type string with default value 'SELF'.

2) Create a method in component controller which receives a string value which is the using component's name

3) In this method set the value of M_USING_COMPNAME with the value passed.

4) So in every using component you can call this method to set the using component's name.

5) So your used component can behave differently when M_USING_COMPNAME has value A and differently when value is B.

6) Used component is running in natively when M_USNG_COMPNAME = 'SELF'

I hope it helps.

Please revert back in case of issues,

Regards,

Sumit

Former Member
0 Kudos

Hi Sumit and Monishankar!

Thank you! Very good ideas. Now I have an additional question:

What is the best way for the used component to inform the using component about status changes - e.g. new search results?

Should I use eventing - and if so: how?

Or should I use registering on context changes in the using component - and if so: how?

Or is there another simple way to achieve it?

Thanx very much.

Regards,

Volker

Former Member
0 Kudos

hI Volker

You can implement the component usage by implementing interface method or interface node.

1. Interface method :-

Here the using component can access methods of used component.

So in your used component you have three method for 1. TURN RIGHT 2. TURN LEFT 3. STRAIGHT

so from comp A you call TURN RIGHT

From component B you can call TURN LEFT.

Make Straight default which can run in "native" mode..

That is if you want to implement from using component's view.

2.You can take a node in your used component as interface node which must be populated by values from other component.

From your using component you can pass the required value .

Now in your used componentcontroller DOINIT method call that interface node and in the make some condition according to the value it get from using component.

But I don't think in this it can run in "native" mode.

However i dont have that much idea about whether the in used component we can keep any log like where it has been used and how.

Thanks & Regards,

Monishankar C