project BLF > class PWorkInbox > method DeleteMessage
Description
Method to be called from the workobject postsave in case a workobject is removed from the system. This method will delete the associated message in the message queue on the appshell side.
Parameters
icMessageGuid | input | character | The unique GUID to reference the message in the inbox queue on the appshell backend. |
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
BLF
program code (program1/pworkinbox.p)
If oiReturnStatus = 0
Then Assign oiReturnStatus = -98.
assign vhIn = ?
vhOut = ?
vhInOut = dataset dsMessage:handle.
Create Dataset vhIn in widget-pool "non-persistent".
Create dataset vhOut in widget-pool "non-persistent".
/* ================================================================= */
/* Create the right record in the dataset expected by the backend. */
/* ================================================================= */
if icMessageGuid = "" or icMessageGuid = ?
then do :
end.
empty temp-table ttMessage.
create ttMessageQueue.
assign ttMessageQueue.queueName = "Inbox":U.
create ttMessage.
assign ttMessage.msgGuid = icMessageGuid.
<M-1 run CallStandAloneService
(input ? (icExternalProcedureDispatcher),
input 'com/qad/shell/inbox/DeleteAllMessages_a.p':U (icExternalProcedureService),
input vhIn by-reference (izInput),
input-output vhInOut by-reference (bzInputOutput),
input-output vhOut by-reference (bzOutput),
output viFcReturnSuper (oiReturnStatus)) in PWorkInbox>
If viFcReturnSuper <> 0
Then Assign oiReturnStatus = viFcReturnSuper.
If viFcReturnSuper < 0
Then do:
delete object vhIn.
delete object vhOut.
Return.
end.
delete object vhIn.
delete object vhOut.
If oiReturnStatus = -98
Then Assign oiReturnStatus = 0.