I'm trying to figure out how RFC context initialization works.
If I'm not mistaken, when I have to use a model, I have to create a model bound node in the context and I have to initialize it by creating the appropriate structures (the java beans that will hold the values) and binding them to the nodes.
//$$begin ZMCTBPM_A_READ_NOTE_SR00(-15072069) ReadNote_SR00 readNote_SR00Model = new ReadNote_SR00(); com.mycompany.mctciat_rfc.readnot.Zmctbpm_A_Read_Note_Input zmctbpm_A_Read_Note_Input_SR00 = new com.mycompany.mctciat_rfc.readnot.Zmctbpm_A_Read_Note_Input(readNote_SR00Model); java.util.List<com.mycompany.mctciat_rfc.readnot.Zmctbpm_P11> it_Note_SR00 = new ArrayList<com.mycompany.mctciat_rfc.readnot.Zmctbpm_P11>(); zmctbpm_A_Read_Note_Input_SR00.setIt_Note(it_Note_SR00); com.mycompany.mctciat_rfc.readnot.Zmctbpm_A_Read_Note_Output output_SR00_1 = new com.mycompany.mctciat_rfc.readnot.Zmctbpm_A_Read_Note_Output(readNote_SR00Model); java.util.List<com.mycompany.mctciat_rfc.readnot.Zmctbpm_P11> it_Note_SR00_1 = new ArrayList<com.mycompany.mctciat_rfc.readnot.Zmctbpm_P11>(); output_SR00_1.setIt_Note(it_Note_SR00_1); wdContext.nodeZmctbpm_A_Read_Note_Input_SR00().bind(zmctbpm_A_Read_Note_Input_SR00); //$$end
This is what is automatically made by applying the Service Controller template: it's the code put in the wdDoInit() method. I always used the Service Controller template to initialize the model nodes.
Now I was looking to a Web Dynpro written by another person and this WD adopts a strange method to initialize the model nodes. This WD uses a model that holds several functions and the context is initialized in this way:
1) An instance of the model structure is created
MctBpm_Ac_Model modlInst = new MctBpm_Ac_Model();
2) An instance of the desidered function's root node bean is created, passing the model instance as an argument
Get_Lista_Coge_In bapiInGetListaCoge = new Get_Lista_Coge_In(modlInst);
3) The instance of the root node bean is bound to the context
That's it. So I want to know:
1) Are these two different method of initialization equivalent? (i.e. using the Service Controller Template and using the other method?).
2) Why it is necessary to bound model nodes to a java bean/structure and for value nodes it is not?
Edited by: pietro.m on Mar 1, 2011 10:24 AM