cancel
Showing results for 
Search instead for 
Did you mean: 

What is the meaning of xxx.invalidate()?

Former Member
0 Kudos

Dear All,

When the "xx.xx.xx.modelObject().execute()" was executed, why the "xx.xx.invalidate()" is following the "xx.xx.xx.modelObject().execute()"? What is the meaning of xxx.invalidate()? Thanks!

e.g.

wdContext.currentZibp_Rfc_Get_XXXXX_InputElement().modelObject().execute();

wdContext.nodeOutput_XXXXX().invalidate();

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi ,

The actual RFC call is executed via calling the execute() method

wdContext.curren<xxxx>().modelObject().execute()

for which the import parameters for RFC are passed from context model node "yyyy " through data binding and context mapping by code,

wdContext.node<yyyy>().bind(<modelobj>)

yyyy- Input Node (where the import parameters for the RFC are stored)

After calling the execute() method of the executable model object, the RFC Model returns a corresponding response ie the export parameters. However, the model node element in the controller context does not yet point automatically to the corresponding response object in the model. Due to this fact we have to explicitly invalidate the model node .This is executed with the code line

wdContext.node<zzzz>().invalidate()

zzzz - Output Node(where the export parameter from RFC are going to be stored)

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks for all replyer, in especial to Vinod Selva Kumar and Ilan Pillemer.

I appreciate for your answer, thanks a lot!

Former Member
0 Kudos

Hi,

invalidate()

causes all the node's elements to be deleted. If a supply funciton is defined for the node, this function will be invoked.

Walter

Former Member
0 Kudos

First, thanks for your feedback...

"causes all the node's elements to be deleted. "

- Why need to delete all node?

"If a supply funciton is defined for the node, this function will be invoked."

- You mean this function "invalidate" is defined in RFC function (ABAP function) ?

Former Member
0 Kudos

"causes all the node's elements to be deleted. "

- Why need to delete all node?

- It does not delete the node. It deletes the node elements.

A node defines a data structure.

A node element is an object (data) with structure defined by the node.

"If a supply funciton is defined for the node, this function will be invoked."

- You mean this function "invalidate" is defined in RFC function (ABAP function) ?

- I mean a Web Dynpro supply function. Nothing to do with ABAP.

Former Member
0 Kudos

Thanks for your patience.

Last question, why need to delete them after execute the ABAP function?

gill367
Active Contributor
0 Kudos

Gud question

Even i want to know why we invalidate the node just after executing the RFC

thanks

sarbjeet

Former Member
0 Kudos

In response to your question, "Why need to delete them...?" - this is so as to start with a clean slate before populating the Web Dynpro context node with the newly-retrieved data.

Walter

gill367
Active Contributor
0 Kudos

hi

yes we invalidate to make all the input nodes empty for reusing them for next execution .

Thanks

Sarbjeet Singh

Former Member
0 Kudos

Take a second to actually think about what is happening when you use a model, bound to a context.

Firstly, you do not need to bind a model to a context. You can use a model quite nicely without all the context binding.

So understand that the model and the context are separate entities. In fact the context is just memory locations.

So when you execute a model, the model object now has new data stored in its data members.

But any context(s) bound to that model may not need it (yet).... so when you need it - you say the data in the context is no longer valid -- retrieve new data from the specific mode instance to which it is bound. That is what you do when you send the invalidate message to a model bound context.

So you may always just place the invalidate message after the execute message. But the Web Dynpro framework offers much more flexibility than is needed by your Web Dynpro design in these cases.