Send WaitGet Co group
From SDU
To make corrections or additions to this article, select the edit tab above.
To discuss or ask questions about this article, select the discussion tab above.
To discuss or ask questions about this article, select the discussion tab above.
Overview
This method for attaching events to CR or CHG objects.
This action can be called in spell code in method send_wait for call_attr.
Usage
<source lang="javascript"> void send_wait (int timeout, object top_object, "call_attr", string factory_name, "new_attached_event",
object group_leader, string obj_persid, string evt_name, duration NULL|override_duration,
date NULL|override_starttime, string goup_name, int unknown, int unknown)
</source>
- timeout - how long (?in seconds?) should the method wait for finishing the method (0 means infinite)
- top_object - root object for the method (on which the method is called)
- attr_name - name of attribute on which the action is called
- factory_name - name of factory on which the action is called (could be "cr" for requsts and incidents, "chg" for changes, "iss" for issues)
- group_leader - Group leader object obtained from get_co_group method
- obj_persid - persistence_id of CR or CHG object which the event will be connected to
- evt_name - name provided in evt.sym field
- override_duration - if you want to pass NULL it must be casted: (duration)NULL
- override_starttime - if you want to pass NULL it must be casted: (date)NULL
- group_name - simple string which will be stored in atev.group_name field; this is usefull for later filtering
- unknown - simply put 0 there
Results
On success nothing. If error occured msg[0] contains error message.
Examples
<source lang="javascript"> object group_leader; send_wait(0, top_object(), "get_co_group"); group_leader = msg[0]; send_wait(0, top_object(), "call_attr", "evt", "new_attached_event",
group_leader, argv[3], "Close Incident", (duration) NULL,
(date) NULL, "CLS", 0, 0);
if (msg_error()) {
logf(ERROR, "new_attached_event failed: (%s)", msg[0]); return;
} </source>