This is the most tricky function and it is the main reason of difficulty of reading SPELL code. It is used for calling methods on objects. On every SD object (ie. cr, chg, alg...) are defined methods and using send_wait function you can call them. Definitions of some of them are in *.maj files in $NX_ROOT/bopcfg/majic folder.
void send_wait (int timeout, object top_object, string method, [ var parameters… ])
Function doesn't return value, but methods usually fill global msg array with return values. What values are on what positions depends on the called method.
Send wait - SDU
This method loads from database an object connected over SREL relation to an another object and return it as full DOB object.
This action can be called in spell code in method send_wait for call_attr.
void send_wait (int timeout, object top_object, "call_attr", string attr_name, "get_dob")
On success attribute DOB object is in the first position of global array msg.
object retval; retval = msg[0];
// Part of code to read request Affected End Usersend_wait(0, this, "call_attr", "customer", "get_dob");if (msg_error()){logf(ERROR, "%s: error in get_dob(customer): %s", method, msg[0]); return;}object aff_eu;aff_eu = msg[0];
// Part of code to read request Affected End User
send_wait(0, this, "call_attr", "customer", "get_dob");
if (msg_error())
{
logf(ERROR, "%s: error in get_dob(customer): %s", method, msg[0]);
return;
}
object aff_eu;
aff_eu = msg[0];
uuid who;send_wait(0,top_object(), "call_attr", "cnt", "current_user_id");who=msg[0];send_wait(0, top_object(), "call_attr", "api", "update_object_super", who, persistent_id, 0, "is_asset", "0", "is_ci", "1");
uuid who;send_wait(0,top_object(), "call_attr", "cnt", "current_user_id");who=msg[0];
send_wait(0, top_object(), "call_attr", "api", "update_object_super", who, persistent_id, 0, "is_asset", "0", "is_ci", "1");
In this case all you need to know is the persistent_id of the object you want to modify. And then you can define multiple name-value pairs to update this object
Example built by Gutis