This could be a clue, this is kind of "playing-with-fire" method, but could work:
object gl, in_obj;
string in_pesid;
if (argc > 3) {
in_pesid = argv[3];
}
send_wait(0, top_object(), "get_co_group");
gl = msg[0];
send_wait(0, top_object(), "call_attr", "cr", "dob_by_persid", 0, in_pesid);
if (!msg_error()) {
in_obj = msg[0];
}
send_wait(0, gl, "checkout", in_obj);
if (msg_error()) {
logf(MILESTONE, "Skipping [%s]", in_pesid);
return;
} else {
sleep(1);
send_wait(0, gl, "uncheck");
if (msg_error()) {
logf(SIGNIFICANT, "**** happens [%s]", in_pesid);
} else {
uuid who;
send_wait(0,top_object(), "call_attr", "cnt", "current_user_id");
who = msg[0];
send_wait(0, top_object(), "call_attr", "api", "generic_activity_log", who, in_persid, "", "zSTK", 0, 0);
}
}
Returning back to normal (safe) methods, you can achieve goal in this way:
- publish new attribute to store length;
- create attached event with macro for request, which will write activity log (don't set Lock Object on macro if you're using SPEL API methods);
- on LREL trigger fetch events (atev table, whereclause: "event_template = 'evt:12345' AND obj_id '<in_persid>' AND status_flag = 2");
- if count = 0, attach new event to compare current length with length stored in request, if more that 1 - then do nothing;