Difference between revisions of "Send WaitGet Co group"

From SDU
Jump to: navigation, search
(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...)
 
 
Line 12: Line 12:
 
== Usage ==
 
== Usage ==
 
<source lang="javascript">
 
<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)
+
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>
 
</source>
  
Line 19: Line 21:
 
* attr_name - name of attribute on which the action 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)
 
* 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 [[Send_WaitGet_Co_group|get_co_group]] method
+
* group_leader - Group leader object obtained from [[Send_WaitGet_Co_group|get_co_group]] method
* string obj_persid - persistence_id of CR or CHG object which the event will be connected to
+
* 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
+
* evt_name - name provided in evt.sym field
* duration override_duration - if you want to pass NULL it must be casted: (duration)NULL
+
* 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
+
* 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
+
* 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
+
* unknown - simply put 0 there
  
 
== Results ==
 
== Results ==
Line 32: Line 34:
 
== Examples ==
 
== Examples ==
 
<source lang="javascript">
 
<source lang="javascript">
object group_leader;
+
object group_leader;
send_wait(0, top_object(), "get_co_group");
+
send_wait(0, top_object(), "get_co_group");
group_leader = msg[0];
+
group_leader = msg[0];
send_wait(0, top_object(), "call_attr", "evt", "new_attached_event",
+
send_wait(0, top_object(), "call_attr", "evt", "new_attached_event",
          group_leader, argv[3], "Close Incident", (duration) NULL,
+
          group_leader, argv[3], "Close Incident", (duration) NULL,
          (date) NULL, "CLS", 0, 0);
+
          (date) NULL, "CLS", 0, 0);
if (msg_error()) {
+
if (msg_error()) {
  logf(ERROR, "new_attached_event failed: (%s)", msg[0]);
+
logf(ERROR, "new_attached_event failed: (%s)", msg[0]);
  return;
+
return;
}
+
}
 
</source>
 
</source>

Latest revision as of 10:10, 29 July 2009

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.

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>