Root > How to... > ...change send workflow?

...change send workflow?

Previous pageReturn to chapter overviewNext page   

Sometimes EurekaLog does not have an option to implement a behavior that you want. If this is the case - you can alter behavior of build-in send method. Default behavior (for bug trackers) is described in this article.


All EurekaLog send methods are implemented in WinAPI, wrapped inside classes with lots of virtual and helper functions. Base send class is TELUniversalSender from ESend unit. All send methods are child classes from this class. For example, Mantis send method is implemented as TELTrackerMantisSender class from ESendAPIMantis unit. If you want to alter any aspect of default send method - you need to sub-class it and override desired virtual methods. You can also call inherited helper methods to simplify developing.


First, you need to subclass the desired send method class:


  TELTrackerMantisSender = class(ESendAPIMantis.TELTrackerMantisSender)
  // ...


The example above uses Mantis as example. If you want to customize a different send method - you will need to replace unit name and class name.


You must use the same class name as original class. You'll have to append unit name to class ident to avoid compiler confusion. That way your class will look as original class, so it will use the same options.


Second, you need to register your class:



  // Register send class to be the first in the list.


The TELTrackerMantisSender class in the example above is your class, which you have derived from default EurekaLog class.


The important piece here is to register your class as first, which is archived by using registering function with "First" suffix. Default class (from EurekaLog) will be listed after your class in registered senders. Any search for class by name will find your class, because it's listed first.



Now that preparations are completed - you can customize your class in any way you want, by overriding virtual methods. For example, if you want to replace bug title:


    function ComposeTitle: Stringoverride;
// This is a default implementation of the method,
// you can replace it with arbitrary code
function TELTrackerMantisSender.ComposeTitle: String;
  if BugAppVersion <> '' then
    Result := Format('%s (Bug %s; v%s)', [BugType, BugID, BugAppVersion])  
    Result := Format('%s (Bug %s)', [BugType, BugID]);
  Log(Format('Title = ''%s''', [Result]));


This example overrides ComposeTitle virtual method and calls inherited helper methods BugAppVersion, BugType, BugID. You can check interface declaration to determinate method that you need to override and invoke (available in all EurekaLog editions). You can also check implementation for details (for EurekaLog Enterprise edition only).



See also:

Send feedback... Build date: 2022-03-28
Last edited: 2022-01-14
The documentation team uses the feedback submitted to improve the EurekaLog documentation. We do not use your e-mail address for any other purpose. We will remove your e-mail address from our system after the issue you are reporting has been resolved. While we are working to resolve this issue, we may send you an e-mail message to request more information about your feedback. After the issues have been addressed, we may send you an email message to let you know that your feedback has been addressed.

Permanent link to this article: