Previous Topic: Using SSM Global EventsNext Topic: How the BEGIN Event Works


DELETE Event Example

The following example shows how the DELETE event can execute a request rule named SSMDELGX, which is passed in the name and table of the deleted resource. The rule checks whether that deleted resource is a prerequisite for another resource in the table and issues a warning message.

SSMV2_GBLEXIT_TBL ----------- TABLE DATA EDITOR ----------- COLUMNS 00001 00124 Command ===> Scroll ===> PAGE COL--> EXIT_EVENT EXIT_RES_TABLE EXIT_RES_NAME EXIT_ACTION *********************************TOP OF DATA ********************************** 000001 DELETE RULE("SSMDELGX &SSM!TABLE,&SSM!NAME") ********************************BOTTOM OF DATA********************************* )REQ SSMDELGX )PROC /********************************************************************/ /* Throw away rule name and parse input parameters */ /********************************************************************/ PARSE UPPER ARG . parms PARSE VAR parms xtable ',' xname /********************************************************************/ /* See if deleted resource is a prereq for another resource in this */ /* table */ /********************************************************************/ ADDRESS SQL "SELECT NAME FROM "xtable" WHERE PREREQ IN ('"xname"')" /********************************************************************/ /* If a row is returned then issue a warning message */ /********************************************************************/ IF name.0 > 0 THEN DO msgtext = 'Resource 'xname' was deleted from table 'xtable' and is', 'a prereq for 'name.1 ADDRESS WTO "TEXT('"msgtext"') ROUTE(1)" END /* THEN DO */ )END