📘
TimeLine E3
  • TimeLine E3 Documentation
  • Framework
    • Introduction
    • DataSet Definition
    • Window Handling Object
      • Input/Output arguments
      • Open
      • BindDataControls
      • Item Changes
      • Item Search
      • MenuItemClicked
      • Print
      • ModuleOpened (BlueArrow)
      • BlueArrowArguments
      • New Row
      • Delete Row
      • Save
      • Transactions
      • Locking [deprecated]
      • Locking (new)
      • Resizing a response window
      • ParaPanel
      • Adding DMS Tab to a Module
    • BusinessObject
    • Controls
      • BindingFormat
      • LookupGrid and SearchDef
      • ComboBox
      • RadioButton
      • Multiline Textbox
      • xTextBoxSearch
      • xFileBrowse [v16+]
      • DxDispoColumn
      • DxProgressColumn
      • DxTemplateColumn
      • Change control caption programmatically
      • TabControl
      • Navigation
      • Enable controls programmatically
      • Enable a MenuItem programmatically
      • Filter search values
      • Jumping to another module
      • Messages, Notifications, Log, Exceptions, Translation
      • LoggerSink [deprecated]
      • Log
      • OpenFile, FolderBrowsing and SaveFile
      • Execute Actions while displaying an Hourglass
      • Using Progress
      • Async methods with progress bar
      • Wizard
      • Customizing controls using xBehaviors
      • TLProperty.AllowInReadOnly [v16+]
    • DataSet Operations
    • Business-related functionality
      • Getting the next primary key
      • Hybrids
      • Enums
      • Get Current User
    • SQL
    • SQL (using named parameters)
    • Advanced SQL
    • Expression Binding
    • Server-side logic & customization [v16+]
      • Service Hoster
      • Starting / stopping hosted services
      • Changes to scheduled jobs!
      • Business Object Proxies
      • Business Object API
    • Colors in Expression Bindings [v15+]
    • Theming
      • Icons
  • TimeLine Developer (TLD)
    • Debugging in TLD
    • Targets
    • Custom Project Rework [v16+]
  • TimeLine-specific LL functions
  • Stunnel proxy
    • Pre-requisites
    • 1. Initial setup
    • 2. Generate the server/web certificates
    • 3.a. Generating client certificates using the CSR flow
    • 3.b. Generate client certificates from the server console
    • 4. Setting up the E3 client connection
    • 5. Setting up the browser certificates
  • Configuration
    • Configuring the WCF timeout
  • Troubleshooting the E3 Bridge
  • [Deprecated]
    • TimeLine WEB - deprecated in v16+
      • Prerequisites for running the WASM modules on the server
      • Prerequisites for developing WASM modules with TLD
      • Creating a small web module with TLD
      • Terminal Configuration
    • Customization Examples - deprecated in v16+
    • Codestore [deprecated]
    • Configuring the scheduled jobs timeout - deprecated in v16+
Powered by GitBook
On this page
  1. Framework
  2. Server-side logic & customization [v16+]

Changes to scheduled jobs!

New scheduled job platform that allows for easy customization

PreviousStarting / stopping hosted servicesNextBusiness Object Proxies

Last updated 1 year ago

As of version 16 we've made important changes to how scheduled jobs are created and deployed. Scheduled jobs now use the recently introduced service hoster in order to have full customization support. The previous scheduled jobs have been moved from the now defunct BusinessFunctions class into the apropriately named busScheduledJobs business object.

Adding a custom scheduled job is as easy as customizing the busScheduledJobs business object and adding a new method that accepts no parameters and returns void.

Enabling customizations for a server mandant can be done by editing the tlx.ini file where the server has been installed and adding a 'CustomPath' key with the value pointing to a custom path directory, just like we do to client mandants.

Example:

# ...
[ServicePorts]
  tlsvc = 50516
[Mandant/001]
  Mandant = Neo16
  DmsMailImport = Off
  DMSImportConfiguration = 
  ConnectionString = Provider=SAOLEDB.17;ENG=local-17;DBN=Neo16;Links=tcpip(Host=localhost);Downlevel=TRUE
  Credentials = Yq2AIIl+GMGH+rZUozxerg==
  # We apply this custom path to the server mandant called Neo16
  CustomPath = C:\Customizations\CustomServer16
# ...

Here is an example we used to have in the documentation for custom scheduled jobs, adapted to version 16. In order to create a new custom scheduled job, first create a new customization from TimeLine Developer.

The next step is to customize the busScheduledJobs business object and add our new logic.

To ensure our custom methods are picked up by the service hoster we need to make sure we edit the server tlx.ini to add the custom path to our server mandant (as shown at the top of this page). Please make sure you restart the service hoster service in order for this change to take effect!

We can easily add a new custom method that can be invoked via the scheduled jobs mechanism by writing a non-static public method that returns void and has no parameters.

Generating reports from server-side scheduled jobs

Make sure you reference the TimeLine.Report assembly

public void ReportExportTest()
{
    TranslationManager.Instance.LoadCurrentCulture();
    
    var rep = new TimeLine.Report.TLListAndLabel();
    xSqlArgs args = new TimeLine.Framework.Data.xSqlArgs();
    
    rep.DoPreview("rptBeleg02", args, null, "Beleg02", null, "c:\\TMP", "ExportTest", "pdf", null, null, null, null);
}

If everything is set up correctly you should be able to see the custom added method in the scheduled job configurator dropdown:

For the above example to work you need to have the Beleg02.lst report in your server installation reports directory. A succesful job run should produce the expected results:

Please note that only calls to the busScheduledJobs.Log method actually get logged into the jobs' log file - any other output (like calls to the TimeLine Framework Log static class will be written into the log associated with the ServerBusinessObjects service hosted by the Service Hoster. In this case, this file is located at TimeLine Server 16.0\Logs\ServiceHoster\ServerBusinessObjects_Neo16 where Neo16 is the mandant name this was running under.

A new customization for v16
Customizing the busScheduledJobs object
The custom method appears in the scheduled jobs configurator
Succesful custom job run log output
The generated report