Migration of RALLY Application to Oracle Forms
How To Convert RGAs To FMBs
===========================
I have developed a program that reads a RALLY report of an RGA and produces several output files.
The program does between 60% to 90% of the work. The rest one has to do manually in the testing stage. The deatails are very complex and those interested may write for details to
sss@cal.vsnl.net.in . I have taken care of most conceivable aspects and attempted to automate the process as fully as possible.Rally allows 80ch names. Oracle has a limit of 30ch. Very intelligent name mapping is done to make the application maintainable.
Rally Groups and Menus become Oracle Blocks.
ADL becomes PL/SQL. Packets become PL/SQL call to Blocks.
All C routines are converted to PL/SQL by my ScToPls utility.
RALLY Object Model
------------------
App -< 1Task, ( FRs -< (GRPs -<FLDs ),
PKTs, MNUs, DSDs, ADLs, ALSs, EXTs
Oracle Object Model
-------------------
App/Form -< PUs, FRMTRGs, ( BLKs -< BLKTRGs, FLDs -< FLDTRGs )
Object Mapping
Rally -> Oracle
----- ------
FR Nothing -- hides in :Global.Rally_FR
-- A set of Blocks sharing a Canvas
PKT Procedure but Really only a GO_block ###
-- So it is NOT a Stackable Procedure
GRP Oracle Blocks
FLD FLD
TXT Absorbed in Canvas -- no longer objects
EXT UE or PL/SQL
MNU BLK with 1 FLD ###
-- So it is NOT a Stackable Procedure
ADL PU
ALS PU --- but not exactly
----------------------------------------------------------------------
Event Mapping Rally Action Sites -- Oracle Triggers -- called Events
=============
RALLY Events Diff No Restrictions
ORACLE Events with Restrictions on Built-In Procedures
PKT events FRMTRGs
GRP events BLKTRGs
FLD events FLDTRGs
Actual events used in Rally HMS RGAs:
=======================================
Before entering query mode: After choice:
Before form/report: After delete:
Before insert: After executing query:
Before menu: After form/report:
Before quit: After insert:
Before rollback: After value change:
Before update: After visit:
Before value change: After visiting field:
Before visit: Before commit:
Before visiting field: Before delete:
----------------------------------------------------------------------
TASK only 1 and 1 Initial Action
This will be in Key-NxtFld of Fld_VTID of BLK_USERPASSVTID
MENU Not used by HMS
PKT Initial mode: is returned in ORA thru :Global.InitialMode
-- but RLY dynamic GET_MODE is static in ORA
REMEMBER execute_query or anything else WAS for a Form/report
BUT now 1 FR ---< Blocks
RLY Before form/report: -- ORA At End of Packet Proc
RLY After form/report: -- ORA At End of FRM Key-Commit ' Finish action
RLY Before quit: -- ORA Key-ClrFrm
RLY Before entering query: -- ORA In FRM Key-EntQry BEFORE Enter_Query;
RLY After entering query: -- ORA In FRM Key-EntQry AFTER Enter_Query;
RLY Before executing query: -- ORA In FRM Key-ExeQry BEFORE Execute_Query;
RLY After executing query: -- ORA In FRM Key-ExeQry AFTER Execute_Query;
RLY Before commit: -- ORA In FRM Pre-Commit
RLY After commit: -- ORA In FRM Post-Commit
RLY Before rollback: -- ORA In FRM On-RollBack BEFORE Issue_Rollback(Null);
RLY After rollback: -- ORA In FRM On-RollBack AFTER Issue_Rollback(Null);
RLY Local function: -- ORA In FRM Key-Menu
RLY FLD Compute Facility --ORA In FRM Post-Change ' for Computed Fields
-- NOTHING to do with PKT
-- GET RID Of GLOBAL(FORM-LEVEL) POST_CHANGE as this is "Inefficient"
----------------------------------------------------------------------
GRP Before visit: -- ORA In BLK When-New_Record_Instance
GRP After visit: -- ORA In BLK Post-Record
GRP Before insert: -- ORA In BLK Pre-Insert
GRP After insert: -- ORA In BLK Post-Insert
GRP Before delete: -- ORA In BLK Pre-Update
GRP After delete: -- ORA In BLK Post-Update
GRP Before update: -- ORA In BLK Pre-Delete
GRP After update: -- ORA In BLK Post-Delete
GRP Display condition: -- NOTHING
GRP Local function: -- ORA In BLK Key-Menu
NOTE: When-New-Block-Instance
Used to check if navigation OK
by checking value of :GLOBAL.RALLY_FR
always set :GLOBAL.ORACLE_BLOCK
FLD Copy field is -- ORA In FLD On-New-Record-Instance
-- F45 Use Copy F45 property
FLD After visiting field: -- ORA In FLD Key-NxtFld
FLD Before visiting field: -- ORA In FLD Pre-Field
FLD After value change: -- ORA In FLD Post-Change
FLD Before value change: -- ORA In FLD Pre-Field
FLD Validation action: -- ORA In FLD On-Validate-Field
FLD Local function: -- ORA In FLD Key-NxtFld
FLD Copy other fields from list of values -- -- F45
FLD Cursor enters list of values automatically -- F45
FLD Validate field against list of values -- F45
----------------------------------------------------------------------
RLY Commands ORA Commands
------------ ------------
COMMIT Commit_Form;
DELETE RECORD Delete_Record;
EXECUTE QUERY Execute_Query;
FINISH ACTION Commit_Form;
FIRST FIELD Execute_Trigger('First_Field');
FIRST RECORD First_Record;
INSERT RECORD AFTER Create_Record;
INSERT RECORD NEXT_GROUP Next_Block; Create_Record;
LAST FIELD Go_Field(:System.Cursor_Block || '.' || Block_Characteristic(:System.Cursor_Block,FIRST_FIELD)); Check_Package_Failure;
LAST RECORD Last_Record;
NEXT FIELD Next_Field;
NEXT GROUP Next_Block;
NEXT PAGE Scroll_Down;
NEXT RECORD Next_Record;
PREVIOUS FIELD Previous_Field;
PREVIOUS GROUP Previous_Block;
PREVIOUS PAGE Scroll_Up;
PREVIOUS RECORD Previous_Record;
QUERY Execute_Query;
QUIT ACTION Clear_Form(No_Validate);
ROLLBACK Clear_Form;
SET OVERSTRIKE Null;
SET QUERY Enter_Query;
SET UPDATE Abort_Query;
----------------------------------------------------------------------
RLY GET_CMD Values
------------------
ABORTACTION => CLEAR_BLOCK(NO_VALIDATE); -- [Cancel]
ABORTAPPL => EXIT_FORM(NO_VALIDATE);
ABORTTASK => EXIT_FORM(NO_VALIDATE); -- Danger! 2 task case!!
DELREC => DELETE_RECORD;
EXITACTION => COMMIT_FORM;
EXITTASK => EXIT_FORM(DO_COMMIT); -- Danger! 2 task case!!", cADLComment, ADLLineNo
EXITAPPL => EXIT_FORM(DO_COMMIT);"
FINSNEXT => NEXT_BLOCK; & Creates a new record in the next group of a form/report.
FLISTVAL => LIST_VALUES(RESTRICT); -- check
FNEXT => NEXT_FIELD;
FPREV => PREVIOUS_FIELD;
FRFUNCTION => RDB local_function ?? ORA key-Fn user keys ??
INSAFTER => CREATE_RECORD;"
INSBEFORE => PREVIOUS_RECORD; CREATE_RECORD;"
PNEXT => SCROLL_DOWN;
PPREV => SCROLL_UP;
RNEXT => NEXT_RECORD;
RPREV => PREVIOUS_RECORD;
QBE => ENTER_QUERY;
RLAST => LAST_RECORD;
Function Get_Cmd Return NUMBER Is
Begin
Return :Global.MyLastCmd;
-- ABORTACTION -1 EXITAPPL -7 INSAFTER -13
-- ABORTAPPL -2 FINSNEXT -8 INSBEFORE -14
-- ABORTTASK -3 FLISTVAL -9 PNEXT -15
-- DELREC -4 FNEXT -10 PPREV -16
-- EXITACTION -5 FPREV -11 RNEXT -17
-- EXITTASK -6 FRFUNCTION -12 RPREV -18
-- QBE -19 RLAST -20
End;
----------------------------------------------------------------------
NOTE. GET_MODE
UPDATE
QUERY
READ ONLY
INSERT
PRINT REPORT
WRITE REPORT
Function Get_Mode Return VARCHAR2 Is
Begin
Return(:Global.InitialMode);
End;
** You may have set this to keep :Global.InitialMode
match original RLY where GE_MODE was a real dynamic function
Try :System.Block_Status
----------------------------------------------------------------------
NOTE: Original Rally Form/Report "lives in" :Global.Rally_FR
----------------------------------------------------------------------
-3. Use File SymAPP.txt and ADLApp.txt == together total picture
-4. Use ClvApp.txt for all Conditional LOVs
-5. Convert ALL ESQL/C code to PL/SQL
-1. CHECK -- Case of a DSD Handle ( OPEN_ID ) passed as aparameter ??
& Manage by RALLY EDIT Before Main JOB
=======================================
-2. Do a rough cut InpFmb45/inpfmb60 convert and see the type of errors
1. Major Problem - call MENU or PKT in middle of an ADL
*****************************************************
2. Many PKT calls in the Middle may be Report related
3. Break such Adls into 2 BUT WATCH OUT FOR STATE
4. Delete unwanted lines esp. DB_OPEN/DB_RESET preceding DB_QUERY
5. WORK CLEAN & CAREFULLY - VERY VERY
6. RSE in And/Or Mixes to be resolved
7. Layout Edit where required - esp check BOxes
-- heuristic algorithm defeated by I patterns
8. Get Rid of Dummy Forms - Decorative strips
9. Convert PopUp to Full-Screen Menus
10. Drop Null/Empty Triggers
11. Go Ahead in FMB ONLY after 100% check on UEs
12. Testing will guide RISK RATING ADLApp.Txt
-- navigation, Restricted Procedures
-- Return_to Execute Execute_CMD
** CALL of Menu/Pkt from ADL
13. Get Rid of IF STRESS carefully
14. After you get Vws straight and preliminary work on OraApp.Txt
-> REST is an ITERATIVE PROCESS
15. Instead of copying :gbl.system_date_only
use default $$dbdatetime$$
16. In Rally DECODING may be done by Child Groups!
In Oracle Master Detail means 1 -< many and descends down
In Rally Childs may be real Childs or DECODERS
Resolve by Join/Code in Oracle
----------------------------------------------------------------------
Rally Stack Simulation
----------------------
Rally_Push_Stack ADL MNU PKT
Rally_Pop_Stack ADL MNU
Finish Action Commit + Rally_Nearest_Menu
Quit Action ClrFrm ( will do ClrBlks & Rally_Nearest_Menu )
RETURN_TO ADL,PKT,MNU - Collapse Stack to Target
PKT - go to nearest block
:Global.Oracle_Block
MNU - go to that MNU
----------------------------------------------------------------------
Enhancing/Extending the existing APPs
-------------------------------------
1. You must understand the Rally framework and how it is "preserved"
2. Do not Disturb Rally stuff
3. Fit amendments as per Rally Framework
4. New things can be freely done but be careful about
FORM LEVEL TRIGGERS
----------------------------------------------------------------------
Rally Report Structure
======================
regexp ^[0-9]+ +ObjType +ObjName is object line
' -> Task -- only 1 MAIN normally ... DIAG_TASK in NEW_HMS$NS_ADVICE
' -> Action List
' -> Menu
' -> Form/Report Packet PKT >- FR is practically 1-1
----------------------------------------------------------------------
' -> Form/Report
Correct nested structutre(hierarchy)
of txt grp & fld is available ONLY at Form level
Rest of the stuff is in Alphabetical Order NOT logical order
' -> Form/Report Field
' -> Form/Report Group
' -> Form/Report Field
' -> Form/Report Text
' -> Form/Report Text
----------------------------------------------------------------------
' -> DSD
' -> DSD Field
' -> ADL
' -> Global Variable
' -> External Program Link
' -> Password Object
' -> Number Format
' -> Number Character Set
' -> Date Format
' -> Form/Report Field or Menu Choice Legend
----------------------------------------------------------------------
If you get errors like
Warning: Item ADM_DATE_ONLY can not fit on the canvas (No Conversion).
Then either change Block's ROWS_DISPLAYED = smaller number
or make full screen
by replacing page coordinates of a popup screen by
PAGE_XS = 0
PAGE_YS = 0
PAGE_PX0 = 0
PAGE_PY0 = 0
PAGE_PXS = 0
PAGE_PYS = 0
PAGE_SX0 = 0
PAGE_SY0 = 0
Or change coordinates of invisible fields
example COLUMN = 1
----------------------------------------------------------------------
Update a Join not allowed in RLY as well as ORA
=============
In RLY such updates are silently ignored?
In ORA Clear That Block before Commit
----------------------------------------------------------------------
copy abcd.txt from d:\peerhosp\livergas
>>> Make UNIX file PC
>>> then 80ch wrap around manually
-- RegEXp for lines with col80<> space & Lines of length 80
^................................................................................$
run MigRally.exe
STUDY KEY MAPPINGS vt220 f45&r25 PC f45 & r25
----------------------------------------------------------------------
MISC
====
----------------------------------------------------------------------
Designing Forms in Character Mode
---------------------------------
Read Character.Htm and follow Instructions ONLY if you have a problem
---------------------------------------------------------------------
DO NOT Set_Window_Property('ROOT_WINDOW',Window_State,Maximize);
-- Use CorTmp to Correct older programs
1. Set window to 80x24 (window property) ROOT_WINDOW
2. Set canvas display to 80xN all RELEVANT CANVASES
Say N=19 but do not cut the Canvas!
3. Set View:Settings:Ruler to Units=CharCells, | in Layout Editor
CellSize=5.25x13.5, Grid=2, Snap=2 | all RELEVANT CANVASES
|
4. Set View:Show Canvas Off to see grids |
----------------------------------------------------------------------
Moved To Pll
------------
CHECK_PACKAGE_FAILURE
CLEAR_DETAILS
GET_CMD
GET_MODE
INSERTSTRINGINPLACE
PEERTRACE
QUERY_DETAILS
RALLY_CHECK_STACK
RALLY_COLLAPSE_STACK
RALLY_NEAREST_MENU
RALLY_POP_STACK
RALLY_PUSH_STACK
REPORT_PRINT
RETURN_TO_MENU
SHOW_HMS_MSG
----------------------------------------------------------------------
goto Msdos prompt
cd to x:\hmsmig\App
LovRseOrd App
This will read SymApp.txt file and tell you which Dsds rses were missed
-- the info will be in file LovRseApp.txt
If there is ANY entry in the file LovRseOrdApp.txt
then Fmb2fmt App
Open OraApp.fmb under F45Des32
Open OraApp.fmt under TxtPad32.exe
Open VwsApp.txt
Search fmt file for text after "Tbl"
this will tell you the Record_group name
-- Confirm that RSE column in view
-- if missing include the column in view and
catlog the view by plus33w App/App@Live
-- use F45des32 to correct Record_group