CA SDM::.SPEL::. event()

Document created by TMACUL Champion on Mar 3, 2017Last modified by cdtj on Mar 15, 2017
Version 2Show Document
  • View in full screen mode

Overview

 

event name passed in from domsrvr

Usage

string current_event;
current_event = event();
logf(SIGNIFICANT, "Event: %s", current_event);

Results

Returns current event as string value.

Known values:

  • INSERT
  • DELETE
  • UPDATE

 

Examples

Codepart from group membership logging maco.

Depending on event() we will create different log types.

// mod file:
MODIFY grpmem POST_CI z_log_init(persistent_id, group, member) 110 FILTER(EVENT("INSERT DELETE UPDATE"));
// spell side
grpmem::z_log_init(...) {
     uuid member, grp;
     string thisEvt, persid;

     persid = argv[3];
     grp = (uuid)argv[6];
     member = (uuid)argv[9];

     thisEvt = event();
     if (thisEvt == "INSERT") {
          grpmem::z_log_add(persid, grp, member);
     } else if (thisEvt == "DELETE") {
          grpmem::z_log_delete(persid, grp, member);
     } else if (thisEvt == "UPDATE") {
          grpmem::z_log_modify(persid, grp, member);
     } else {
          logf(ERROR, "%s > Unknown event: %s", persid, thisEvt);
          return;
     }
}

 

 

Where can I find Spel functions documentation? 

2 people found this helpful

Attachments

    Outcomes