60.1 Background Processing and Autostart

60.1.1 Architecture

The actual processing is done by a dedicated background process (AXPProcessor) that the main program starts and supervises. This has two practical consequences:

  • The user interface stays responsive even during large processing runs.
  • The main window does not have to be visible - minimized or moved to the notification area, processing continues normally.

A watchdog supervises the background process and restarts it if necessary. If processing shows no sign of life for an unusually long time, the program reports a malfunction.

For operation without a logged-in user (servers, continuous operation), processing can instead be handled by a Windows service - see section 60.1.4.

60.1.2 When is processing active?

State Processing
Main window visible, minimized, or in the notification area Runs (at the configured check interval, see chapter 40.6.2)
Program closed via Exit Stopped - on the next start, new files in the monitored folders are picked up
Outside the time window (see chapter 40.6.3) Paused until the next window

Recommendation for continuous operation: In the program options, enable Start program with Windows as well as Move to the notification area on startup/close (see chapter 40.5.3) - processing then runs unobtrusively all the time.

60.1.3 Behavior after pauses

After a restart, computer standby, or the end of a time window, the program automatically processes files that arrived in the monitored folders in the meantime - files are not lost due to pauses. Only the pre-existing contents of a newly added folder are deliberately not processed automatically (see chapter 8.8.4); use catch-up processing for that (see chapter 60.2).

60.1.4 Running as a Windows service (external processor)

For servers and continuous operation without a logged-in user, processing can be handled by a Windows service. This uses the program AXPProcessor.exe in the installation folder with the --service parameter; the main window is then only opened for configuration and to check the logs.

Important - same user account: set up the service with the user account you also use to configure the main program (in the service management console under “Log on as”; not “Local System”). Settings, profiles, logs, and the status display are tied to the user account - if the main window and the service run under different accounts, they cannot see each other.

Setup in the program (recommended): open Options → Windows Service and click Set up service… - after you enter the service name, user account, and password, the program creates the service with a single administrator confirmation, including automatic startup, recovery after a crash, and the “Log on as a service” right (see chapter 40.7).

Manual setup (command prompt as administrator; adjust path and account - sc.exe requires a space after binPath=, obj=, and password=):

sc.exe create "AXP2Service" binPath= "\"C:\Program Files\Automatic X-Invoice Processor 2\AXPProcessor.exe\" --service"
sc.exe config "AXP2Service" obj= ".\YourAccount" password= "YourPassword"

Then enable the option Background processor is managed externally (e.g. as a Windows service) under Options → Windows Service (see chapter 40.7). The same page shows the live status of the service and offers to start it right away and set it to start automatically - including automatic recovery after a service crash; a single administrator confirmation is all it takes. If a manually created service points to the wrong program file, the page reports this and puts it right via Correct.

Two processes are normal: in service operation, two AXPProcessor.exe processes run by design - a supervisor (the actual service) and a worker process that performs the processing. If a file gets permanently stuck (see chapter 40.6.2), only the worker process is replaced and processing continues without intervention; the affected file is logged as an error.

Diagnostics: startup messages and operational events are written to the file ServiceDiagnostics.log in the application data folder of the service account (%AppData%\Automatic X-Invoice Processor 2\). The regular processing and error logs appear in the main window as usual.

Recommended - malfunction notification: for unattended operation, enable the malfunction notification (Options → Processing, see chapter 40.6.6) - the supervisor process then sends an email as soon as processing stalls for longer than the configured time span; the message additionally appears in the error log and the Windows Event Viewer.

Alternative without a service: AXPProcessor.exe --headless runs processing as a standalone console process (e.g. via the Windows Task Scheduler). Further parameters: --profile "Name" restricts processing to individual profiles (can be specified multiple times), --quit stops running instances.