OnEvent
The OnEvent implementation for X is as follows:
#pragma used dll oppmmmbl002sb00 | business object Y
#pragma used dll oppmmmbl003sb00 | business object Z
#define CHECK_RET(retval, ...)
^ if retval <> 0 then
^ dal.set.error.message(…)
^ return(DALHOOKERROR)
^ endif
| implementation is incomplete; see note below
long request | OnEvent request for business object Y or Z
long retl | return value to be checked
long duml | dummy variable (PublishEvent does not return an error value)
type = getTypeFromRequest(i.request)
on case type
case “type1”:
retl = replaceBdeNameInRequest(i.request, “Y”, request)
CHECK_RET(retl, ...)
retl = ppmmm.bl002sb00.OnEvent(request, o.response, o.result)
duml = xmlDelete(request)
CHECK_RET(retl, ...)
return(0) | OK
| no break because of return
case “type2”:
retl = replaceBdeNameInRequest(i.request, “Z”, request)
CHECK_RET(retl, ...)
retl = ppmmm.bl003sb00.OnEvent(request, o.response, o.result)
duml = xmlDelete(request)
CHECK_RET(retl, ...)
return(0) | OK
| no break because of return
default:
o.response = 0
o.result = 0
dal.set.error.message(…)
return(DALHOOKERROR)
endcase
Note: The OnEvent has the same issue as the Change method, in case the type
is changed or unavailable. See the following section Other Methods.
The OnEvent implementation for Y and Z can be the default one.