cancel
Showing results for 
Search instead for 
Did you mean: 

Update Model with ContextData

Former Member
0 Kudos

Hi There,

does anyone know how I can update my model with

the corresponding context-data ?

With wdcontext.nodexy.invalidate() I can transmit

the data stored in the model to the context node, but

how can i bring the data back to the model ?

Thanks & Greetings...

Claus

Accepted Solutions (0)

Answers (1)

Answers (1)

uwe_reeder
Explorer
0 Kudos

Hi Claus,

first of all, invalidate() on a node does not transport the model data to the context. Depending on which node you call it, it might completely clear the context. The reason is that this method <i>invalidates</i> the context, so that it has to acquire its data again. And if there is a rule telling the node how to get data (it can be either a supply function or a supplying relation role in the model), then the node will fetch these data if needed the next time. And if there is none, like in independent nodes, the context will be empty afterwards.

The invalidate is sometimes necessary to inform the context about changes in the underlying model. This is especially the case with the response after an execute of adaptive RFC or a web services. We're working on it.

So how can you bring data back to the model? Well, for properties it's simple. If the context is bound to the model, just write the new value to the corresponding context attribute. This is how user input comes into the model. If you have to modify the structure of the underlying model, then you may switch from the node to the attached model class via the generated method modelInstance(). Once you have this instance you can add, change or remove related objects etc. As told above, it might then be necessary to invalidate some child nodes afterwards.

HTH,

Uwe

Former Member
0 Kudos

Hi Uwe,

thank you. I will try it that way.

Greetings,

Claus