Documentation Center

EventMonitor 2.5EndEvent

Stops the event specified by the ProgressId, and updates the progress information of the event.


Parameters

NameTypeDirectionDescription
psAuthContextStringInOutDeprecated proprietary authentication context only used by .ASMX web services based on internal username/password authentication. Claims based security standards drive all the WCF .SVC web services making this parameter redundant.
plProgressIdLongInThe unique identifier of the event
peStatuseProgressStatusInIndicates the overall status of the event
piCurrentProgressInIndicates how much of the expected workload for the event was done. A negative number can be used to indicate that the current progresss doesn't need updating.
piMaximumProgressInThe number with the expected workload for the event

Note that:
  • This call should be the last call in your background process!
    • None of the calls will throw an exception when you add extra event details after closing the event.
    • However, this gives a very confusing situation, because the background process is still busy, while the status of the event is no longer indicated as busy.
    • An extra remark is that extra event details can change the overall status of the event. For instance, when the event detail has the status FAILED , the overall status will also be changed to FAILED ignoring the status which might have been set by the programmer.
    • So, be very careful with the moment that you call the EndEvent in your code!
  • Make sure that every exit point in your code calls the EndEvent method to avoid your background process to remain BUSY.
  • Modification date is set to the current date (and time)
  • The piMaximumProgress specifies the upper limit for the current progress. If everything went well at the end of your (background) process, the current progress should be the same as the maximum progress.

    The value of the maximum progress can be anything you want:
    • The total number of objects to process. In this case you can raise the current progress with each object that is (successful) processed
    • The timeout duration of an event. So, if you know that the process will have a duration of about 1 hour, you can initialize the maximum progress to 60 minutes and raise the current progress every minute.
    • Another possibility is to use percentages. The maximum progress is 100 and after executing x percent of the background process, you can raise the current progress accordingly.
  • A negative number can be used to indicate that piCurrentProgress and/or piMaximumProgressdoesn't need updating.
  • Concerning the status there are 3 possibilities:
    • The programmer keeps track of the status within the (background) process and decides whether the process was successful or not. So, although one of the event details might indicate that the background task failed, the programmer can decide that the event (maybe after a reschedule) finished successfully. In this case, the status will be SUCCESS, FAILED or WARNING.
    • Although the event is a simple event without sub events, it is not possible to keep track of the overall status during the background task. For instance, the event is resend several times to avoid timeouts. In this case, it is possible to supplied the status CALCULATE and the EndEvent method will use the statuses of the event details to find-out the overall status. Try to avoid this because calculating the overall status using the event details can take some time and can have some performance impact during calculation.
    • If the event is the main event and has started several new asynchronous sub events, it is impossible to know the overall status. So, the status will remain CALCULATE. The overall status is calculated upon retrieval by checking the status of the sub events.