The easiest way to understand view objects is to look at an example. Later sections in this chapter describe how particular mappings occur.
The following example shows how generators map a given import view in the model to a view object.
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 .NET classes are generated. The classes and their properties are shown in the following table:
|
Class |
Attributes |
|---|---|
|
MyServerImport |
|
|
MyServer.InEVProxy |
|
|
MyServer.IngvGV |
|
|
MyServer.IngvGVRow |
IngroupEVProxy-Gets MyServer.IngroupEVProxy object |
|
MyServer.IngroupEVProxy |
|
The number of classes increases in proportion with the number of entity views, work sets, and group views.
To finish the example, it is beneficial to look at how a programmer gets and sets the various pieces of data in the views. The following code fragment is written in C#, but the equivalent VB.NET code looks very similar.
Instantiate the Import View object:
MyServerImport importView = new MyServerImport();
Set the command system level data:
importView.Command = “SEND”;
Access the InEVProxy text2 attribute:
String value = importView.InEVProxy.Text2Fld;
Get the maximum capacity of the IngvGV group view:
for (int i = 0; i < importView.IngvGV.Capacity; i++)
Set the current IngvGV number of rows:
importView.IngvGV.Length = 2;
Set the text1 attribute of the IngroupEVProxy entity view:
importView.Ingv[2].IngroupEVProxy.Text1Fld = “ABC”;
Reset the InProxy Entity View back to defaults:
importView.InProxy.Reset();
|
Copyright © 2015 CA Technologies.
All rights reserved.
|
|