cancel
Showing results for 
Search instead for 
Did you mean: 

Invalidate() for value node Vs Invalidate() for model node

Former Member
0 Kudos

Hi everyone,

I am curious to know the differences when the same invalidate() function is called on value node and model node.

When i used invalidate() on value node which is databinded to a table its elements got disappeared. I can see the table becomes empty.

But, when i used a model node which is databinded to the table, the elements doesnt disappear.

Why?

Please help me understand this.

Thanks.

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member182534
Active Participant
0 Kudos

Dear Swaminathan,

The Answer is very simple, Invalidate() function is to flush the old data

So when you are flushing a local node its become blank but when you are flushing the model node it is to flush the old data and the new data can take its place .

Regards

Piyas Kumar Das

Former Member
0 Kudos

Hi,

When i first execute the model the response comes in say "Persons" output model node.

When i invalidate it. its elements doesnt disappear. It sync the data to the latest execution.

But when i invalidate the root model node say Z_SEARCH_PERSONS_INPUT , i can see the elements in the response node gets disappear.

WHy is that?

Please help me undersand this part.

Thanks.

former_member182598
Active Contributor
0 Kudos

The best way to understand this is to understand the Model class. Incas of model nodes they don't have a storage location. Memory is allocated for the Model object and Model nodes just reference to the data stored in that particular instance.

You map a model object instance to a model node when you do a bind().

When you invalidate the parent node(Input node) you reinitialize the parent class and all the child classes will also get reinitialize, and you will have to call the execute method to fetch the value for the output node. The invalidate on the output node just rebinds the current model object state to the model node and hence you see the updated value.

Hope it helps.

Thanks

Prashant

former_member182598
Active Contributor
0 Kudos

invalidate() brings a node to it's initial state. For a Value node the state is empty node structure. For a model node it's the state of the model object. So in case of value node the node will become empty, whereas in case of model node it will reflect the current content of model object.

Hope it clarifies the issue.

Thanks

Prashant

junwu
Active Contributor
0 Kudos

regarding the call for model node, it will try to sync data from mode object