**synon** horse model

98

Click here to load reader

Upload: sats

Post on 13-Nov-2014

754 views

Category:

Documents


75 download

DESCRIPTION

horse model application development in SYNON

TRANSCRIPT

Page 1: **SYNON** HORSE MODEL

Chapter

5 Maintaining Your Application

This chapter introduces the following topics:

Application Maintenance

Prototyping (Animation)

Model Object List Processing

Function Versioning

Model Object Cross References

Impact Analysis

✍ Note: These topics are not needed to complete the tutorial. In addition,some of the concepts covered are somewhat advanced and maybe more suitable after you complete chapters 6 and 7. As a resultyou can safely skip them now and return to them after completingchapter 7.

Application Maintenance

The life of an application does not end oncedevelopment is complete. Over time, the businessrequirements may change or users may requestadditional functionality. These application updates canbe accomplished easily by applying the same principlesand procedures that have been discussed so far.

For example, if you change the length of a field,COOL:2E automatically modifies all files and functionsthat use the changed field, including associated panelsand reports. You will need to examine the panel andreport designs to ensure that they have not exceededtheir limits, and then regenerate the files and functions.

COOL:2E Tutorial TUT 5–1

Page 2: **SYNON** HORSE MODEL

The Submit model create process provides options tosave data prior to generation and compile.

To aid you in managing changes and identifying theimpact of a change on your model, COOL:2E providesa set of powerful tools that are the subject of the rest ofthis chapter.

Animating an Interactive Device Design

Before making a change, you can test and demonstratethe proposed device design using a process calledprototyping or animation . In this topic you will useCOOL:2E animation to simulate the link between theEdit Horse function and the Display Racing resultsfunction.

New terms introduced

animation

prototyping

COOL:Xtras 400 Toolkit

New panels introduced

Animate Function Panels

Open Functions

400 Toolkit Work with Panel Title Details

400 Toolkit Work with Panel Command Key Usage

400 Toolkit Edit Choices

400 Toolkit Edit Actions

Overview ofCOOL:2EAnimation

COOL:2E animation provides a direct link betweenCOOL:2E and the 400 Toolkit prototyping facilities. 400Toolkit is a set of implementation, support, and systemutilities that include menu design, panel design,prototyping, documentation aids, and object list

Animating an Interactive Device Design

TUT 5–2 COOL:2E Tutorial

Page 3: **SYNON** HORSE MODEL

processing. COOL:2E animation lets you transfercontrol to 400 Toolkit, where you can interactivelysimulate your COOL:2E panel designs, and then easilyreturn to COOL:2E.

You can animate a function before you make anychanges to its default action diagram. This lets youthoroughly test your device design before you committo specific programming logic, which is more difficultand time-consuming to change. In addition, you do notneed to generate and compile a function before youanimate it.

For example, you can use animation to demonstrate aproposed design to end users for their review andapproval. You can immediately implement anysuggestions for improvement of the device design usingthe COOL:2E Device Design Editor and then return to400 Toolkit to demonstrate the updated design. You canrepeat this process until you are satisfied with thedesign. At that point, you can begin editing the actiondiagram to implement your design.

Animate the EditHorse DeviceDesign

This step demonstrates the process required to animatethe link between the Edit Horse and Display Racingresults functions.

Begin by displaying the device design for the EditHorse function. Here’s a reminder.

Edit HorseDevicedesign

EditFunctions

EditDatabaseRelations

F

S

Animating an Interactive Device Design

COOL:2E Tutorial TUT 5–3

Page 4: **SYNON** HORSE MODEL

Press F2 to display the Animate Function Panels panel.

AnimateFunctions Panel

This panel is the link between COOL:2E and 400Toolkit. It lets you convert a COOL:2E device design toa 400 Toolkit panel design and optionally transfercontrol to 400 Toolkit. Use options on this panel tospecify the tasks you want to accomplish in 400 Toolkit;for example, you can

• display and work with 400 Toolkit panel designs

• view field and display attributes

Animating an Interactive Device Design

TUT 5–4 COOL:2E Tutorial

Page 5: **SYNON** HORSE MODEL

• enter sample data

• animate panels, windows, and action bars from thecurrent COOL:2E device design

• demonstrate and test navigation using functionkeys, subfile selection, and action bars

Animating EditHorse

In this step you will convert the Edit Horse devicedesign to a 400 Toolkit panel design by accepting thedefault of Y for the Convert Model Panel field. You alsoneed to convert the COOL:2E command key and actionbar navigation so you can simulate the link between thetwo functions. To enter sample data, you need tochange the Display Option field to 3 (CHGDTA).

Type Y for Replace Navigation, Y for Replace ActionBar, and 3 for the Display Option field as shown.

Press Enter to display the 400 Toolkit panel designcorresponding to your COOL:2E device design. Noticethe messages at the bottom of the panel as COOL:2Econverts the device design and the function key andaction bar navigation.

Animating an Interactive Device Design

COOL:2E Tutorial TUT 5–5

Page 6: **SYNON** HORSE MODEL

Entering SampleData for EditHorse

You can now enter sample data in the input-capablefields. These are indicated below by underscores.Output-only fields are shown in black.

✍ Note: The 400 Toolkit panel design reflects the colors orother display attributes you included in yourCOOL:2E device design.

Type the following sample data. Use the Tab and FieldExit keys as you would on a real panel.

Animating an Interactive Device Design

TUT 5–6 COOL:2E Tutorial

Page 7: **SYNON** HORSE MODEL

Press Enter to confirm your entries. This data will beretained until you choose to Clear Test Data on theAnimate Function Panels panel. Press F3 to return tothe COOL:2E device design for Edit Horse.

Editing andMaintainingMultipleFunctions

In the next step you will animate the Display Racingresults function using the same process you just usedfor the Edit Horse function. Since you will need toaccess the Edit Horse function again later in thisprocess, it will save time not to exit and close it whileyou animate the Display Racing results function. TheOpen Functions panel lets you maintain severalfunctions simultaneously.

From the Edit Horse device design, press F3 to exit tothe Edit Function Devices panel.

Open FunctionsPanel

Press F15 to access the Open Functions panel. Youcan access this panel from many COOL:2E panels; forexample, option O on the Edit Functions panel lets youopen multiple functions. This panel lets you open, edit,and maintain several functions simultaneously; in otherwords, you do not need to exit and close one functionbefore you open another function for editing. Thiscapability can save a significant amount of time. Youcan switch quickly and easily between the action

Animating an Interactive Device Design

COOL:2E Tutorial TUT 5–7

Page 8: **SYNON** HORSE MODEL

diagrams, device designs, generated source, andparameter definitions for all open functions.

Note that the Edit Horse function is listed on the OpenFunctions panel since you have not yet exited andclosed it. To open another function, type the name ofthe file and the name of the function in the File andFunction fields. If you are uncertain of the names, type? in these fields instead to display selection lists. Youcan also type * for the File field if the function you wishto open is attached to the same file as the first openfunction listed, in this example, the HORSE file.

In this case, you want to open the Display Racingresults function on the RACE ENTRY file. Type thesenames as shown.

Press Enter to open the Display Racing results functionand display its action diagram. Press F15 to return tothe Open Functions panel.

Note that Display Racing results now appears on thelist. From this panel you can edit a function’s devicedesign, action diagram, or parameters; you can alsoanimate the function.

Animating an Interactive Device Design

TUT 5–8 COOL:2E Tutorial

Page 9: **SYNON** HORSE MODEL

Animating theDisplay RacingResults Function

Type A in the Subfile selector for the Display Racingresults function as shown to animate this function.

Press Enter to display the Animate Function Panelspanel.

ConvertingCommand KeyNavigation

In this step you will convert both the device design andthe command keys defined for the COOL:2E devicedesign, and edit the command key assignments in 400Toolkit.

Animating an Interactive Device Design

COOL:2E Tutorial TUT 5–9

Page 10: **SYNON** HORSE MODEL

To accomplish this, type Y for Replace Navigation andtype 4 (WRKPNL) for the Display Option as shown.

Press Enter . The COOL:2E device design for theDisplay Racing results function is converted to a 400Toolkit panel design and control is transferred to 400Toolkit.

Working with400 ToolkitPanel Designs

The 400 Toolkit Work with Panel Titles panel displays.You can use this panel to edit the 400 Toolkit paneldesign, including the panel layout, command keys, andaction bar. Note the following on this panel.

• The COOL:2E related program name at the bottomof the panel; in this case, MYALDFR. This is theprogram implementation name of the COOL:2Efunction corresponding to this 400 Toolkit paneldesign. It serves as the link back to the COOL:2Efunction. If the function is not already open onreturn to COOL:2E, it is automatically added to theOpen Functions panel before its device design isdisplayed.

• The name of the panel design; in this case,MYALDFR1. By default this is the COOL:2Eprogram implementation name followed by 1. Youwill need this name when you set up the link in theEdit Horse 400 Toolkit panel design.

Animating an Interactive Device Design

TUT 5–10 COOL:2E Tutorial

Page 11: **SYNON** HORSE MODEL

Since you requested that command key navigation bereplaced during the conversion, type 3 for the Optionfield as shown to view the results of the command keyconversion.

400 ToolkitCommand KeyNavigation

This panel shows which panel is to be displayed whena command key is pressed during program simulationin 400 Toolkit. Entries are shown only for commandkeys defined for the function in COOL:2E.

Animating an Interactive Device Design

COOL:2E Tutorial TUT 5–11

Page 12: **SYNON** HORSE MODEL

The possible values for the Next Panel column are

*PRV display the previous panel*SAME redisplay the current panel*EXEC execute the command string shown in

the Text column*EXIT exit the program*ABAR activate the action barname display the named 400 Toolkit panel

design

If you had not converted the command key navigationwhen you converted the Display Racing resultsfunction, only the F3 command key would be defined.This is done by default to provide a way to return toCOOL:2E that you can easily remember. You can alsoreturn to COOL:2E by pressing the Home key.

✍ Note: Refer to the documentation for your terminal orcomputer to learn which is the Home key on yoursystem.

Reassigning aCommand Keyin 400 Toolkit

Since the Display Racing results function is called fromthe Edit Horse function, the F3 command key shouldreturn to Edit Horse. Type the name of the 400 Toolkitpanel design that corresponds to the Edit Horsefunction in the Next Panel column for the F3 commandkey as shown. By default this is the function’simplementation name followed by a 1; for example,MYAEEFR1.

Animating an Interactive Device Design

TUT 5–12 COOL:2E Tutorial

Page 13: **SYNON** HORSE MODEL

Type the 400 Toolkit panel design name thatcorresponds to your Edit Horse function. You can alsotype a ? to select from a list of 400 Toolkit paneldesigns.

Press Enter to confirm your changes. Press F3 to exit.

Press Enter to update the panel design and return tothe COOL:2E Open Functions panel.

Animating an Interactive Device Design

COOL:2E Tutorial TUT 5–13

Page 14: **SYNON** HORSE MODEL

Setting UpAction BarNavigation forEdit Horse

In this step you will set up the command key and actionbar navigation for the Edit Horse function so you cansimulate the link between the Edit Horse and theDisplay Racing results functions using 400 Toolkit.

Type A in the Subfile selector to animate the EditHorse function as shown.

Press Enter .

Since you have already converted this panel design,including the command key and action bar navigation,you can change the value of the Convert Model Panelto N.

Animating an Interactive Device Design

TUT 5–14 COOL:2E Tutorial

Page 15: **SYNON** HORSE MODEL

Type N for Convert Model Panel and change theDisplay Option to 4 (WRKPNL) to work with the 400Toolkit panel design.

Press Enter .

AssigningAction BarNavigation

You need to change the action bar navigation so theDisplay Racing results 400 Toolkit panel designdisplays when you select it from the Selector Choicemenu on the Edit Horse panel design. Type 6 in theOption field to set up the action bar navigation.

Animating an Interactive Device Design

COOL:2E Tutorial TUT 5–15

Page 16: **SYNON** HORSE MODEL

The 400 Toolkit Edit Choices panel shows the actionbar choices that were defined on the COOL:2E devicedesign. You need to edit actions for the Selector Choicemenu.

Type A to edit the actions for the Selector Choice menuas shown.

Press Enter to display the 400 Toolkit Edit Actionspanel.

Note that the Next Panel column contains *SAME. Thismeans that, by default, if you select Display Racingresults from the action bar while simulating yourprogram, the Edit Horse panel would be displayedagain. Instead, you want to display the 400 Toolkitpanel design for the Display Racing results function.

Animating an Interactive Device Design

TUT 5–16 COOL:2E Tutorial

Page 17: **SYNON** HORSE MODEL

Type the name of the 400 Toolkit panel designassigned to the Display Racing results function in theNext Panel column as shown. By default, this is theCOOL:2E program implementation name followed by a1; in this example, MYALDFR1 or type ? for a selectionlist of 400 Toolkit panel designs.

Press Enter to confirm the change. Press F3 to returnto the Edit Choices menu.

Animating an Interactive Device Design

COOL:2E Tutorial TUT 5–17

Page 18: **SYNON** HORSE MODEL

Press F3 to exit.

Press Enter to exit and update the 400 Toolkit paneldesign.

Animating an Interactive Device Design

TUT 5–18 COOL:2E Tutorial

Page 19: **SYNON** HORSE MODEL

Testing theFunction Link

You are now ready to demonstrate the link between thetwo functions. Type S in the Subfile selector for EditHorse to display the COOL:2E Edit Horse devicedesign.

Press Enter .

✍ Note: You could have typed A in the Subfile selectorinstead to animate the function. However, if youstart the animation from the device design, it iseasier to switch between the COOL:2E devicedesign and the 400 Toolkit panel design, namely,you can press F2 from the device design toanimate and press F3 from the panel design toreturn to COOL:2E.

Animating an Interactive Device Design

COOL:2E Tutorial TUT 5–19

Page 20: **SYNON** HORSE MODEL

Animating EditHorse

Press F2 to display the Animate Function Panels panel.Since you have already converted the COOL:2E devicedesign to a 400 Toolkit panel design you can eitheraccept the defaults or type N for the Convert Modelpanel field. Typing N can save time. In this case acceptthe defaults.

Press Enter . The 400 Toolkit panel design for the EditHorse function displays showing the sample data youentered earlier. Input-capable fields are indicated byunderscores; output-only fields are shown in black.

Animating an Interactive Device Design

TUT 5–20 COOL:2E Tutorial

Page 21: **SYNON** HORSE MODEL

Activate theAction Bar

To demonstrate the link between the two functions type/ against one of the subfile records and press F10 toactivate the action bar.

Type S to select the Selector Choice menu from theaction bar; note that it includes Display Racing resultsas an action. Type 1 to select Display Racing results asshown.

Press Enter .

Animating an Interactive Device Design

COOL:2E Tutorial TUT 5–21

Page 22: **SYNON** HORSE MODEL

Display RacingResults PanelDesign

The 400 Toolkit panel design for the Display Racingresults function displays. Input-capable fields areindicated by underscores; output-only fields are shownin black.

Next test the command key navigation you set up forthe Display Racing results panel design by pressing F3.This should cause a return to the 400 Toolkit paneldesign for Edit Horse.

Press F3 to return to the COOL:2E device design forthe Edit Horse function.

Animating an Interactive Device Design

TUT 5–22 COOL:2E Tutorial

Page 23: **SYNON** HORSE MODEL

You could now make design changes to the devicedesign and repeat the animation process until you aresatisfied with the results.

✍ Note: If you have defined command key or action barnavigation in 400 Toolkit, do not choose theoptions to replace action bar or command keynavigation when you reanimate. In other words,accept the defaults for the Replace options on theAnimate Function Panels panel.

Exiting BothFunctions

Press F3 to exit the Device Design Editor. At the EditFunction Devices panel press F15 to return to theOpen Functions panel. From this panel you can eitherexit all open functions, or you can exit functionsindividually using the X Subfile selector option. In thiscase, you will exit all open functions.

Press F3 to exit all open functions. You will proceedthrough the following steps.

• The Exit Function Definition panel displays asecond time for the Edit Horse function. PressEnter to accept the defaults.

• The Exit Function Definition panel displays first forthe Display Racing results function. Press Enter toaccept the defaults.

Animating an Interactive Device Design

COOL:2E Tutorial TUT 5–23

Page 24: **SYNON** HORSE MODEL

• The Edit Functions panel for the HORSE filedisplays. Press F3 to exit and return to the EditDatabase Relations panel.

Press F3 to exit the model.

Animating an Interactive Device Design

TUT 5–24 COOL:2E Tutorial

Page 25: **SYNON** HORSE MODEL

Working with Model Object Lists

This topic introduces the COOL:2E model object listutility.

New terms introduced

model object

model object type

model object list

model object list entry

session list

All Objects list (*ALLOBJ)

New panels introduced

Edit Model Object List

Display Model Object

Work with Model Lists

Subset Model Objects

Position the List window

Objectives To introduce the Edit Model Object List panel, to usesome of its options and capabilities, and to encourageyou to explore the model object list facilities.

✍ Note: This topic presents only examples of ways to usemodel object lists. After you complete theseexamples be sure to experiment on your own untilyou feel comfortable with this tool. Refer to theCOOL:2E module, Generating and ImplementingApplications for more information.

Working with Model Object Lists

COOL:2E Tutorial TUT 5–25

Page 26: **SYNON** HORSE MODEL

Overview ofModel Objectsand ModelObject Lists

By definition a model object is anything in the modelthat you can refer to by name; for example, a file(HORSE) or a function (Edit Horse).

Model ObjectTypes

Within COOL:2E there are seven types of modelobjects, many of which you have defined and used inthis tutorial. Each model object type has a 3-letteridentifier as shown in the following table.

Model Objects Model Object Types

Files FILFields FLDConditions CNDAccess Paths ACPFunctions FUNMessages MSGArrays ARRApplication Areas APP

Model Object Lists A model object list is a logical grouping of modelobjects. The way in which you use model object lists islimited only by your imagination. For example, a modelobject list might consist of all

• model objects changed since a specified date

• model objects related to a particular developmentproject

• access paths and functions that need to begenerated and compiled as a result of a change tothe model

• model objects needed to implement the accountspayable feature of your application

• functions called by an external function in which anexecution error occurred

• model objects that use a specified model object

Since a model object list can be used in many ways,it can be referred to by other names based on the wayin which it is used. For example, a specific modelobject list might be called a session list, copy list,

Working with Model Object Lists

TUT 5–26 COOL:2E Tutorial

Page 27: **SYNON** HORSE MODEL

change list, or model list, for short. In reality, these areall just variations on the same concept.

Model Object ListEntry

A model object list is comprised of a set of referencesto model objects within the model. Each reference isknown as a model object list entry or list entry forshort. Each list entry contains information about amodel object at the time the list entry was created. Inother words, it provides a persistent historic record ofthe object at the time the list entry was created.

Editing YourSession List

At the beginning of this tutorial, you created a sessionlist with the same name as your model profile. Asession list is a model object list to which all modelobjects you change, add, or delete during a session arelogged. Your session list should now contain all objectsyou added or changed while working on the horseracing model.

From the COOL:2E Designer (*DSNR) Menu, select theEdit Session List (changed objects) option as shown.

Press Enter.

The Edit Model Object List panel displays showing allmodel objects you changed during the tutorial.

Working with Model Object Lists

COOL:2E Tutorial TUT 5–27

Page 28: **SYNON** HORSE MODEL

Edit ModelObject List Panel

The Edit Model Object List panel serves as an alternateentry point into your model. It has a PDM-like interfacethat you can use to perform most functions availablefrom the Edit Database Relations panel. The exceptionsare that you cannot edit relations or create modelobjects.

In the following steps you will use the Edit ModelObject List panel to edit the session list you created atthe beginning of this tutorial.

Viewing ModelObject Types

By default model objects are listed alphabetically byobject name and type. Press Roll Up several times toview some of the list. Note the values in the Typecolumn.

List Entry Differsfrom ModelObject

Press Roll Up until you see the list entry for DamHorse name. Note the number 8 to the right of theSubfile selector. This indicates that information for thelist entry on your session list differs from that of theactual model object that the list entry represents. Recallthat earlier in the tutorial, you changed the name of thisfield from Dam Horse name to Dam name.

Working with Model Object Lists

TUT 5–28 COOL:2E Tutorial

Page 29: **SYNON** HORSE MODEL

✍ Note: COOL:2E allows this difference to occur so youcan use your model object list as a historicalrecord.

You can update the model object list entry to reflect thecurrent information for the actual model object. To doso, type 33 for the Subfile selector for Dam Horsename as shown.

Press Enter . The list entry is updated from the detailinformation for the actual model object. In this case, the

Working with Model Object Lists

COOL:2E Tutorial TUT 5–29

Page 30: **SYNON** HORSE MODEL

name of the list entry changes to match the name ofthe model object it represents.

Positioning aModel Object List

You can position the model list displayed to a specificobject type, object name, owner, or implementationname. This topic presents a few examples of ways touse positioning. Feel free to experiment on your own.

Press F7 to display the Position the List window. Thevalues you enter in this positioner window alsodetermine the order in which the model objects display.

Working with Model Object Lists

TUT 5–30 COOL:2E Tutorial

Page 31: **SYNON** HORSE MODEL

Type FUN (function) as shown.

Press Enter .

Note that the list is now positioned at the first modelobject of type FUN. The following model objects aredisplayed alphabetically by type, and for each type,alphabetically by object name. Note the messagedisplayed at the bottom of the panel indicating this.

Scroll through the list to verify this.

Working with Model Object Lists

COOL:2E Tutorial TUT 5–31

Page 32: **SYNON** HORSE MODEL

Press F7 again. Blank out the Type field and typeHORSE for Owner as shown.

Press Enter .

Note that the list is now positioned at the first modelobject that has HORSE as its owner. Note the messageat the bottom of the panel. The following model objectsare displayed alphabetically by Owner, and for eachOwner, alphabetically by Object Type, and then byObject Name. Scroll through the list to verify this.

Working with Model Object Lists

TUT 5–32 COOL:2E Tutorial

Page 33: **SYNON** HORSE MODEL

Returning to theTop of the List

You can also use the positioner window to returnquickly to the top of the model list displayed.

Scroll down so the list is not positioned at the top.Press F7 again. Blank out all fields as shown.

Press Enter . The list will be repositioned to the top ofthe list in order by object name and type.

Working with Model Object Lists

COOL:2E Tutorial TUT 5–33

Page 34: **SYNON** HORSE MODEL

Viewing aSubset of aModel Object List

You can also display a subset of a model object list,based on such criteria as Object name, Type, Owner,Implementation name, and the date the model objectswere created or changed.

Suppose you want to view all Select Record (SELRCD)functions on your session list. To do so, press F17 todisplay the Subset Model Objects panel. (Press F24 tosee more command keys.) Type *FUN for the Type fieldand type SELRCD for the Function type field as shown.

Press Enter twice.

Working with Model Object Lists

TUT 5–34 COOL:2E Tutorial

Page 35: **SYNON** HORSE MODEL

The list now displays only the model objects that meetthe criteria you entered on the Subset Model Objectspanel. Note the message at the bottom of the panelindicating that the list is subsetted; in other words, notall model objects in the list are displayed.

Subsetting is useful when you work with long lists orwhen you want to work only with specific types ofmodel objects; for example, functions or access paths.Spend time experimenting with this feature.

OpeningMultipleFunctions atOne Time

Suppose you want to work with each of the SelectRecord functions on your model list; for example, toedit their device designs or action diagrams. Press F23three times to view additional Subfile selector options.Option 30 lets you open several functions at once.

Type 30 in the Subfile selector of the first functiondisplayed, Select Course, as shown.

Next, press F24 to view additional command keys. TheF13 command key automatically repeats the Subfileselector option you entered for all following subfilerecords to the end of the list.

Press F13 to repeat option 30 for each functiondisplayed.

Working with Model Object Lists

COOL:2E Tutorial TUT 5–35

Page 36: **SYNON** HORSE MODEL

A message at the bottom of the screen tells you thatthe option was repeated to the end of the model list.

Press Enter to open each of the selected functions.The functions are added to the Open Functions panel.

Working with Model Object Lists

TUT 5–36 COOL:2E Tutorial

Page 37: **SYNON** HORSE MODEL

Editing ModelObjects

Subfile selector option 2 on the Edit Model Object Listpanel accesses the appropriate COOL:2E editing panelaccording to the type of the selected model object. Thefollowing table shows examples for object types andpanels you have used earlier in this tutorial.

Type COOL:2E Editing Panel Displayed

ACP Edit Access Path Details

CND Edit List Condition for LSTEdit Field Condition Details for VAL

FIL Edit File Details

FLD Edit Field Details

FUN Edit Function Details

MSG Edit Message Function Details

If you type 2 for the Subfile selector of several modelobjects of differing types, COOL:2E displays theappropriate editing panel for each model object, one atat time.

Exercise Type 2 in the Subfile selector for model objects ofseveral different types of model objects and pressEnter . Notice which COOL:2E editing panel displays ineach case. Press F3 to return to the Edit Model ObjectList panel.

EditingConditions forEntry Status

You can also edit only specific objects by subsetting themodel list first. Suppose you want to view and possiblychange the condition values you defined for the EntryStatus field on the RACE ENTRY file. For example, youcan change the condition names and status values.Note that you cannot add a new condition in this waysince you need to use the Edit Database Relationspanel to create a model object.

Working with Model Object Lists

TUT 5–38 COOL:2E Tutorial

Page 38: **SYNON** HORSE MODEL

Press F17 to display the Subset Model Objects panel.Type *CND for the Type field, VAL for the Attributefield, and Entry Status for the Owner field as shown.

Press Enter twice to display the subsetted list.

Working with Model Object Lists

COOL:2E Tutorial TUT 5–39

Page 39: **SYNON** HORSE MODEL

Exercise View and optionally change each condition value.Namely, type 2 for the first condition value displayed,and then press F13 to repeat this option for the rest ofthe condition values. Press Enter to display the EditField Condition Details panel for each condition value.Press F3 to exit each editing panel and finally to returnto the Edit Model Object List panel.

Displaying theUnsubsettedModel List

From the Edit Model Object List panel, press F17 todisplay the Subset Model Objects panel. Press F5 torestore the default values for all fields and press Enterto display the original unsubsetted list.

EditingRelations andCreating Objects

As already mentioned, you cannot edit relations orcreate model objects using the Edit Model Object Listpanel. If you need to edit a relation or create a modelobject, you can transfer temporarily to the EditDatabase Relations panel by entering the Edit Model(YEDTMDL) command on the command line as shown.

Press Enter .

Working with Model Object Lists

TUT 5–40 COOL:2E Tutorial

Page 40: **SYNON** HORSE MODEL

When you finish editing relations, press F3 to return tothe Edit Model Object List panel.

Deleting a ModelList Entry

The Edit Model Object List panel provides two deletionoptions. Option 24 deletes the actual model object fromthe model; option 4 deletes an list entry from thedisplayed model object list. When you delete a modelobject list entry (option 4), COOL:2E displays a confirmpanel for each selected list entry.

Note that you cannot delete a model object if it is usedby other objects in the model. COOL:2E providesimpact analysis tools to help you determine whetherand how a model object is used by other modelobjects. Impact analysis is discussed later in thischapter.

✍ Note: Because you can use a model object list as ahistoric record for your model, it can containentries for model objects that you have deletedfrom the model. These list entries are indicated byan X to the right of the Subfile selector.

For practice you will delete a list entry from yoursession list in this step. You will replace it later so yoursession list continues to represent all changes to your

Working with Model Object Lists

COOL:2E Tutorial TUT 5–41

Page 41: **SYNON** HORSE MODEL

model. Remember, you are deleting a list entry, not themodel object.

Enter 4 in the Subfile selector for the Change Courseinternal function as shown.

Press Enter . COOL:2E displays a confirm panel.

Press Enter to confirm the deletion.

Working with Model Object Lists

TUT 5–42 COOL:2E Tutorial

Page 42: **SYNON** HORSE MODEL

All Objects List Each model contains a special list containing currentinformation about each object in the model. This list isreferred to as the All Objects list and is accessed withinthe model as *ALLOBJ.

The major purpose of the All Objects List is to providea central location for model object information and torecord information related to changes. The informationfor each model object is contained in a model objectdescription, or detail. As you create, delete, update, andgenerate model objects, COOL:2E automaticallyupdates the corresponding model object description inthe All Objects list to reflect the changes.

Accessing theAll Objects List

One way to access the All Objects List is to type*ALLOBJ in the List field at the top of the Edit ModelObject List panel.

Type *ALLOBJ for the List field as shown.

Press Enter .

The List field now contains *ALLOBJ. This means thereis a one-to-one correspondence between the modelobjects displayed and the actual model objects thatcomprise your model. In particular, note that the modelobject you deleted from your session list, namely,Change Course, appears on the All Objects List.

Working with Model Object Lists

COOL:2E Tutorial TUT 5–43

Page 43: **SYNON** HORSE MODEL

How *ALLOBJand Model ListsDiffer

Technically, the All Objects list is not really a modelobject list; however, it is often useful to think of it as alist. In general, you can use the Edit Model Object Listpanel to work with the All Objects List as you would anamed model object list. However, since the All Objectslist represents actual model objects, note the followingexceptions.

• You can delete a model object, but you cannotdelete a list entry. In other words, you can useoption 24, but not option 4.

• You cannot add a model object to the All Objectslist since that requires creating a model object.

• While the All Objects list contains all active modelobjects, named model object lists typically representa subset of all model objects in the model.

DisplayingAlternate Viewsof DetailInformation

The Edit Model Object List panel provides five alternateviews of detail information for each model object. Theinformation shown in the five views is dynamic whenyou are working with the All Objects list; in other words,if you update a model object, COOL:2E automaticallyupdates the information displayed to reflect the change.For named model object lists, the information displayedis static and reflects the state of the model object at thetime it was added to the model object list.

The following views are available.

• Basic information

• Implementation information

• Component Change information

• Change information

• Check out information

Details about each of these views is beyond the scopeof this tutorial. To learn more, see the COOL:2Emodule, Generating and Implementing Applications.

Exercise Press F11 to view the five alternate views ofinformation from the detail for the model objects

Working with Model Object Lists

TUT 5–44 COOL:2E Tutorial

Page 44: **SYNON** HORSE MODEL

displayed. Some of this information depends on thetype of the model object so you should scroll throughthe list while viewing each alternate view.

Restoring theDeleted SessionList Entry

In this step you will restore the Change Course functionto your session list. Subfile selector option 11 lets youselect model objects to be added to another modelobject list. The default for this alternate list is the Modellist for commands specified in your model profile. Inyour case it is the same as your session list.

Type 11 in the Subfile selector for the Change Coursemodel object.

Press Enter . A message at the bottom of the panelindicates that the model object has been added to yoursession list.

✍ Note: Alternatively you can press F4 instead of Enter toprompt option 11. This lets you enter the name ofanother alternate list or *SELECT to select from alist of all model object lists.

Working with Model Object Lists

COOL:2E Tutorial TUT 5–45

Page 45: **SYNON** HORSE MODEL

Accessing OtherModel Lists

You can type the name of a model list in the List fieldon the Edit Model Object List panel to transfer quicklyamong model object lists defined for your model. Youcan also press F4 to prompt a selection list of all modelobject lists you have defined.

Returning toYour SessionList

Type the name of your session list in the List field asshown. Be sure to substitute the name of your sessionlist.

Press Enter . Note that Change Course has beenrestored to your session list.

Working with Model Object Lists

TUT 5–46 COOL:2E Tutorial

Page 46: **SYNON** HORSE MODEL

Working withModel ObjectLists

The Work with Model Lists panel lets you manage themodel object lists in your model. You can access thispanel from the COOL:2E Designer (*DSNR) Menu, theDisplay Services Menu, or by typing the Work withModel Lists (YWRKMDLLST ) command on a commandline.

Type YWRKMDLLST on the command line as shown.

Press Enter . The Work with Model Lists panel displaysshowing all the model lists defined for your model. Inyour case, only your session list will be shown. Thefollowing is an example of how this panel might look ina working model.

Working with Model Object Lists

COOL:2E Tutorial TUT 5–47

Page 47: **SYNON** HORSE MODEL

For any list displayed you can

• view the list entries

• edit the list

• clear all entries from the list

• copy the list to another list

• change the list’s descriptive text

• remove the list

If you type option 2 in the Subfile selector of any list,the Edit Model Object List panel displays for theselected list. As a result, this panel provides anothermethod of entering your model.

Press F3 to return to the Edit Model Object List panelfor your session list.

Working with Model Object Lists

TUT 5–48 COOL:2E Tutorial

Page 48: **SYNON** HORSE MODEL

Function Versioning

This topic describes how to create and test a version ofa function.

✍ Note: You can create versions for both functions (FUN)and messages (MSG); however, this topicdiscusses only function versions.

New terms introduced

version

group

current

redirection

New panel introduced

Work with Versions

New commands introduced

Create Model Version

Compare Model Objects

Redirect Model Object

Objectives To create a version of the Edit Horse function, edit itsaction diagram, test the change, and replace theoriginal function with the new version.

Overview ofVersions

A version of a function is similar to a copy of thefunction. The major difference is that a copy iscompletely independent of the original function.Although a version is also a separate model object,COOL:2E maintains an internal link between a functionand its versions. A function can have an unlimitednumber of versions.

Function Versioning

COOL:2E Tutorial TUT 5–49

Page 49: **SYNON** HORSE MODEL

A function and its versions is known as a group . Theinteractive Work with Versions panel lets you view andwork with a group of versions.

In any group of versions, one of the versions in thegroup may be current . The current version is theversion that is active in the model; in other words, it isthe function that is referenced by other objects in themodel and that appears on COOL:2E editing panels.

Benefits ofVersions

Three benefits of using versions are:

• You can test changes on a version of a functionwithout interfering with the functionality of theexisting model.

• When you finish testing a new version of a functionand make it active (current) in the model, theoriginal function remains unchanged and can easilybe made active again if needed.

• Only the currently active version of a function isdisplayed on COOL:2E editing panels. As a result,the panels are not cluttered with inactive versions.

A Reason NOT toUse Versions

When you make a version of a function current in themodel, COOL:2E globally changes all the model objectsthat referenced the original function to reference theversion instead. If not all of the referencing modelobjects need the changed functionality, you shouldcreate a new function rather than a version. Afterupdating and testing the new function, you would thenneed to update references to the new function manually.

Using Versionsto Update anExistingFunction

Following are the steps needed to update and testchanges for a working external function usingCOOL:2E’s versioning feature. You will use this processto add an action to the action diagram for the EditHorse function.

1. Create a version of the function you want to change.

2. Edit the version.

Function Versioning

TUT 5–50 COOL:2E Tutorial

Page 50: **SYNON** HORSE MODEL

3. For an external function, generate the source andcreate the program object for the version.

✍ Note: Internal functions and messages do not result inseparate program objects. As a result, the testingprocess for them is more complex and beyond thescope of this tutorial. Refer to the COOL:2Emodule, Generating and ImplementingApplications, for more information.

4. Test the version by calling the program object.

5. When you are satisfied that the version worksproperly, make the version current.

6. If errors occur, make the original function currentagain.

Accessing theSession List

The Edit Model Object List panel should be displayedon your screen for your session list. If it is not, from theDesigner Menu, type 4 on the Selection line as shownto select the Edit Session List (changed objects) option.

Press Enter to display the Edit Model Object List panelfor your session list.

Function Versioning

COOL:2E Tutorial TUT 5–51

Page 51: **SYNON** HORSE MODEL

Positioning tothe Edit Horse

Since you are going to create a version of the EditHorse function, you first need to locate it. One way todo so is by using the F7 command key, which lets youposition and sort entries for the displayed model objectlist.

Press F7 to display the Position the List window. Thereare several ways in which you can specify informationon this window in order to locate the function you need.For example,

• if you know the name of the function, simply typethe name in the Object field

• if you know the implementation name of thefunction (the program name), type the name in theImp. Name field

• if you know the name of the file that owns thefunction, type the name of the file in the Owner fieldand scroll down to locate the function

Note that you can type partial names in the Object,Owner, and Imp. Name fields on the Position the Listwindow; for example, if you type H or H* for the Objectfield, the list will be positioned at the first object namethat begins with the letter H.

Function Versioning

TUT 5–52 COOL:2E Tutorial

Page 52: **SYNON** HORSE MODEL

Since you know the function name, type Edit Horse inthe Object field as shown.

Press Enter .

Creating aVersion for EditHorse

To create a version you first need to access the Workwith Versions panel for the selected function. Press F23twice to view additional Subfile selector options. Theappropriate option is 19.

Type 19 in the Subfile selector for the Edit Horsefunction as shown.

Function Versioning

COOL:2E Tutorial TUT 5–53

Page 53: **SYNON** HORSE MODEL

Press Enter .

Working withVersions

The Work with Versions panel provides a set of optionsfor working with a group of versions. Use it to performtasks on versions, such as,

• create a new version

• edit

• delete

• display

• view detail

• generate

• impact analysis

The versions are displayed on this panel in reversechronological order; in other words, the most recentlycreated version appears at the top of the list of entries.The current version is shown highlighted with an * tothe right of the Subfile selector, and the Status columncontains the word Current. Since you have not yetcreated versions for Edit Horse, only one entry is listed.

Function Versioning

TUT 5–54 COOL:2E Tutorial

Page 54: **SYNON** HORSE MODEL

To create a new version for the Edit Horse functiontype 3 in the Subfile selector as shown.

Press Enter .

Naming theVersion

The prompt panel for the Create Model Version(YCRTMDLVSN) command displays. By default,COOL:2E automatically generates a name for theversion based on the name of the original function. Theautomatically-generated name consists of the originalfunction name followed by seven digits to ensureuniqueness; for example, Edit Horse 1101481. Inaddition, by default, the original function retains itsname and remains current (active).

Function Versioning

COOL:2E Tutorial TUT 5–55

Page 55: **SYNON** HORSE MODEL

In this example, you will specify a version name andaccept the other defaults. Type Edit Horse - Version 1in the To model object name field as shown.

Press Enter . Note the messages at the bottom of thepanel as COOL:2E creates the new version.

ImplementationName for theNew Version

The new version you just created, Edit Horse - Version1, now appears at the top of the list on the Work withVersions panel. Note that a new implementation namehas been assigned to the version; in other words, theversion is a separate object in the model. However,since the version is not current, you will not see it onCOOL:2E editing panels.

Function Versioning

TUT 5–56 COOL:2E Tutorial

Page 56: **SYNON** HORSE MODEL

Editing the NewFunction

You are now ready to edit the action diagram for EditHorse - Version 1 in order to insert a call to aninformation message function. To do so, type 10 in theSubfile selector as shown.

Press Enter .

Press F5 to display the user exit points and select theuser point to which you added logic to call the DisplayRacing results function for a selected horse.

Function Versioning

COOL:2E Tutorial TUT 5–57

Page 57: **SYNON** HORSE MODEL

Type Z against the Validate subfile record relations userpoint as shown.

Press Enter .

Inserting aMessageFunction

The objective is to add an information message to theEdit Horse function on return from the Display Racingresults function. You will use the IMF command toinsert the message. This command provides a shortcutfor inserting and prompting a message function in onestep. Remember, to view a list of available commands,type ? in the Subfile selector.

Function Versioning

TUT 5–58 COOL:2E Tutorial

Page 58: **SYNON** HORSE MODEL

Type IMF in the Subfile selector as shown to insert aninformation message function after calling the DisplayRacing results function.

Press Enter . When the Edit Message Functions paneldisplays press F9 to add the new message.

Press Enter .

Function Versioning

COOL:2E Tutorial TUT 5–59

Page 59: **SYNON** HORSE MODEL

Specifying aParameter forthe MessageFunction

Next specify a parameter for the message function inorder to include the name of the horse in the message.Type P as shown in the Subfile selector.

Press Enter .

You need to specify that the Horse name field is to bea parameter for the message function. As a result, type*FIELD to indicate the parameter is a field, type Horsename as the field name, and type FLD in the Passedas column as shown;

Function Versioning

TUT 5–60 COOL:2E Tutorial

Page 60: **SYNON** HORSE MODEL

Press Enter .

Press F3 to return to the Edit Message Functions panel.

Editing theMessage Text

Next you will edit the message text to include the valueof the Horse name parameter. Remember that, bydefault, the name of a message function and itsassociated text are the same.

Type Z in the Subfile selector for the Racing resultsdisplayed message function as shown.

Press Enter to display the Edit Message FunctionDetails panel.

Using aSubstitutionVariable

Note the &1 in the No. column; this is the substitutionvariable that represents the Horse name parameter.You will use this substitution variable to include theselected horse’s name in the text of the message.Recall that you used this process earlier in the tutorialwhen you defined error messages for the condition thatcompared a horse’s date of birth with those of itsparents.

Function Versioning

COOL:2E Tutorial TUT 5–61

Page 61: **SYNON** HORSE MODEL

The original message text is “Racing results displayed.”Add “for &1” to the end of this text as shown.

Press Enter to return to the Edit Message Functionspanel.

Selecting theNew Message

You still need to select this message function forinclusion in the Edit Horse function. Type X in theSubfile selector as shown.

Function Versioning

TUT 5–62 COOL:2E Tutorial

Page 62: **SYNON** HORSE MODEL

Press Enter to display the Edit Action - Function Namewindow. Note that the fields in this window have beenfilled in based on the information you just entered.

Press Enter to view the parameters for the messagefunction.

Function Versioning

COOL:2E Tutorial TUT 5–63

Page 63: **SYNON** HORSE MODEL

Checking theDefaultParameters

Note the message at the bottom of the windowindicating that parameters have been defaulted. In mostcases the default parameters shown are correct.However, you should review the information displayedbefore you accept the defaults.

In this case, the defaults are correct; namely, Horsename is an input (I) parameter and the source of itsvalue is the RCD (Subfile record) context. Press Enterto accept the defaults and return to the Action DiagramEditor.

Note that the call to the information message function,Racing results displayed, has been inserted in theaction diagram.

Function Versioning

TUT 5–64 COOL:2E Tutorial

Page 64: **SYNON** HORSE MODEL

Returning to theAction Diagram

Press F13 to exit and display the Exit FunctionDefinition panel.

Press Enter to accept the defaults and return to theWork with Versions panel.

Press F3 to return to the Edit Model Object List panel.Note that a 0 displays to the right of the Subfileselector of the Edit Horse - Version 1 list entry toindicate that it is a non-current version.

Submitting theFunctionVersion forGeneration

You can submit generation requests and process joblists directly from the Edit Model Object List panel.Press F23 to see additional Subfile selector options.The appropriate option for submitting access paths andfunctions for batch generation is 14.

Function Versioning

COOL:2E Tutorial TUT 5–65

Page 65: **SYNON** HORSE MODEL

Type 14 in the Subfile selector for the Edit Horse -Version 1 function as shown.

Press Enter . A message at the bottom of the panelindicates that the request for batch generation hasbeen submitted.

Viewing Job ListCommands

You also have access to a set of job list commandsfrom the Edit Model Object List panel. This includes theSubmit Model Create Requests (YSBMMDLCRT)command, which you previously accessed from theDisplay Services Menu. Press F24 twice to viewadditional command keys. The appropriate commandkey is F19.

Function Versioning

TUT 5–66 COOL:2E Tutorial

Page 66: **SYNON** HORSE MODEL

Press F19 to display the Job List Commands Menu.Type 1 on the Selection line to select theYSBMMDLCRT command.

Press Enter .

When the prompt screen for the YSBMMDLCRTcommand displays, press Enter again to accept thedefaults and display the job list.

Press Enter twice to submit the request to the jobqueue. Check the status of the job as described in

Function Versioning

COOL:2E Tutorial TUT 5–67

Page 67: **SYNON** HORSE MODEL

chapter 4. Once the generation and compilationcompletes successfully, you can test Edit Horse -Version 1 to see if the new message displays.

Press F3 twice to return to the Edit Model Object Listpanel.

DisplayingAlternate Views

If you do not know the implementation name for EditHorse - Version 1, you can use the F11 command keyto view additional information for the model objectsdisplayed. Five alternate views are available; however,this tutorial discusses only the first two. You can pressF11 five times to see all five views.

Press F11 to display the alternate view showing theimplementation name. Note the name that correspondsto Edit Horse - Version 1, MYAPEFR on the panelbelow.

Testing EditHorse - Version 1

On the Command line, type the following to test EditHorse - Version 1. Be sure to substitute the correctimplementation name.

CALL MYAPEFR ’ ’

Press Enter .

Function Versioning

TUT 5–68 COOL:2E Tutorial

Page 68: **SYNON** HORSE MODEL

The interactive panel for Edit Horse - Version 1 shoulddisplay showing the data you entered earlier for theEdit Horse function.

Following are the steps needed to test your change.

1. Type / in the Subfile selector for any horse.

2. Press F10 to access the action bar.

3. Type S to access the Selector Choice menu.

4. Type 1 next to the Display Racing Results action.

5. Press Enter .

✍ Note: Since you will not enter data for the RACE andRACE ENTRY files until the next chapter, DisplayRacing Results will have no data to display;however, you should see the new informationmessage on return to Edit Horse - Version 1.

6. Press F3 to return to Edit Horse - Version 1. Thenew message should display at the bottom of thepanel.

Press F3 to return to the Edit Model Object List panel.

Comparing TwoVersions of aFunction

You can compare two versions of a function using theCompare Model Objects (YCMPMDLOBJ ) command.This command is useful for solving problems that arisewhile testing a new version and for identifying changesmade to one version of a function for retrofitting toanother version.

✍ Note: You can also use this command to compare twofunctions or two messages. In other words, themodel objects being compared need not beversions.

Function Versioning

COOL:2E Tutorial TUT 5–69

Page 69: **SYNON** HORSE MODEL

To compare two versions of a function, typeYCMPMDLOBJ on the Command line as shown.

EnteringParameters forYCMPMDLOBJ

Press F4 to prompt the command. Enter parameters toidentify the functions to be compared; namely, enter theObject owner, name, and type of both functions. In thiscase, type HORSE, Edit Horse , *FUN, HORSE, EditHorse - Version 1 , and *FUN as shown. Accept thedefaults for the other parameters.

Press Enter .

Function Versioning

TUT 5–70 COOL:2E Tutorial

Page 70: **SYNON** HORSE MODEL

When the command completes, it returns automaticallyto the Edit Model Object List panel. If differences werefound a message displays at the bottom of the panel.

ViewingDifferencesbetweenVersions

Use the OS/400 Work with Spool Files (WRKSPLF )command to view the differences. Type WRKSPLF onthe Command line as shown,

Press Enter . Use Subfile selector option 5 to displaythe job named YCMPMDLOB$. The differences areshown as follows.

Edit Horse

Edit Horse- Version 1

Function Versioning

COOL:2E Tutorial TUT 5–71

Page 71: **SYNON** HORSE MODEL

Press F3 twice to return to the Edit Model Object Listpanel.

Making the EditHorse - Version1 Current

Once you have tested Edit Horse - Version 1 and aresatisfied that both the new and old functionality workcorrectly, you can replace the original Edit Horsefunction in the model with the new version by makingthe version current.

First display the Work with Version panel by typing 19in the Subfile selector for either version of the EditHorse function as shown.

Press Enter .

On the Work with Version panel, press F23 to viewadditional options. The appropriate option is 26, Makecurrent. Type 26 in the Subfile selector for Edit Horse -Version 1 as shown.

Function Versioning

TUT 5–72 COOL:2E Tutorial

Page 72: **SYNON** HORSE MODEL

Press Enter .

Naming the NewCurrent Version

The prompt screen for the Redirect Model Object(YRDRMDLOBJ ) command displays.

When you make a version current, by default, theobject names of the original and new current versionsare exchanged; this is indicated by *YES in theTransfer model object name parameter. Theimplementation names of the two versions are alwaysexchanged. To avoid misunderstanding, be sure toinform other developers when you make a new versioncurrent.

Function Versioning

COOL:2E Tutorial TUT 5–73

Page 73: **SYNON** HORSE MODEL

Press Enter to accept the defaults.

✍ Note: If other objects in the model reference Edit Horse,they are automatically changed to reference thenew current version instead. For example, ifanother function called Edit Horse, COOL:2Ewould change the function so that it calls the newcurrent version of Edit Horse instead. Thisprocess is known as redirection . Messagesdisplay at the bottom of the panel duringredirection.

The new current version now contains the call to theinformation message. Its object name is now Edit Horseand its implementation name is MYAEEFR.

Function Versioning

TUT 5–74 COOL:2E Tutorial

Page 74: **SYNON** HORSE MODEL

Regeneratingthe New CurrentVersion

You need to generate and compile the new currentversion so the source and program object contain thenew functionality. Type 14 in the Subfile selector asshown to submit a request for batch generation.

Press Enter to submit the request. Press F3 to returnto the Edit Model Object List panel. The 0 to the rightof the Subfile selector of the Edit Horse list entryindicates that it is a non-current version.

Exercise Submit the batch job using the procedure you usedpreviously in this topic. Press F19 to display the JobList Commands menu and select the YSBMMDLCRToption. When you finish, return to the Edit Model ObjectList panel.

Viewing ModelObjectInformation forthe Versions

Note that an 8 appears to the left of both the EditHorse and Edit Horse - Version 1 list entries. Thisindicates that the list entry information does not matchthat of the corresponding model object. In this case, theobject names and implementation names aremismatched since they were exchanged during theprocess of making Edit Horse - Version 1 current.

✍ Note: This difference is allowed to occur so you can useyour model object list as a historical record.

Function Versioning

COOL:2E Tutorial TUT 5–75

Page 75: **SYNON** HORSE MODEL

To view current details for a model object, use Subfileselector option 8. (Note that you can press F23 to seeother options.) For example, type 8 against the EditHorse list entry as shown.

Press Enter .

Note that the Object Name, Edit Horse - Version 1, andthe implementation name shown in the Source column,MYAPEFR, do not match the corresponding informationshown on the Edit Model Object List panel for the EditHorse list entry.

Function Versioning

TUT 5–76 COOL:2E Tutorial

Page 76: **SYNON** HORSE MODEL

Press F12 to return to the Edit Model Object List panel.

Refreshing ListEntries for theVersions

To update the two list entries to match the actual modelobjects, type 33 in the Subfile selector for both entriesas shown.

Press Enter .

✍ Note: If many discrepancies exist between entries on amodel object list and the actual model objects,you can refresh the entire list by pressing the F15command key. This executes the Check a ModelList (YCHKMDLLST ) command.

The information for the list entries for the two versionsnow match that of the corresponding model objects.

Function Versioning

COOL:2E Tutorial TUT 5–77

Page 77: **SYNON** HORSE MODEL

Exercise Use the Position the List panel to display all entries foryour session list.

Hint: Press F7, blank out all the fields, and press Enter .COOL:2E automatically repositions your sessionlist at the top in order by Object Name and ObjectType.

Function Versioning

TUT 5–78 COOL:2E Tutorial

Page 78: **SYNON** HORSE MODEL

Model Object Cross References

This topic introduces the COOL:2E model object crossreference panels.

New terms introduced

model object cross reference

expansion

usages

using objects

references

New panels introduced

Display Model Usages

Display Model References

Objectives To use COOL:2E’s model object cross referencefacilities, including the Display Model Usages panel andthe Display Model References panel.

Overview ofModel ObjectCrossReferences

COOL:2E’s model object cross reference facilitiesconsist of a set of commands and interactive panelsthat you can use to determine, for any model object,which other objects it references and which otherobjects it is used by.

The process of determining either usages or referencesfor a model object is know as expansion . Using modelobject cross reference facilities, you can expandusages or references for a model object to any level.

You can display or print model object usages andreferences; you can also convert them to a modelobject list.

Model Object Cross References

COOL:2E Tutorial TUT 5–79

Page 79: **SYNON** HORSE MODEL

Model ObjectUsages

Usages for a model object are all the model objectsthat use it. Usages are external to the model object andrequire the model object in order to be complete. Amodel object’s usages are sometimes referred to asusing objects .

Suppose you want to change the Mares access path.Before you do so, you need to determine which modelobjects use it. In this step you will use the DisplayModel Usages panel to display usages for the Maresaccess path.

Accessing YourSession List

Start by accessing the Edit Model Object List panel foryour session list. Use one of the methods you usedearlier in this chapter.

First position the session list to the Mares access path.Press F7 to display the Position the List window. TypeACP for the Type field and Mares for the Object fieldas shown.

Press Enter . Your session list is now displayed inorder by Object Type and Object Name beginning withthe Mares access path.

Model Object Cross References

TUT 5–80 COOL:2E Tutorial

Page 80: **SYNON** HORSE MODEL

Press F23 until option 91 is displayed. Option 91displays usages for the selected object. Type 91 in theSubfile selector for the Mares access path as shown.

Press Enter . Notice the messages at the bottom of thepanel as COOL:2E expands model usages.

Display ModelUsages Panel

When all usages have been expanded, the DisplayModel Usages panel displays showing the first level ofobjects in the model that use the Mares access path.Notice the 001 in the Lvl column for each using object;this indicates that the object uses the Mares accesspath directly.

The Display Model Usages panel provides a variety ofcontrols and filters including, recursion, scope, andpositioning to help you analyze your model todetermine the impact of proposed changes.

✍ Note: Most of the options provided on the Display ModelUsages panel are beyond the scope of thistutorial. However, you can use the online help ifyou would like to experiment further. Or, you canrefer to the COOL:2E module, Generating andImplementing Applications.

Model Object Cross References

COOL:2E Tutorial TUT 5–81

Page 81: **SYNON** HORSE MODEL

Usage Reason The Reason column shows how each of the listedmodel objects use the Mares access path. For example,

• *REFACP - The Edit Horse and Select Horsefunctions use Mares as a referenced access path.

• *FUNPAR - The Select Mares function uses Maresas the definition of a function parameter.

• *OBJECT - This identifies the model object forwhich you requested usages. This object isincluded on the list of usages so you can use theSubfile selection options on the original modelobject.

The model objects that use the Mares access path areall external functions that will at least need to beregenerated and compiled if you change the Maresaccess path. However, if your proposed changerequires relations to be added to or removed from theMares access path, you might also need to edit thesefunctions.

In this model no other model objects use the usingobjects for Mares. You can test whether other objectsuse the objects displayed by typing 91 in the Subfileselector for any of the using objects.

Model Object Cross References

TUT 5–82 COOL:2E Tutorial

Page 82: **SYNON** HORSE MODEL

Exercise Type 91 against Edit Horse and press Enter to displayits usages. The Display Model Usages panel redisplaysshowing only the model object itself. This indicates thatno other model objects use Edit Horse; in other words,it has no usages.

Using UsageLevels

Notice that the Level number in the upper right cornerhas changed to 002. This indicates the number of timesyou have expanded usages beginning with the originalmodel object.

For a more complex example, a model object mayhave many levels of using objects. The value of *NEXTin the Scope field lets you step through the expansionof usages one level and one model object at a time. Inother words, you can type 91 for any using objects todetermine its usage. The Level shown at the upperright of the screen shows the current level. The F3 keylets you back up one level at a time; the F15 keyreturns to the top level.

Note that you can change the Scope field to *NOMAXto expand all usages for a selected model object.However, for working models this can require significantprocessing time.

Model Object Cross References

COOL:2E Tutorial TUT 5–83

Page 83: **SYNON** HORSE MODEL

Exiting ModelUsages

Press F3 twice to return to the Edit Model Object Listpanel.

Press F7 to display the Position the List window. Blankout all fields and press Enter to reposition the sessionlist and display all entries.

Model ObjectReferences

References for a model object are the model objects itrefers to internally. In other words, references are themodel objects the referring model object requires inorder to be complete or to exist. For example, DisplayRacing results and Change Horse are references of theEdit Horse function.

This step shows how to access the Display ModelReferences panel and how you can use it to solveproblems in program applications.

Accessing the*ALLOBJ List

Start by accessing the Edit Model Object List panel forthe All Objects list (*ALLOBJ). Since your session list iscurrently displayed, type *ALLOBJ for the List field atthe top of the panel and press Enter .

Positioning*ALLOBJ to anImplementationName

Suppose you only know the implementation name ofthe program in which an error occurred; for example,MYAEEFR (Edit Horse).

From the Edit Model Object List press F7. Type theimplementation name of the program in the Imp. Namefield as shown. Be sure to substitute the namecorresponding to your Edit Horse function.

Model Object Cross References

TUT 5–84 COOL:2E Tutorial

Page 84: **SYNON** HORSE MODEL

Press Enter .

The *ALLOBJ list is now positioned at the Edit Horsefunction. Note the message at the bottom of the paneland that the alternate view showing the Implementationname displays automatically. You can change views bypressing F11.

DisplayingReferences forEdit Horse

Option 81 lets you display references for a selectedmodel object. Type 81 in the Subfile selector for EditHorse as shown.

Model Object Cross References

COOL:2E Tutorial TUT 5–85

Page 85: **SYNON** HORSE MODEL

Press Enter . Notice the messages at the bottom of thepanel as COOL:2E expands the model references.

Display ModelReferences Panel

When all references have been expanded, the DisplayModel References panel displays showing all objects inthe model referenced by Edit Horse. This panelprovides a variety of controls and filters including,recursion, scope, and positioning to help you analyzeyour model.

✍ Note: Most of the options provided on the Display ModelReferences panel are beyond the scope of thistutorial. However, you can use the online help ifyou would like to experiment further. Or, refer tothe COOL:2E module, Generating andImplementing Applications.

Model Object Cross References

TUT 5–86 COOL:2E Tutorial

Page 86: **SYNON** HORSE MODEL

Displaying OnlyExternalFunctions

Since you are using references to solve a problem inan application program, you only need to see externalfunctions that are referenced in the Edit Horse actiondiagram.

Type *EXTFUN for the Scope field and type *ACTIONfor the Reason field as shown.

Press Enter . Only the functions that make up theprogram in which the error occurred are now displayed.In a working model this list would generally be muchlonger. This is a useful starting place for the developerswhose task it is to fix the problem.

Model Object Cross References

COOL:2E Tutorial TUT 5–87

Page 87: **SYNON** HORSE MODEL

Creating a ModelList of theReferences

In this step you will use the F16 command key tocreate a model object list and convert the referencesdisplayed to model list entries. You can specify thename of an existing list or you can type a new nameand COOL:2E will automatically create the model list.

If you specify the name of an existing list be sure theOutlist option is correct. A value of *REPLACE clearsthe list before converting the references; a value of*ADD appends the new entries to any existing entries.

Naming the Listof References

You should assign a name to the list that will bemeaningful to the development staff. By default themodel list name is the Model list for commandsspecified in your model profile.

Press F16 to display the window where you will enterthe name of the model list that is to contain thereferences. Suppose you are responding to ProblemReport 3049; as a result, you might name the model listPR3049.

Model Object Cross References

TUT 5–88 COOL:2E Tutorial

Page 88: **SYNON** HORSE MODEL

Type PR3049 in the Output to Model List window asshown.

Press Enter . Notice the messages at the bottom of thewindow as the references are converted to entries onthe model object list. On return to the Display ModelReferences panel a message at the bottom of thepanel verifies that the conversion is complete.

Using the List ofReferences

You can now print the PR3049 model list using the F21command key. You can either give the printed copy ofthe list to your development staff or they can use themodel list online as an aid to solving the problem.

Exiting DisplayModelReferences

Press F3 to return to the Edit Model Object List panel.Reposition the list to the top in Object Name/ObjectType order as follows: press F7 to display the Positionthe List window, blank out all fields, and press Enter .

Redisplay YourSession List

Type the name of your session list in the List field atthe top of the panel. Recall that by default your sessionlist has the same name as your user profile.

Model Object Cross References

COOL:2E Tutorial TUT 5–89

Page 89: **SYNON** HORSE MODEL

Press Enter .

Model Object Cross References

TUT 5–90 COOL:2E Tutorial

Page 90: **SYNON** HORSE MODEL

Impact Analysis

This topic introduces the COOL:2E impact analysistools, including simulating a proposed change andcomponent change processing.

New terms introduced

change type

private change

public change

simulating a change

component change processing

Objectives To show how to determine the impact of a proposedchange to a model object on other objects in the model.

Overview ofImpact Analysis

Impact analysis lets you determine the impact of aproposed change or an actual change to any object inyour model. For example, you can determine whichobjects are affected if you change the length of a keyfield or which functions need to be regenerated if youchange logic in the action diagram of an internalfunction.

Change Type Whenever you change a model object, COOL:2Eassigns a change type . The change type describes theway in which a change impacts other objects that usethe changed object. The four possible change types areObject only (*OBJONLY), Generation required (*GEN),Private (*PRIVATE), and Public (*PUBLIC). The first twoindicate changes that affect only the changed objectitself. As a result, this tutorial covers just the last twochange types.

• *PRIVATE - this change type indicates a change toan object that requires that you regenerate andcompile all access paths and external functions thatuse it.

Impact Analysis

COOL:2E Tutorial TUT 5–91

Page 91: **SYNON** HORSE MODEL

For example, if you change the action diagram of aninternal function, you need to regenerate the externalfunctions that call it.

• *PUBLIC - this change type indicates that theinterface of the model object with other objects haschanged. As a result, some model objects that usethe changed object may require editing. When theediting is complete, you need to regenerate theaccess paths and external functions that use thechanged object.

For example, if you change the parameters of aninternal function you need to edit all functions thatcall it and then regenerate all external functions thatuse it.

The change type depends on which attributes of amodel object are changed and is derived internally byCOOL:2E.

Simulating aChange to aModel Object

Simulating a change to a model object lets you see theimpact of a proposed change on other objects in themodel before you actually make the change. Simulationidentifies which other model objects need to be editedor generated as a result of the proposed change.

When you change a model object, the only objects thatcan be affected by the change are those that use thechanged object. As a result a major part of simulating achange consists of expanding usages for the object tobe changed.

Suppose you want to change the length of the Coursecode field. This is a *PUBLIC change; in other words,some using objects will need to be edited toincorporate the change.

Impact Analysis

TUT 5–92 COOL:2E Tutorial

Page 92: **SYNON** HORSE MODEL

Positioning theList to CourseCode

From the Edit Model Object List panel, press F7 todisplay the Position the List window. Type FLD for theType field and type Course code for the Object field asshown.

Press Enter . Type 91 in the Subfile selector for Coursecode as shown to display the Display Model Usagespanel.

Press Enter .

Impact Analysis

COOL:2E Tutorial TUT 5–93

Page 93: **SYNON** HORSE MODEL

Positioning theUsages toCourse Code

To simulate a change to Course code, you first need tolocate it. Since Course code has many usages, aneasy way to locate it is to use the positioning options.Type Course code in the Object field and type FLD inthe Type field as shown.

Press Enter .

Simulating a*PUBLIC Change

Press F23 to display additional Subfile selector options.Option 95 lets you simulate a *PUBLIC change for theselected model object.

Type 95 in the Subfile selector for Course code.

Impact Analysis

TUT 5–94 COOL:2E Tutorial

Page 94: **SYNON** HORSE MODEL

Press Enter to display all objects that will be affectedby a *PUBLIC change to Course code.

Interpreting theResults

When you simulate a change, COOL:2E expandsusages for the object to be changed up to the firstexternal function for each sequence of model objectsthat use it. This is indicated by *GENFUN in the Scopefield. In addition, only those objects that need to beedited or generated to implement the proposed changeare displayed, not all usages.

Impact Analysis

COOL:2E Tutorial TUT 5–95

Page 95: **SYNON** HORSE MODEL

Note the numbers in the Lvl column; they indicate theusage level for each using object. The Action columnindicates whether the using object needs to be edited(EDT) or regenerated (GEN).

As you scroll through the list, do not be concernedabout what appear to be duplicate entries; they do notindicate errors.

Converting theSimulationUsages to a List

In order to further study the impact of your proposedchange, convert the usages displayed to a modelobject list. Be sure to give it a descriptive name; forexample, COURSECODE.

Press F16 and type COURSECODE in the Model listname field in the window that displays as shown. Sincethis is a new list you can accept the default for theOutlist option.

Press Enter . Notice the messages at the bottom of thewindow as COOL:2E creates the list and converts thedisplayed usages to model list entries.

Press F3 twice to return to the Edit Model Object Listpanel. Use the F7 key to reposition the session list tothe top and display all entries.

Impact Analysis

TUT 5–96 COOL:2E Tutorial

Page 96: **SYNON** HORSE MODEL

OptionalExercise

Type COURSECODE in the List field and press Enterto display the model object list you just created. Usethe F11 key to view information for each list entry.

When you finish viewing this list, type the name of yoursession list in the List field and press Enter .

ComponentChangeProcessing

Component change processing refers to anautomated impact analysis tool. When you simulate achange you are in effect simulating component changeprocessing. The difference is that component changeprocessing updates the All Objects list for the changedobject and all objects affected by the change, includingan indication of whether the object needs to be editedor regenerated.

Component change processing is optional; you controlit using the model profile and the Component ChangeProcessing (YCMPCHG) model value. You can chooseto run it interactively, by request, or in batch.

Further discussion of this tool is beyond the scope ofthis tutorial; however, the simulation topic should havegiven you some familiarity with the process. Componentchange processing is discussed in detail in theCOOL:2E module, Generating and ImplementingApplications.

Accessing EditDatabaseRelations

At this point you can exit the model by pressing F3. Ifyou want to continue with the tutorial, you can useeither the Edit Model (YEDTMDL) command or theStart COOL:2E (YSTRY2) command to reenter themodel at the Edit Database Relations panel.

For example, type YEDTMDL on the command line asshown.

Impact Analysis

COOL:2E Tutorial TUT 5–97

Page 97: **SYNON** HORSE MODEL

Press Enter.

Impact Analysis

TUT 5–98 COOL:2E Tutorial