Presentation is loading. Please wait.

Presentation is loading. Please wait.

Standard validation method with code generation in the ADEL system 10. November 2015. Wiesbaden Erzsébet Kómár IT Department

Similar presentations


Presentation on theme: "Standard validation method with code generation in the ADEL system 10. November 2015. Wiesbaden Erzsébet Kómár IT Department"— Presentation transcript:

1 Standard validation method with code generation in the ADEL system 10. November 2015. Wiesbaden Erzsébet Kómár IT Department erzsebet.komar@ksh.hu

2 Introduction Background Integrated Data Entry and Validation System – ADEL – SDE2015 Budapest Integrated, general, flexible, meta-driven, standardized Oracle Database 11g Oracle Fusion Middleware 11g (Forms, plsql, sqlplus) Main topics of the presentation Naming convention (in the database, in the file system) Standard validation method with code generation Examples in the presentation: 2015 / 1097 - Statistic of product procurements Agricultural survey 2 Product code (a) Denomination (b) Quantity (c) Price including VAT (1000 Ft) (d)

3 Naming convention – main points 3 Subject code2 charI – industry, B – investment, M – agriculture, MR – agriculture, agrimonetary statistics Y – non statistics, general; YR – ADEL, YW – Elektra Subject user (=schema)  owner of the objects in the DB  subject code+year code  new one is created in every year 4 charIB14 – industry, product statistics surveys data 2014 MR15 – agriculture, product procurements surveys 2015 Measure (surveys’ data) ID  group code  measure ID (group+number) 1-5 char 1-7 char MRAA0 – procurement data MRAA003 – quantity of procurement MRAA006 – price of procurement (with VAT) Nomenclature ID4 charMR65 – agricultural product code

4 Applying naming convention Objects in the database {subject_user}.{subsystem}_{survey}_{content}_{year}[months] (tables) MR15.YR_1097_MRAA0_150112survey data table MR15.YR_1097_HIBA_150112survey error table Validation functions {type}{category}{scope}{measureID}(hitmraa003, vitmraa003) typeh=validation fn., v=variable, k=conditional fn. category i=range, e=equal, r=relation scopet=actual, e=previous, b=previous year, o=other survey Applications and reports in the file system {subsystem}{type}{short_filename}.{extension} {subsystem}{type}{short_filename}_{survey}_{year}[months].{extension} general error reportadel\general\yrfroljh.sql survey specific error reportadel\2015\1097\yrfroljh_1097_150112.sql survey specific online appl.adel\2015\1097\yrkfar_1097_150112.fmx survey specific batch appl.adel\2015\1097\yrkfbe_1097_150112.fmx 4

5 Validation – roles & responsibilities Defining – Statistician – with ELLA subsystem describes the conditions, algorithm, meta characteristics text format, not with mathematical formula Preparing – IT developer – with ADEL-META subsystem creates DB objects with Designer generates error handling package - stored in the database builds the validation functions generates the validation functions – stored in the survey plsql library The validation functions are called from the online and batch validation applications 5

6 The architecture of validation 66 Online application (yrkfar_1097_150112.fmx) Batch application (yrkfbe_1097_150112.fmx) pl-sql library Specification: data & validation function declarations Body: validation functions hitmra003 hetmra003 hetmra006 MR15 survey data table (yr_1097_mraa0_150112) survey error table (yr_1097_hiba_150112) error handling pkg Specification Body DatabaseApplication server

7 Code generating with ADEL-META Program codes are prepared by application (procedure) using naming convention – names are combined by algorithm database dictionary – meta information about DB objects input parameters – year, survey code Rules of error handling every survey has its own error table if a validation is false an error row is inserted, if an error is corrected the error row is deleted, if it is accepted the error row is updated Rules of validation packages and functions every survey data table has its own validation package the name of the validation package (MRAA0) is the same as the name of the mesaure group code in the survey data table (YR_1097_MRAA0_150112) every validation package has a specification part (with data & function declaration) and a body part (with program codes) a validation function consists of nested functions (conditional, error handling) the validations have standard structure

8 Standard structure of validation functions Every validation has standard structure 8 meta level conditionwith general function (compulsory) [validation condition(s)]with common function or own function (optional) [operation]with common function (optional) internal validationwith common function or own function (compulsory) error handlingwith generated procedure (compulsory)

9 Simply example for validation 2015 / 1097 – Statistic of product procurements Validation (in the ELLA subsystem): if the quantity (mraa006) > 0 then the price (mraa003) / the quantity (mraa006) must be between 100 and 200 Generated validation function (ADEL-META) -- The unit price (e/c) must be beetween 100 and 200 (error message from the ADEL-META system) function hitmraa003return number is v_rc number; begin vitmraa003 := null; v_rc := c.fokelle('hitmraa003',std.onbat,std. my106, std.my103);-- meta level condition (c.fokelle -> general function) if v_rc = 0 then v_rc := greatest(v_rc,ff.nagyobb (tmraa0.mraa006,0));-- validation condition (nagyobb = greater fn. -> common function) if v_rc = 0 then vitmraa003 := kf.osztas (tmraa0.mraa003, tmraa0.mraa006);-- operation (osztas = devide fn. -> common function) v_rc := kf.kozott (vitmraa003, 100, 200);-- internal validation (kozott = between fn. -> common function) end if; if (std.onbat='1' and std.my103='0') or std.onbat='2' then mr15.hi_1097.hadmin (c.c0_rek.ceaa0_sq,v_rc, std.tev,std.mho,std.mc01,std.mc01_ex,torzs.mc005_v,torzs.tor_rek m005, torzs.tsz, v_mm805ba, vitmraa003,torzs.yw_sq, c.c0_rek.my106);-- error handling (hadmin -> generated procedure) end if; return(kf.hkod(v_rc)); end hitmraa003; Product code (a) Denomination (b) Quantity (c) Price including VAT (1000 Ft) (d) MR65MRAA006MRAA003

10 Thank you for your attention 10

11 Demos – recorded sessions generating error handling package building a new validation use common functions generating validation functions [validation with own special functions]


Download ppt "Standard validation method with code generation in the ADEL system 10. November 2015. Wiesbaden Erzsébet Kómár IT Department"

Similar presentations


Ads by Google