The easiest way to understand view objects is to look at an example. The later sections in this chapter discuss specific details of particular mappings.
The following example shows how generators map a given import view in the model to a view object.
The import view is shown as follows:
MY_SERVER (procedure step) IMPORTS: Entity View in proxy text1 text2 Group View inGV (2) Entity View ingroup proxy text1
text2
From the given import view, five Java classes are generated. The classes and their properties are:
|
Class |
Attributes |
|---|---|
|
MyServerImport |
|
|
MyServer.InEVProxy |
|
|
MyServer.IngvGV |
|
|
MyServer.IngvGVRow |
|
|
MyServer.IngroupEVProxy |
|
The number of classes increases in proportion with the number of entity views, work sets, and group views.
To finish the sample, it is beneficial to look at how a programmer gets and sets the various pieces of data in the views. The following code snippets are written in Java.
Instantiate the Import View object:
MyServerImport importView = new MyServerImport();
Set the command system level data:
importView.setCommand(“SEND”);
Access the InEVProxy text2Fld attribute:
string value = importView.getInEVProxy().getText2Fld();
Get the maximum capacity of the IngvGV group view:
for (int i = 0; i < importView.getIngvGV().Capacity; i++)
Set the current IngvGV number of rows:
importView.getIngvGV().setLength(2);
Set the text1 attribute of the IngroupEVProxy entity view:
importView.getIngvGV().getRows()[2].getIngroupEVProxy().setText1Fld(“ABC”);
Reset the InEVProxy Entity View back to defaults
importView.getInEVProxy().Reset();
|
Copyright © 2015 CA Technologies.
All rights reserved.
|
|