Send WaitCall attrNotify list

From SDU
Jump to: navigation, search
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 sends notifications to a list of concrete recipients.

This action can be called in spell code in method send_wait (or send) using call_attr action.

Usage

<source lang="javascript"> void send_wait (int timeout, object top_object, "call_attr", string factory_name, "notify_list",

               string contact_persid, int evt_level, string evt_mtitle, string evt_mbody, string msg_ack, 
               int trans_pt, string parent_object, int is_internal, int cmth_override)

</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 - "cnt" in this case
  • contact_persid - list of space (' ') separated persistent IDs of notified contacts
  • evt_level - notification level (low, normal, high, emergency)
  • evt_mtitle - message subject
  • evtmbody - message body (plain text format)
  • msg_ack - unknown, but usually empty string: ""
  • trans_pt - unknown, but has these values: 28 - for request; 29 - for change and issue
  • parent_object - peristent ID of a base object (request, change...); this ticket will refer this notification in a Notification log
  • is_internal - probably 0/1; usually 0
  • cmth_override - ID of forced Notification method or 0 if method defined for given contact and evt_level should be used

Results

No results.

Examples

<source lang="javascript"> string evt_mtitle, evt_mbody; evt_mtitle = format("Change Order %s - '%s' Event Notify Group", chg_ref_num, event_tmpl.condition.sym); evt_mbody = format("change %s event notification\n", chg_ref_num); evt_mbody += format("priority: %d\n", priority.sym); evt_mbody += format("assigned to: %s\n", assignee.combo_name); evt_mbody += format("requester: %s\n", requestor.combo_name); evt_mbody += format("description: %s\n", description);

int evt_level; evt_level = 2; int trans_pt; trans_pt = 29; string contact_persid;

if (!is_null(group)) {

  contact_persid = misc::find_mang(group);
  if(!is_empty(contact_persid)) {
     send(top_object(), "call_attr", "cnt", "notify_list",
          contact_persid, evt_level, evt_mtitle, evt_mbody, "", trans_pt, persistent_id, 0, 0);
     if (msg_error()) {
        logf(ERROR, format("macro event error on notify_list '%s'", msg[0]));
     }
  }

} </source>