Previous | Next | Contents | Index | Glossary | Library |
function SEND
(role in varchar2, msg_type in varchar2, msg_name in varchar2, due_date in date default null, callback in varchar2 default null, context in varchar2 default null, send_comment in varchar2 default null priority in number default null) return number;
Description
This function sends the specified message to a role, returning a notification ID if successful. The notification ID must be used in all future references to the notification.
If your message has message attributes of source SEND or RESPOND, the procedure looks up the values of the attributes from the message attribute table or it can use an optionally supplied callback interface function to get the value from the item type attributes table. A callback function can also be used when a notification is responded to. The syntax of the callback function should follow the example described below.
Arguments (input)
| roleThe role name assigned as the performer of the notification activity. |
msg_type | The item type associated with the message. |
msg_name | The message internal name. |
due_date | The date that a response is required. This optional due date is only for the recipient's information; it has no effect on processing. |
callback | The callback function name used for communication of SEND and RESPOND source message attributes. |
context | Context information passed to the callback function. |
send_comment | A comment presented with the message. |
priority | The priority of the message, as derived from the #PRIORITY notification activity attribute. If #PRIORITY does not exist or if the value is null, the Workflow Engine uses the default priority of the message. |
procedure <name in callback argument>
(command in varchar2, context in varchar2, attr_name in varchar2, attr_type in varchar2, text_value in out varchar2, number_value in out number, date_value in out date);
Arguments (input)
| commandSpecify GET, SET, COMPLETE or ERROR. Use GET to get the value of an attribute, SET to set the value of an attribute, COMPLETE to indicate that the response is complete and ERROR to set the associated notification activity to a status of 'ERROR'. |
context | The context passed to SEND( ). The format is <itemtype>:<itemkey>:<activityid>. |
attr_name | An attribute name. |
attr_type | An attribute type. |
text_value | Value of a text attribute. |
number_value | Value of a number attribute. |
date_value | Value of a date attribute. |
Example 1
For each SEND attribute, call:
your_callback('GET', context, 'BUGNO')
Example 2
When the user responds to the notification, the callback is called again, once for each RESPOND attribute.
your_callback('SET', context, 'STATUS');
Example 3
Then finally use the 'COMPLETE' command to indicate the response is complete.
your_callback('COMPLETE', context);
Previous | Next | Contents | Index | Glossary | Library |