Hi,
try this one:
uuid who;
int msg_i;
send_wait(0, top_object(), "call_attr", "cnt", "current_user_id");
if (msg_error()) {
who = msg[0];
}
send_wait(0, top_object(), "call_attr", "api", "insert_object", (uuid)who, "alg", NULL, 0,
"call_req_id", cr,
"time_spent", (duration)0,
"type", "LOG",
"analyst", who,
"description", format("Cancelled with comment: %s", comments),
"action_desc", format("generated by SPEL from cr_wf: %d", id)
);
if (msg_error()) for (msg_i = 0; msg_i < msg_length(); msg_i++) logf(ERROR, "%s > msg[%d]: %s", persistent_id, msg_i, msg[msg_i]);
check incode comments, code is not tested.
Regards,
cdtj