Send WaitGet Co group
From SDU
Revision as of 10:07, 29 July 2009 by Kowy (Talk | contribs) (New page: __NOTOC__ Category:Customizations Category:r11 Category:Spell Code {{Global Header}} {{Global Announcement}} == Overview == This method for attaching events to CR or CHG object...)
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", group_leader, obj_persid, evt_name, NULL|override_duration, NULL|override_starttime, string goup_name, unknown, 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)
- object group_leader - Group leader object obtained from get_co_group method
- string obj_persid - persistence_id of CR or CHG object which the event will be connected to
- string evt_name - name provided in evt.sym field
- duration override_duration - if you want to pass NULL it must be casted: (duration)NULL
- date override_starttime - if you want to pass NULL it must be casted: (date)NULL
- string group_name - simple string which will be stored in atev.group_name field; this is usefull for later filtering
- int 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>