You are on page 1of 237

AppBuilder Basic Training

2006

Section 1
Introduction to AppBuilder

Who are BluePhoenix?


Founded October 2001 Leaders in IT Modernization solutions Owners of AppBuilder (formerly known as HPS)
Previous owner was Level 8 Systems (98 01) Before that SEER Technologies (90 98)

AppBuilder - key element in modernization story (Redevelopment)

What is AppBuilder?

Repository based, application development toolset and code generator

Application Development Tool


Analysis tools
Data & process modelling, database design

Development tools
Window design, report design, code editor

Testing tools
PC & mainframe based debugging

Change management tools


What if? scenarios

Code Generator
From a single source input AppBuilder can generate Java, J2EE, C & Cobol
Mainframe
CICS IMS Batch

Servers
MS Windows Unix Java Virtual Machine Web Server App Server

Java

EJB

Web Services

Clients
MS Windows Java Virtual Machine Browser

Java

HTML

Repository Based
Every source object created using AppBuilder is stored in its own repository (internal database).
When objects interact, relationships are formed and stored.

Types of Repository
Personal
Fits on a PC Only you can see whats in it Needs to be synchronized with Enterprise Repository

Freeway
Needs a Server Accessed by many developers Normally synchronized with Enterprise Repository

Enterprise
Lives on a mainframe Central to most AppBuilder environments
8

Repository Topologies
Workgroup Personal & Enterprise

Real time object sharing

Manual Upload / Download

The AppBuilder Solution

10

Benefits of using AppBuilder


Immunity from technology changes More accurate application specification Re-use Faster development More flexible development Development cost savings Lower maintenance costs

11

Section 2
Objects, Relationships & Attributes

12

What is an Object?

13

What is an Object?

Attributes Audit Remote Audit Text

Keywords

14

Properties of an Object
Each object has different set of properties Refer to documentation for full list

15

Name & System Id


Object Name
Your choice Maximum 30 characters No spaces or hyphens allowed only underscores e.g. CUSTOMER_ID

System Id
System Generated Unique to your environment You cant change it Used by AppBuilder internally e.g. ZABRT6H
16

Text & Keywords

Enter Text for Fields Views Sets Windows Rules Keywords used to allow for faster searching in the repository

17

What is a Relationship?

Attributes Audit Remote Audit Text

18

Attributes of a Relationship
No System Id No Name Identified using
Name of Parent + Name of Child

Sequence Number
Indicates position in sibling list

19

Repository Security
User Group Project

Objects (and relationships) are kept secure in Projects which can only be updated by certain Groups of Users.

20

What is a Project?
Logical container for objects & relationships Every object & relationship exists in one (and only one) Project Objects in different Projects can be related

Project A

Project B

21

Audit Information
Where? Who? When?

22

23

Section 3
Construction Workbench & Hierarchy Diagrammer

24

Starting AppBuilder

1.

2.
25

Integrated Development

Hierarchy space

Tool area e.g. Window Painter Rule Editor

Preparation results

26

Hierarchy Diagrammer
Critical in AppBuilder development Way of viewing objects in the repository Way of creating new objects in the repository Press F4 to open the Hierarchy Diagrammer

27

Parts of a Hierarchy
Expand /Contract
Parent object Child object

Relationship Siblings

Object Type

28

Building a Hierarchy 1

Type in name of new object. No spaces or - Use _ Press Insert to place in Hierarchy
29

Building a Hierarchy 2

Do not use in Query Can use %% Use Shift or CTRL to choose multiples Press Insert to place in Hierarchy
30

Example Relationships
View Field View View Window View Window Set

Rule View Rule Window Rule Set Rule Component


31

Commit & Rollback


Commit your work CTRL + M
Commit (CTRL + M)

Rollback

Repository

32

Some useful keys


Collapses children into parent Useful for hiding things
Before pressing DELETE After pressing DELETE

Right Click Clear has the same effect


33

Some useful keys

F8

Expands all children from parent

Alt + 1,2,3 etc

Expands levels of hierarchy according to number

Shift + F8 Alt + Enter

Expands whole hierarchy (not a good idea)

Shows properties of object

CTRL + Enter

Shows properties of relationship

34

Inverted Hierarchy (CTRL+ALT+I)


Shows parents of objects Useful for identifying reuse May not be complete list

35

Show Impact

36

Removing a relationship
x 1. Highlight the child object

2.
Right Click on it Choose Delete Relationship Confirm or reject

or

2.
Press CTRL + Backspace Confirm or reject

Both the parent & child objects still exist in Repository


37

Removing an object (from the repository)

x
1. Highlight the object

2.
Right Click on it Choose Delete Object Confirm or reject

or

2.
Press CTRL + Delete Confirm or reject

Completely deletes the chosen object from the Repository Only do this if youre ABSOLUTELY SURE! 38

Removing an object (from the repository)


Deleting an object from the repository also deletes all the relationships that object had
Before deleting Field: NAME After deleting Field: NAME

39

Section 4
AppBuilder Objects

40

AppBuilder Data Model


43 types of object 51 types of relationship

41

The Field Object


Simplest object type in AppBuilder Represents a variable

Mandatory properties o Name o Format o Length Optional properties o Literal values o Ranges Implementation Name = Column name in Table
Only possible parent is a View
42

The View Object


Used to group together Fields A View MUST have at least one childeither another View or a Field

Mandatory properties
o

Name

Possible parents are View, Rule, Window and Component

Example View

43

The Window Object


Represents a user interface (window)

In order to display data, a Window MUST have only one child View (normally suffixed _W)
Mandatory properties
o

Name

Only possible parent is a Rule

44

The Rule Object


A program

Written in the AppBuilder Rules language


Mandatory properties o Name o Implementation Name (8 characters only) Possible parents are Rule & Process

45

The Component Object


A program Written in Java, Cobol, C, PL/1 or Assembler Mandatory properties o Name o Implementation Name (8 characters only) o Language

Possible parents are Rule & another Component

46

The Set Object


A collection of static values and their meanings Mandatory properties o Name o Implementation Name o Format & Length o Style Possible parents are Rules, Components & Windows

47

Section 5
Painting Windows

48

Window Hierarchy
Window object MUST only have 1 View attached to it.
Named same as Window + _W

Attach Data Views to this View, not to the Window.

49

How to Paint Windows


To open the Window painter Highlight the Window & press Enter

Use the black grab boxes to re-size the window.

50

Window Attributes

Double Click here to display Window Attributes

51

Window Attributes

52

Do not delete

53

Placing Objects on Windows


Click & drop these objects onto the window

Highlight the field(s). Drag & drop onto window

54

Window Object Attributes

55

Do not delete

56

Window Painter Objects


Multi Line Edit Field Edit Field Combo Box List Box Check Box Radio Button Push Button MCLB Static Text Group Box Ellipse Bitmap

Chart

Square

Select

Align Left Preview Runtime Align Right

Align Top Align Bottom

Centre Vertically

Distribute Horizontally
Distribute Vertically

Centre Horizontally

57

Do not delete

58

Do not delete

59

Do not delete

60

The LINK

Link

No LINK, no data
61

Tabbing Order (CTRL + T)

Use the up & down arrows to change Tab order.

Natural Tab order is top left to bottom right.

62

Menu Editor (CTRL + U)


Text what the user sees HpsID what the Rule receives

Pop-up looks like this

Use these to structure the menus.

63

64

Accelerator Keys
Menu Items

Push Buttons
65

Panel Layout (Alt + L)

Position the window relative to the screen. Note the screen sizes. Window position can be changed at runtime. 66

Other Window Painter tools


Guide Settings (Grid) CTRL + G

Preview in Runtime CTRL + V

Verify Alt + F7

67

Workbench Window Painter Options

68

Fonts & FONT.INI


Window object attributes C:\AppBuilder\FONT.INI Window object attributes

69

MultiColumn Listbox (MCLB)

CTRL

CTRL + Enter

70

MultiColumn Listbox Editor

71

MCLBs and Dynamic Views


ID FIRST_NAME LAST_NAME

Produces

ID

FIRST_NAME

LAST_NAME

Append statement
ID FIRST_NAME LAST_NAME

produces..

72

Creating HTML Windows

73

Modifying HTML Windows

74

Executing HTML Windows


Web Server
prepare & deploy

HTML

Browser
http://myserver/Customer_Details_DisSvlt

75

Window Flow Diagrammer

WFD allows you test & simulate the window flow without writing code 76

Window Flow Diagrammer

77

Window Flows
Nested Flow

Normal Flow

Detached Flow

78

79

Section 6
AppBuilder Rules & Rules Language

80

What is an AppBuilder Rule ?


Its a Program

Written in AppBuilder Rules Language Simple Easy to learn Does 85% of what you want very easily Procedural, not OO

Generates into either Java, J2EE, Cobol or C

81

Rules Code Editor


Double Click
Enter

Line & Column

82

Creating a Rule Option 1

Right Click

83

Creating a Rule Option 2

Insert new Rule name here

84

Comments & Text


// Write a comment like this

*> Or like this <*

Text can be written in here Alt + Enter

85

The Importance of Hierarchy


Do not try to write a Rule unless you have completed the appropriate Hierarchy for it

AppBuilder has auto-complete for certain object types.


86

Declaring Local Variables


Local variables can be declared in a Rule, though most variables you will use will be in the Rules Hierarchy

dcl
L_FIELD1 L_FIELD2 L_FIELD3 L_FIELD4 L_FIELD5 char(17); integer; Boolean; pic 9999; date;

L_VIEW view contains L_FIELD1, L_FIELD2;

enddcl
87

Referencing Variables
Whilst coding this Rule You want to reference this Field

FIELD1 of A_DATA_VIEW of A_VIEW


or

A_VIEW.A_DATA_VIEW.FIELD1

88

Moving data around


Set FIRST_NAME := Bob or

Map Bob to FIRST_NAME

89

The IF Statement
IF condition statements [ELSE] statements ENDIF
if HPS_EVENT_VIEW.EVENT_SOURCE = OK use rule CUSTOMER_DETAILS_DIS else return endif
90

The CaseOf Statement


CaseOf variablename Case value statements Case different value statements [Case OTHER] statements EndCase
91

The DO Statement
DO [from n to n [index variable] ] statements [WHILE] statements ENDDO
do from 1 to 10 index L_COUNTER
set CUSTOMER_DATA.FIRST_NAME(L_COUNTER) := Mike

enddo

92

Defining Procedures in Rules


To define Proc procedure name [(parameter datatype), :output type] [dclenddcl] statements EndProc To call procedure name [(inputdata)]

To return proc return

93

Displaying Windows

All code in a Window display Rule MUST be written in a Procedure There can be many Procedures in a Rule The Window is displayed automatically when the Rule starts Window events are handled by event procedures

94

Event Procedures
A Procedure which is automatically executed when an event occurs on a Window.
Name of Procedure Event Type Object on which to listen

proc ReturnClick for Click object RETURN_PB ( e object type ClickEvent ) code endproc
Reference to the object which triggered the event

95

Some Example Events


Window
Initialize Converse Terminate

PushButton
Click FocusGained FocusLost

EditField
Click DoubleClick FieldError FieldValidation FocusGained FocusLost

96

Example Window Display Code


Suggested structure for Rules which display Windows Procedure
Pre-loop Pre-converse

When is it executed?
When the window triggers the initialise event 1. After pre-loop 2. Each time the window triggers the converse event

Post-converse

Each time the window triggers the converse event


When the window triggers the terminate event

Post-loop

97

Use Rule Statement


Use Rule rulename [Nest] [Detach]
e.g. Use Rule T0_CAR_DETAILS_DIS

The called Rule must be a child of the calling Rule.


98

Nest & Detach


Use rule RULE_2

Use rule RULE_2 NEST

Use rule RULE_2 DETACH

99

Putting it all together


Rule / Window Interaction
1 2 3
Use Rule Customer_Details Nest

4
5

Return

100

Putting it all together


2 ways of Capturing Window Events

proc CancelClick for Click object CANCEL_PB ( e object type ClickEvent ) code endproc

If EVENT_SOURCE = CANCEL_PB code Endif

101

Putting it all together


proc for initialize type window (p object type initializeEvent) preLoop if exitLoop or exitRule CUSTOMER_LIST.terminate proc return dcl skipDisp exitLoop exitRule enddcl proc preLoop endproc proc preConverse endproc proc postConverse endproc proc postLoop endproc boolean; boolean; boolean; endif do preConverse if exitLoop or exitRule CUSTOMER_LIST.terminate proc return endif while skipDisp postConverse if exitLoop or exitRule CUSTOMER_LIST.terminate proc return endif enddo endproc

102

Putting it all together


proc for converse type window (p object type converseEvent) do postConverse if exitLoop or exitRule CUSTOMER_LIST.terminate proc return endif preConverse if exitLoop or exitRule proc PushButtonClick for Click object EXIT_PB ( e object type ClickEvent ) proc for terminate type window (p object type terminateEvent) if exitRule proc return endif postLoop endproc

CUSTOMER_LIST.terminate
proc return endif while skipDisp enddo endproc

set exitLoop := true


proc return endproc

proc PushButtonClick for Click object SELECT_PB ( e object type ClickEvent ) use rule CUSTOMER_DETAILS_DIS nest proc return endproc

103

Rules Code Verify (Alt + F7)


Top 5 Verify Errors
1.
2. 3. 4. 5.

Multiple Input / Output Views Invalid Map Statements Spelling mistakes No EndIf, EndCase, EndDo etc Invalid syntax

Alt+F7 to Verify
Checks hierarchy Checks code
104

Section 7
Views & Fields

105

Reminder whats a View?


In most programming languages you declare variables within code.

You can do this in AppBuilder with DCLENDDCL


Better way is to add Views to Rules. Promotes object re-use Cleaner code View is a collection of Fields & subordinate Views
106

Reminder whats a View?

Views are attached to Rules like this Views attached to Rules rarely contain Fields, they usually contain child Views, which then contain Fields.

107

Types of View
View Type Description
Window (_W) Attached to a Window, data is only accessible by the parent Rule of the Window Work (_K) Attached to a Rule. Fields are private to the Rule and can only accessed by the Rule Input (_I) Attached to a Rule. Fields can be accessed by the Rule and its parent Rules. Output (_O) Attached to a Rule. Fields can be accessed by the Rule and its parent Rules. Global (_G) Attached to many Rules. Fields can be accessed by any Rules to which the Global View is attached. Data Attached to other Views. A data view contains Fields, whilst most of the above Views do not.

108

Work Views
A Work View is private to the Rule which owns it Rules can have many Work Views Normally suffixed _K

109

Global Views
A Global View is shared between Rules which own it Many Rules can share a single Global View A Rule can have many Global Views

CUSTOMER_LIST_DIS and CUSTOMER_DETAILS_DIS

can both access the data in CUSTOMER_G

110

Input Views
An Input View is shared between a Parent and Child Rule It is used to pass data FROM the parent TO the child It must be a child of the child Rule A Rule can only have one Input View

CUSTOMER_LIST_DIS passes data into CUSTOMER_DETAILS_DIS_I CUSTOMER_DETAILS_DIS can access CUSTOMER_DETAILS_DIS_I

111

Output Views
An Output View is shared between a Parent and Child It is used to pass data from the child back to the parent It must be a child of the child Rule A Rule can only have one Output View

CUSTOMER_DETAILS_DIS puts data into CUSTOMER_DETAILS_DIS_O CUSTOMER_LIST_DIS can access CUSTOMER_DETAILS_DIS_O

112

More on Input & Output Views


An Input View is populated by a Parent Rule The data in an Input View is used by the Child Rule An Output View is populated by a Child Rule The data in an Input View is used by the Parent Rule

113

Input & Output View Law


1 Input View per Rule 1 Output View per Rule Never re-use Input or Output Views Q. What data needs to be passed TO the Rule? A. Input View structure

Q. What data is passed back FROM the Rule? A. Output View structure
114

View Usage Parameter

115

Getting data into variables


Set FIRST_NAME := Mike or Map Mike to FIRST_NAME
Set A_Numeric_Field := 123 Set A_Character_Field := Blue Set A_Field := Another_Field Set View := View Set Occurring_View(3) := Occurring_View(3) Set Occurring_View := Occurring_View Map 123 to A_Numeric_Field Map Blue to A_Character_Field Map A_Field to Another_Field Map View to View Map Occurring_View(3) to Occurring_View(3) Map Occurring_View to Occurring_View

116

Qualification of Data

I want to get data in here

Set FIRST_NAME := Mike

Set CUSTOMER_DATA.FIRST_NAME := Mike


117

Set CUSTOMER_DISPLAY_W. CUSTOMER_DATA.FIRST_NAME := Mike

Copying View-to-View
Set View2 := View1

118

Making Coding Easy


Views & Fields CTRL + Shift + V

119

AppBuilder Set-up

120

Whats legal, whats not


SMALLINT SMALLINT INTEGER DECIMAL CHAR VARCHAR PIC (sig ned ) PIC (unsig ned ) DATE TIME TIMESTAMP INTEGER DECIMAL CHAR VARCHAR PIC (signed) PIC (unsigned) DATE TIME TIMESTAMP

L W W E E L L E E E

L L W E E L L E E E

L L L E E L L E E E

E E E L L E L E E E

E E E L L E L E E E

L L L E E L L E E E

W W W E E W L E E E

E E E E E E E L E E

E E E E E E E E L E

E E E E E E E E E L

L=Legal

W=War ning

E=Er r or

121

The Overlay Statement


06373Tom Jones Mr M 230643Entertainer

overlay to

CUSTOMER_RECORD CUSTOMER_DATA
06373 Tom Jones Mr M 230643 Entertainer

122

A Rules Data Scope


Rules can access
Local Variables (DCL) Their Work View(s) Their Global View(s) Their Window View

Their Input View


Their Output View

Their child Rules Input Views


Their child Rules Output Views NOT their grandchild Rules Input & Output Views
123

Data Initialisation
Local variables (DCL), Work views (_K) and Output views (_O) are initialised every time a rule is called and before any code is executed The input view of a Rule is initialised by the parent Rule

Global views are initialised once when the application starts


In Java, all variables are initialised to NULL, though initial values are assumed - spaces for character fields, 0 for numeric fields. See AppBuilder.INI
SHOW_ZERO_ON_NULL and PROPAGATE_NULL_TO_DATABASE values

124

Section 8
AppBuilder Functions

125

CLEAR Statement
Sets a variable (Field) or a collection of variables (View) to spaces or zeros

Clear Fieldname

or

Clear Viewname

e.g. Clear CAR_DATA of T0_CAR_LIST_W Corresponding function ISCLEAR Checks if a variable is set to its initial value or whether it has changed

126

Operators
+ / * **
DIV MOD

= > < <> <= >=

Add Subtract Exact Division Multiply Exponential Integer Division Provides Modulus Equals Greater Than Less Than Not Equal Less Than or Equals Greater Than or Equals

NOT AND OR
Order of Precedence

127

AppBuilder Functions
INT Converts to Integer DECIMAL Converts to Decimal CEIL Returns next highest number FLOOR Returns next lowest number ROUND Rounds up or down TRUNC Truncates significant digits ++ RTRIM STRLEN UPPER LOWER STRPOS VERIFY SUBSTR CHAR Concatenate 2 strings Truncate a string What is the length of a string? Convert string to upper case Convert string to lower case Searches for string & returns start position Compare 2 strings Copy out a substring from a string Converts to character

128

Date & Time


AppBuilder stores the date as an integer which is the number of days since 01/01/0001
AppBuilder stores the time as an integer which is the number of seconds elapsed since 00:00

129

Date Functions
Date Char Int
Returns current date Converts date field to character Converts date field to integer

Day Returns day of the month from given date MonthReturns month from given date Year Returns year from given date Day_of_Year Day_of_Week
Returns Julian day Returns number between 1 & 7

130

Time Functions
Time
Char Int Hours Minutes Seconds
Returns current time
Converts time field to character Converts time field to integer Returns the hour from given time Returns the minute past the hour from given time Returns the number of seconds elapsed in the current minute from given time

Seconds_of_Day Seconds elapsed since midnight Minutes_of_Day Minutes elapsed since midnight
131

Date Format Strings


%Y %M %D %W %0d %m
Year with century Month name (January, February etc) Ordinal day (1st 2nd 3rd etc) Day name (Monday, Tuesday etc) Day with leading zero (01,02, 03 etc) Month with no leading zero (1,2,3 etc)

132

Using Date & Time Functions


A_DATE_FIELD := Date
Result in A_DATE_FIELD = 3045

A_CHAR_FIELD := Char(A _DATE_FIELD, %0d/%0m/%Y)


Result in A_CHAR_FIELD = 25/09/2002

133

View APPEND
ID FIRST_NAME LAST_NAME ID FIRST_NAME LAST_NAME

+
ID FIRST_NAME LAST_NAME

134

View Replace & Insert


ID FIRST_NAME LAST_NAME ID FIRST_NAME LAST_NAME

Replace (3)
ID FIRST_NAME LAST_NAME

ID

FIRST_NAME

LAST_NAME ID FIRST_NAME LAST_NAME

Insert (3)
ID FIRST_NAME LAST_NAME

135

136

Section 9
Writing SQL in Rules

137

Rule Name & Properties


Rule name should have SQL in it somewhere. Also an indication of what type of statements would be useful.

Default DBMS usage = Not Applicable Change to DB2 for SQL Rules

Prepare will not work otherwise.

138

Rule Hierarchy

Rule must have appropriate Input & Output Views


Remember: Input View contains data needed by the rule to do its job. Output View contains data returned by the Rule back to its parent.
139

SQL ASIS Block


SQL ASIS Write your SQL Statements here ENDSQL

140

SQL Builder (CTRL + Shift + B)

141

File Objects
Alt + Enter

Name of Table

Alt + Enter

142

SQL Builder
Choose Tables (Files) & Choose Columns (Fields)
If this is blank, then you havent got any File objects attached to the Rule

Define a where clause


You may specify joins if you wish, by using the And / Or radio buttons

143

SQL Builder
Choose any Group By or Order By clauses. To make a Fetch, fill in the Cursor name field

Review your SQL

144

Section 10
AppBuilder Set Objects

145

Sets
Collection of values Each value has a meaning in the Set

0 -803 100 -802

Red Green Blue Yellow

-818
Set of SQL Codes

Pink
Set of Colours
146

Sets
Each value has a meaning in the Set
The same value might appear in multiple Sets, but have different meaning

18

6 3 9 15 30

10

21 24 12

20
25
Multiples of 5
147

27
Multiples of 3

Why Sets?
Domains for Combo Boxes Domains for MCLB cells Use in Rules code instead of hard coding values

Sets are closely associated with Fields, hence they have a Data Format & a Length
148

Set Properties
Name of Set

Format Length (Like Fields)


Style

149

Set Styles
Values Define LookUp Error
Older style Set. It has a hierarchy of Value objects beneath it. Simplest Set. Two columns Define and Encoding. Used for Combo-box and MCLB cell domains. Has extra Display column. Like LookUp Set, has extra Display column, but used for standardising error messages in an application.

150

Values Sets
Alt + Enter CTRL+ Enter

151

Define Sets
Double-Click

Define is the meaning (always UPPER) Encoding is the value


152

LookUp Sets
Double-Click

Define is the meaning (always UPPER) Encoding is the value

Display is what you see on a Window


153

Error Sets
Double-Click

Define is the meaning (always UPPER) Encoding is the value

Display is the message which will be displayed to the user


154

Sets as Window objects (Combo Boxes)

155

Domains for MCLB columns

156

Using Sets
Use in Rules code instead of hard coding values
SQLCA.SQLCODE := 0 SQLCA.SQLCODE := Success in SQLCODES

157

Set Functions
SetEncoding
Returns the Encoding value given a Define value
set DAY_NUMBER := SetEncoding(DAYS_OF_WEEK, MON)

SetDisplay
Returns the Define value given an Encoding value
set DAY_NAME := SetDisplay(DAYS_OF_WEEK, 1)

158

Section 11
Rules Language ObjectSpeak

159

What is ObjectSpeak?
A set of Java-like functions within the AppBuilder Rules language. Methods and properties are available for all these object types
Accelerator CheckBox Color Column ComboBox Constants Dimension EditField Ellipse Font Format GlobalEvent GroupBox GuiObject Label ListBox Locale Menu MenuBar MenuItem MessageBox MultiLineEdit PasswordField Point PopupMenu PushButton RadioButton Rectangle Rule Table Timer

160

Supporting Objects
These objects are used with other objects.
e.g. BackgroundColor is an attribute of an EditField, but is set using an instance of the Color object.

Accelerator Formats (Derived) Color GlobalEvent Constants Locale Dimension Point Font

161

Object Properties
Each object has a set of properties Properties are referenced as objectname.propertyname (objectname = HPS ID)
To set a property SelectPB.Visible(True) or set SelectPB.Visible := True

To get a property set a_variable := SelectPB.Visible

162

Object Methods
Each object has a set of methods Methods are referenced as objectname.methodname( [parameters])
(where objectname = HPS ID) Some common Methods
Window EditField PushButton

setLocation(Point)
setAltered(Boolean) clearAltered( ) clearWindowChanges( )

setEnabled(Boolean)
setFormat(Format) setShortHelp(String) setFocus( )

setEnabled(Boolean)
setIgnoreValidation(Boolean)

terminate( )

setAltered(Boolean)

163

setShortHelp Method
Provides pop-up help for an object based on cursor position otherwise known as tool tips
Objectname.setShortHelp(This is the title field, right click to see valid values)

or
Set TitleHelp := This is the title field, right click to see valid values
Objectname.setShortHelp(TitleHelp)

164

Object Events
Objects trigger events when they are used

Events are handled using Event Procedures


Event procedures are defined either for an object class or an object instance

Generic

proc PushButtonClick for Click type PushButton ( e object type ClickEvent ) statements endproc proc PushButtonClick for Click object EXIT_PB ( e object type ClickEvent ) statements endproc

Specific

165

Declaring Event Procedures


Declare your event procedures in the DCL block if you want to define a procedure for Multiple events Multiple objects Multiple object types
Specific
dcl procedurename PROC FOR Click OBJECT objectname; enddcl dcl procedurename PROC FOR Click TYPE objecttype; enddcl

Generic

166

Declaring Event Procedures


Declare your event procedures in the DCL block if you want to define a procedure for Multiple events Multiple objects Multiple object types
Specific
dcl procedurename PROC FOR Click OBJECT objectname; enddcl dcl procedurename PROC FOR Click TYPE objecttype; enddcl

Generic

167

ObjectSpeak Examples
dcl myRed as object type Color; enddcl set myRed := new Color(255,23,23) CustIdFld.setBackGround(myRed) dcl OpenAccelerator as object type Accelerator; enddcl set OpenAccelerator := new Accelerator(O, Accelerator.CTRL) OpenMenuItem.SetAccelerator(OpenAccelerator) proc MaleClick for Click object MaleCheckBox (e object type ClickEvent) if MaleCheckBox.Selected = True set FemaleCheckBox.Enabled := False else set FemaleCheckBox.Enabled := True endif endproc

168

Dynamic Window Objects


You can place objects on a Window at runtime
1. 2. 3. 4. 5. 6. Declare object reference (or alias) Create new instance of object Set location Set other properties Add as child of the Window Declare an Event Handler for the object

169

Dynamic Window Objects


dcl CancelPB object type PushButton PushButtonClick proc for Click type PushButton (e object type ClickEvent); enddcl set CancelPB := new PushButton CancelPB.setHpsID('CANCEL_PB') CancelPB.setLocation(25,257) //from left, from top CancelPB.setSize(88,25) //width, height CancelPB.setText('Cancel') CUSTOMER_DETAILS.addChild(CancelPB) handler CancelPB(PushButtonClick) Proc PushButtonClick for Click type PushButton (e object type ClickEvent) if e.HPSID = CANCEL_PB set exitRule := True proc return EndProc

170

The Event Handler Statement


Use with Dynamic window objects Java Beans Syntax: handler objectname (eventname)

171

Using JavaBeans on Windows

172

Using JavaBeans on Windows

173

The MessageBox Object


1. 2. 3. 4. 5. 6.
Object type: Methods: Usage:

Create messagebox Set type of message Set push button combination Set text of message Set any arguments in text Display messagebox

MessageBox SetMessageType, SetButtonType, SetTitle SetParent, SetMessage, Show, SetArgument1, 2, 3 MessageBox.Show

174

The Pop-Up Menu Object


Can be Window pop-up or Object pop-up 1. 2. 3. 4.
Object type: Methods: Usage:

Create pop-up menu Build it (MenuItems) Allocate it to an Object Write code to handle items

PopupMenu add( Item:MenuItem ) addSeparator( ) ObjectName.setPopupMenu(Name of PopupMenu )

175

The Timer Object


Can be Window pop-up or Object pop-up 1. 2. 3. 4. Create pop-up menu Build it (MenuItems) Allocate it to an Object Write code to handle items

176

The Rule Object


In an AppBuilder generated Java application, Rules become Classes Rules are Objects
The Rule object in the Rules Language is your way of interfacing to the executing classes. The Rule object has 0 Properties 10 Events 19 Methods

177

The Rule Object - thisrule


The current executing Rule Some useful methods:
terminate() Stops rule and returns to parent

getWindow( ) Returns an object reference to the window displayed by the Rule getActiveWindow( ) Returns an object reference to the nondetached window most recently opened by a rule or its parents.
178

Section 12
Components

179

Types of Component
User
You write them Java, Cobol, C, PL1, Assembler

System
Written by BluePhoenix Supplied as objects in repository and as classes in AppBuilder.JAR

180

Using System Components

1. 2. 3. 4.

Include in Hierarchy Populate Input View Call Component Either check RETURN_CODE or use the data returned in Output View
181

Component Examples 1

Use in conjunction with these 2 Sets

182

Component Examples 2

Use in conjunction with this Set

183

Component Examples 3

Use in conjunction with these Sets

184

Do not delete

185

Do not delete

186

Section 13
Preparation & Partition Manager

187

Object Preparation

Right-Click

188

Object Preparation

AppBuilder CodeGen

Java J2EE Cobol C

Compiler

.class .class load module .dll

189

Preparation Steps
1. 2. 3. 4. 5. 6. Verify Hierarchy Create Bindfile Verify Source Code Generate Code Compile Move class to runtime directory

190

Prepare Output Panel

Open shows you job output. Restart submits prepare job again. Keep this panel tidy! o See Delete Successful Jobs option.

191

General Preparation Options

192

General Preparation Options

193

Configuration Projects
Provide way of dynamically configuring applications Must be used for Servlet, EJB and remote preparations Do not confuse with security Projects No Project open

Project (BPSIS) open

194

Preparation without Configuration


Projects

1. Tools Workbench Options 2. Preparation tab 3. Choose options 4. All Rules assume same options Not very flexible

195

Preparation with Configuration Projects

1. Create a new Project 2. Populate options 3. Build Project Hierarchy

Very flexible

196

Configuration Objects
Defines configuration of an application An Application Configuration can include many Partitions Each Partition will need to be prepared on a specific Machine A Partition may include a Database If the Partition is a client Partition, it will have a child Process Rules to be prepared as client Rules are shown like this Rules to be prepared as server Rules are shown like this If the Partition is defined as a Server, it will have a child Server

This is interface Rule you only see these if you use Gateway Partitions

197

Partition Object
Dictates HOW a group of Rules will be prepared
Partition Type Client Server Gateway Language Java Default Package - Not covering Host Properties in this class -

198

Server Partitions
Used to prepare server portions of an application
Partition Type Server Server Interface RMI WebService EJB Language Java

199

Server Partitions
CUSTOMER_SQL_SEL generated as an a WebService Remote EJB Service (RMI)
Import Statements in Customer_Sql_Sel_R.java
import import import import com.level8.appbuilder.server.*; com.level8.appbuilder.servlet.*; com.level8.appbuilder.*; com.level8.appbuilder.systemviews.*; com.level8.appbuilder.util.*;

public final class Customer_Sql_Sel_R extends HpsServerRule HpsServletRule

Import Statements in Customer_Sql_Sel_REjb.java


import import import import com.level8.appbuilder.util.HpsView; com.level8.appbuilder.HpsRule; com.level8.appbuilder.HpsRootContext; com.level8.appbuilder.util.HpsSystem;

import com.level8.appbuilder.server.HpsSessionBean; public class Customer_Sql_Sel_REjb extends HpsSessionBean

200

Server Partition JAR & WAR Files


Depending on the Server Interface chosen, the Partition is generated as the following

Cust_Ejb.JAR

Cust _Rmi.JAR

Cust _Webservices.WAR

201

Client Partitions
Used to prepare client portions of an application
Partition Type Client Client Type EventDriven HTML Language Java

202

Client Partitions
CUSTOMER_DETAILS_DIS generated as HTML Java
ImportStatements Import Statements inin Customer_Details_Dis_R.java Customer_Details_Dis_R.java
import ABVIEW.Customer_Details_W_V; import com.level8.appbuilder.servlet.*; com.level8.appbuilder.gui.*; import com.level8.appbuilder.*; import com.level8.appbuilder.systemviews.*; import com.level8.appbuilder.util.*; public final class Customer_Details_Dis_R extends HpsServletRule HpsGuiRule

Import Statements in Customer_Details_Dis_RSvlt.java


import com.level8.appbuilder.servlet.gateway.HpsServlet; public class Customer_Details_Dis_RSvlt extends HpsServlet

203

Client Partition JAR & WAR Files


Depending on the Client Type chosen, the Partition is generated as the following Cust_Java.JAR Cust_HTML.WAR

204

Partitioning an Application
Create a new Application Configuration Add child Client Partition to the AppCfg Add child Process to the Partition (query) Add child Machine to the Partition (create / query) Add child Database to the Partition (create / query)
Note: This is optional (create)

Add child Server Partition to the AppCfg

(create)

Add child Machine to the Partition (create / query) Add child Database to the Partition (create / query)
Note: This is optional

Add child Server to the Partition (create / query) Add child Rule(s) to the Server
(query)

205

The difference between

&

Rule will be prepared as part of Client Partition Rule will be prepared as part of Server Partition

206

Section 14
Executing AppBuilder Java Applications

207

Executing AppBuilder Java Apps


Pre-requisites: JVM version 1.3 (+ appropriate path environment variable) Classpaths set up for: Tools.JAR (normally C:\JDK1.3\Lib) AppBuilder.JAR (normally C:\AppBuilder\Java\RT) Application classes (depending how you prepared
the application, either
o o

C:\AppBuilder\Java\RT\Local\ (without Partitions) or C:\AppBuilder\Java\RT\AppCfg Name\Partition Name\

AppBuilder.INI Font.INI
208

The AppBuilder.INI File


Controls execution of an AppBuilder Java generated application. Normally stored in C:\AppBuilder\Java\RT
FONT_INI_URL = location of Font.INI file DEBUG_START = Startup options for RuleView DEBUG_URL = location of debug files for use with RuleView APP_LEVEL = level of AppBuilder Debug information as seen in DOS window SYS_LEVEL = level of Java Debug information as seen in DOS window DB_ACCESS = LOCAL DBMS_PREFIX = jdbc:db2: JDBC_DRIVER = COM.ibm.db2.jdbc.app.DB2Driver DBNAME = name of database to connect to USERID = user id to use when connecting to database PASSWORD = password to use when connecting to database

209

The AppBuilder.INI File


Controls execution of an AppBuilder Java generated application. Normally stored in C:\AppBuilder\Java\RT
FONT_INI_URL = location of Font.INI file DEBUG_START = Startup options for RuleView DEBUG_URL = location of debug files for use with RuleView APP_LEVEL = level of AppBuilder Debug information as seen in DOS window SYS_LEVEL = level of Java Debug information as seen in DOS window DB_ACCESS = LOCAL DBMS_PREFIX = jdbc:db2: JDBC_DRIVER = COM.ibm.db2.jdbc.app.DB2Driver DBNAME = name of database to connect to USERID = user id to use when connecting to database PASSWORD = password to use when connecting to database

210

Executing AppBuilder Java Apps I

Function prepare Run Java

211

Executing AppBuilder Java Apps II

Executing java directly java com.level8.appbuilder.HpsRule Rule_Name


very case sensitive First_Letter_Capitals _For_Name_Of_Rule

212

AppBuilder Java RuleView

Views & Fields

Rule Stack Rules Code

Current line Messages / Errors and Warnings

213

Stepping Through Code

214

Setting a Breakpoint

215

Changing Data
Double click on icons to expand View structures Single click in Value to change data

216

Watches & Watchpoints

217

AppBuilder Exceptions

218

Section 15
Useful things to know

219

Changing the Active Project

Only 1 Project can be active at any time


220

Moving objects from Project X to Project Y

221

Scripting Tools
TurboScripter
New API to AppBuilder repository VBScript or JScript

TurboCycler
Old API to AppBuilder repository Proprietary language

222

Using TurboScripter

223

Using TurboCycler

224

Cloning Objects I
2. Highlight Cloner template, click Add

3. Click on Generate

1. Choose object(s) to Clone

225

Cloning Objects II
CUSTOMER CLIENT

1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11.

Enter replacement strings Click on Add Set Cloning options Set Text & Keyword options Choose objects to clone Choose objects to reuse Save Verify Review Verify results Restart Cloner Clone

226

Cloning Objects II
CUSTOMER CLIENT

1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11.

Enter replacement strings Click on Add Set Cloning options Set Text & Keyword options Choose objects to clone Choose objects to reuse Save Verify Review Verify results Restart Cloner Clone

227

Cloning Objects III

228

Section 16
AppBuilder COBOL generation

229

Classic COBOL
Requires AppBuilder runtime environment Uses SYSTEM Ids, not Long Names Unreadable Not maintainable outside AppBuilder Can only be generated on mainframe Can only be executed on mainframe (CICS / IMS or Batch)

230

OpenCOBOL
NO AppBuilder runtime environment Uses Long Names Readable Potentially maintainable outside AppBuilder Can be generated on mainframe or PC Can be executed on mainframe (CICS / IMS or Batch) Can be executed in non-mainframe environments (MicroFocus)

231

How to generate COBOL


Method 1
1. Upload objects Personal repository mainframe repository or migrate objects from Workgroup Repository mainframe repository 2. Go into AppBuilder workbench on mainframe 3. Find the Rule & type PR to prepare it 4. Review preparation results

232

How to generate COBOL


Method 2 Use Remote Preparation
1. Ensure Remote Preparation Server is executing on the mainframe 2. Open a Remote Preparation project in AppBuilder on the PC 3. Click on the Rule, press F7 to prepare

233

Remote Preparation (Classic COBOL or OpenCobol)


Bind File Source Code

Remote prepare request

Remote Prepare Server

Submits driver job

Objects read from repository

Either return code or complete results sent back to preparation client

Builds prepare job

Submits prepare job

On job completion

234

Local Preparation / Remote Compile (OpenCobol only)


Cobol Source Code JCL

+
Listener

Objects read from repository

Either return code or complete results sent back to preparation client

Submits compile & link job

On job completion

235

How to generate OpenCOBOL


Method 1
1. 2. 3. 4. Ensure Remote Preparation Server running on the mainframe Using AppBuilder on PC Create Application Configuration Create Partition defined as Server, with NetEssential interface and default language (not Java) 5. Create Server object 6. Attach Frontier Rules to the Server object 7. Create a machine object

236

BluePhoenix Proprietary and Confidential


This document may be used in its complete form only, and is solely for the use of BluePhoenix employees and authorized personnel. The material herein is proprietary to BluePhoenix and any unauthorized reproduction of any part thereof is strictly prohibited. In consideration of the receipt of this document and the associated literature, the recipient agrees not to disclose or otherwise use or make this document available to individuals outside the group directly responsible for the evaluation of its contents, or any third party.

237

You might also like