CA 2E r8.5 – An Overview Rory Hewitt – CA Technologies SAM2012 - April 16, 2012 About the Speaker — Rory Hewitt − Software Architect for 2E team − Software developer for 17 years (14 with 2E development team) − Helped design some of the largest features in recent 2E history • RPGIV generator, function wrappering & duplicate parameters, triggers − Competition-level snowboarder, boxer and karateka 2 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. agenda overview of r8.5 new functionality at r8.5 — Default templating — Trigger functions — Service program support questions 3 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. overview of release 8.5 — Available since 2009 — Major release — Significant take-up by customer base — Most common release in use by far — 1 service pack available (8.5 SP1) plus multiple fixes 4 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. Default templating 5 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. default templating — Allows automatic use of a *Template function − New functions copied from *Template function — Include standard functionality on a function-type basis − Standard *MOVE ALL's in RTVOBJ (DB1.*ALL->PAR.*ALL) etc. − Common initialization functionality — Standardize parameters for function types − Include extra parameters by default − Use RCD instead of KEY for DBF functions (CHG/CRT/DLT/RTV) − Call another function within a CHGOBJ to load a field 6 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. Default RTVOBJ parameters – where are the non-key fields? 7 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. Default RTVOBJ parameters - have to be changed for every RTVOBJ :( 8 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. Create a RTVOBJ over the *Template file 9 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. Create some 'sensible' parameters (like the whole record format)... 10 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. ...and return the nonkey fields 11 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. Add in the standard *MOVE ALL's for 'record not found'... 12 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. ...and 'record found' 13 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. ...and set the 'Default prototype function' flag to 'Y'... 14 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. ...(not forgetting to read what it does, of course!)... 15 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. Now create a new RTVOBJ function over your file... 16 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. ...and note the new completion message (same as if F21 was used)... 17 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. ...and see that the parameters are more useful... 18 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. ...and correctly return the fields you want... 19 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. Trigger functions 20 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. trigger functions — External 2E functions of type TRGFUN − Predefined parameters based on owning file − No default Action diagram code (like EXCEXTFUN) — 'Endpoint' for CA 2E trigger framework − Invoked when owning database file is updated by application • Called directly in updating job (synchronous) • Called via data queue server (asynchronous) — Can contain any processing (except updating owning file) 21 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. ...Create a trigger function (TRGFUN) over any file... 22 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. ...and view the parameters (which are all read-only)... 23 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. 1. *Trigger control data 24 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. 2. 'Old' record format 25 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. 3. 'New' record format 26 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. ...and add some code to the function itself trigger functions — Define triggering conditions for each Trigger function − Event (Insert, Delete, Update) − Time (After or before record update) − Commitment level — Use YCVTTRGDTA command to convert − Trigger control information converted to external (non-2E) format − Triggers added to *FILE object − Specify CA 2E Trigger Router (YTRIGGER) as trigger program — External trigger-related objects exist outside 2E model − Either *GENLIB or separate library 28 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. Specify triggering conditions for each Trigger function... 29 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. ...then convert trigger data to external format... 30 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. ...then edit converted external trigger data and add triggers to PF(s) automatically 31 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. All 2E triggers call same 'trigger program', called YTRIGGER... 32 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. trigger functions — At runtime, file is updated by application program — OS Database Manager calls YTRIGGER (Trigger Router) — Trigger Router determines 2E Trigger function(s) to call — Either − Trigger Router calls 2E Trigger function(s) directly (synchronous) — Or − Trigger Router sends transaction information to Trigger Server − Trigger Server calls 2E Trigger function(s) (asynchronous) 33 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. trigger functions – synchronous processing *FILE *FILE *FILE *FILE *FILE File Application Program 1 Trigger Router 2 TRGFUN 3 1. Application program updates file 2. Database Manager (operating system) calls Trigger Router 3. Trigger Router calls 2E Trigger function(s) 34 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. trigger functions – synchronous processing — Synchronous processing − Default option — Benefits − Can be used where application program should know about errors − Easy to debug (in same job as application program) − Simplest way to add functionality − Program-to-program call – less likelihood of problems — Drawbacks − Long-running processing will 'lock' application program 35 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. trigger functions – asynchronous processing *FILE *FILE *FILE *FILE *FILE File Application Program 1 1. Application program updates file 2. DBM (OS) calls Trigger Router 3. Trigger Router sends data to Trigger Server (in different job) 4. Trigger Server calls 2E TRGFUN(s) 36 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. Trigger Router 2 3 Trigger Server TRGUN 4 trigger functions – asynchronous processing — Asynchronous processing − Non-default option – must be specifically chosen — Benefits − Can 'offload' long-running processing to separate job − Allows application program to continue − Least chance of problems showing up in application program − Can 'save' trigger processing for later time/date — Drawbacks − Errors in trigger function don't signal application program − Complex to test 37 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. Service program support 38 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. ILE support prior to r8.5 — Some ILE support prior to r8.5 Existing ILE Support — Generation of ILE languages − RPGLE (introduced in Release 7.0) − CBLLE (introduced in Release 8.0) — Can define functions as PGM (*PGM) or MOD (*MODULE) — Modules not directly 'callable' − Must be 'bound' into calling program 39 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. ILE support prior to r8.5 PGM Function EditCustomer EditVendor EditAccount calls MOD Function PromptData ValidateData gives us *PGM objects 40 EditCustomer EditVendor EditAccount PromptData PromptData PromptData ValidateData ValidateData SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. ILE support prior to r8.5 — Each *PGM contains a copy of each *MODULE it needs − Bind-by-copy — Benefits − Fewer runtime *PGM objects − Bound calls are quicker than program calls — Drawbacks − Large stand-alone multi-*MODULE *PGM objects − Change to bound module requires program update 41 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. service program functionality at r8.5 — Ability to create service programs (*SRVPGM) − Consist of one or more modules − Accessed at runtime by programs — Programs no longer 'contain' modules − Bind-by-reference — Bound calls still faster than program calls — Module change only requires service program update − No change required to calling programs 42 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. service program functionality at r8.5 PGM Function EditCustomer EditVendor EditAccount calls MOD Function PromptData ValidateData gives us *PGM objects EditCustomer EditVendor DataFunctions *SRVPGM object PromptData ValidateData 43 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. EditAccount Enhanced ILE Support — New "Service program" function type − Can be created over any model file — Fully integrated with existing model functionality − Impact Analysis − Change Management − Model Documentation — Uses same 2E 'look and feel' − Intuitive and easy for long-time 2E developers 44 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. Service Program Creation — *SRVPGM's are not 'typical' source-based objects… — …but we found a way to do it − One source member per *SRVPGM • Generation control information • Creation options (used by Toolkit compile preprocessor) • Export list − Allows full integration with change management tools • Source control, security, promotion, rollback etc. − Same *DSNR/*PGMR/*USER authority as elsewhere 45 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. Service Program Creation — Multiple signature options − System-generated, hard-coded or *SRVPGM name − Allows better control of runtime objects — Can also bind modules created outside CA 2E model − Use 2E model as 'placeholder' for external *SRVPGM's − Puts under source control, versioning etc. − Stores complex CRTSRVPGM command etc. 46 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. New 'Service program' (SRVPGM) function type 47 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. Service program signature Object attribute is 'BND' Object type is 'SPG' New 'M' and 'P' selection options 48 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. Use F9 to change signature 49 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. SERVICE PROGRAM MODULES lists modules that comprise the service program Standard options can be used against any modules from the CA 2E model 50 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. SELECT MODULE screen allows user to add modules from the CA 2E model to the service program 51 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. Option G generates source into member in QSRVSRC source file Generated source consists of two 'sections'… 52 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. Compilation instructions Z* and Y* lines used by the CA 2E Toolkit compile preprocessor to create the service program 53 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. Export definition list List of procedures and data exported by the service program, along with the signature definition 54 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. Impact Analysis New *BNDMOD reason code for bound modules 55 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. Summary — Simplifies application development process — Uses new 1E compile preprocessor functionality — Allows users to move fully to an ILE environment 56 SAM2012: April 16, 2012 Copyright © 2012 CA Technologies. questions ?