Add / Edit Batch Process

Navigation

To create a batch processing, follow this path:
Navigation bar → Settings → Batch processing → Create Batch processing

Batch processing is an optional add-on module of the LDB.


Overview

Batch processing automatically performs a defined action on many data records, one after the other. Which actions (create, sign, ...) are available depends on the datatype (sample, report, ...):

  • Samples: Create report for sample
  • Orders: Create report for order
  • Reports: Sign Reports, Send Reports by e-mail or Send Reports via SMS
  • All datatypes: Execute query report with SFTP export, HTTP PUSH or import interface

Each data record is logged as a separate entry with a status (open, done, failed) and a message.

Setting up a batch processing involves the following steps:

  1. Create the batch processing
  2. Create the introductory query report and link it to the batch processing
  3. Create the processing query report (only for the actions Execute query report with SFTP export / HTTP PUSH / import interface)
  4. Test and monitor

Create Batch processing

Step 1:

Enter basic data

The fields of the Create Batch processing form are described below:

image

Figure: Create Batch processing form, using the action "Create report for sample" as an example

  • Name: Enter a unique name. The name will later appear as a menu item in the introductory query report.
  • Datatype: Select Reports, Samples or Orders. The datatype determines which actions can be selected and which links the introductory query report must return.
  • Action: Select what should happen to each data record. Actions that do not match the datatype are greyed out.
  • Query report: Only displayed for Execute query report with SFTP export / HTTP PUSH / import interface. Select the processing query report (see Step 3).
  • PDF-Template: Only displayed for Create report for sample or Create report for order. PDF templates of type Report are available for selection.
  • Signature: Only displayed for Sign Reports. Signatures that are neither deleted nor archived are available for selection.
  • Remark: Optional. Internal information; it is displayed below the name in the overview.

Action-dependent mandatory fields

Which additional fields are mandatory and how the data records are processed depends on the selected action. The following overview describes the available actions per datatype:

image

Figure: Options in the Action field for the datatype Samples

Create report for sample / Create report for order (datatype Samples or Orders)

  • A report is created for each sample or order.
  • The PDF-Template used to create the report is mandatory.

Sign Reports (datatype Reports)

  • Each report is signed with the selected signature. The Signature is therefore mandatory.
  • Note: The checks from the signing dialog are skipped.

Send Reports by e-mail (datatype Reports)

  • The e-mail address is not taken from the customer or order, but from the sample field Email (DDF_Email) of the first sample of the report.
  • Exactly one e-mail with the report PDF attached is sent per report.
  • Sender, subject and text are taken from the system settings (E-Mailversand: From, E-Mailversand: Betreff, E-Mailversand: Text).
  • Note: If the Email field is empty, the entry fails with the message "E-Mailadresse fehlt" (e-mail address missing).

Send Reports via SMS (datatype Reports)

  • The phone number is taken from the sample field Telefon (DDF_Telefon) or Telephonnr (DDF_Telephonnr) of the first sample of the report.
  • No PDF is sent, but the text from the system setting SMS Text für Berichtsbenachrichtigung, optionally with a link to the report.
  • Note: If no phone number is entered for the first sample, no SMS is sent and the entry is marked as failed.

The following placeholders can be used in the SMS text:

  • SampleNAME_: Sample name
  • SampleCREATED_: Creation date of the sample
  • SampleDDF_VORNAME_: First name from the sample field
  • SampleDDF_NACHNAME_: Last name from the sample field
  • ReportURL_: Link to the report. The SMS only contains a link via this placeholder. The link opens the report without login and is valid for 30 days from the report date. If a date of birth is entered for the sample, the recipient must enter it first.
  • SampleRESULT_: Currently only suitable for certain positive/negative tests (originally developed for COVID-19 tests).

Execute query report with SFTP export / HTTP PUSH / import interface (all datatypes)

  • A second, processing query report is executed for each data record.
  • Selecting this query report is mandatory. How it must be structured is described in Step 3.

Step 2:

Create and link the introductory query report

The introductory query report returns the data records that are passed to the batch processing and processed there.
Batch processing does not check whether a report has already been signed or sent. No password is requested when signing. Therefore, exclude reports that have already been signed or sent in the introductory query report.

** Note:** Each row must contain exactly one link to the datatype of the batch processing (see the following table).
The column name can be chosen freely; all other columns are optional and are ignored during processing.

Datatype Mandatory column
Reports CONCAT('link==../reports/view/', reports.id, '==', reports.name)
Samples CONCAT('link==../samples/view/', samples.id, '==', samples.name)
Orders CONCAT('link==../orders/view/', orders.id, '==', orders.name)

Exclude data records that have already been attached

The LDB stores which data records have already been passed to a batch processing. Use this information in the introductory query report so that only new data records are passed.

Note: Without this exclusion, the same data records are passed again on every run with the trigger every 10 minutes, e.g. reports are created multiple times or e-mails are sent multiple times. Make sure that the ID in the query report matches the linked batch processing.

How to proceed:

  • Determine the ID of your batch processing. It appears in the detail view of a saved batch processing as a number at the end of the browser address bar, e.g. https://labordatenbank.com/demo/batchprocesses/view/1 → ID 1.
  • Copy the following two lines into your query report and replace the 1 with your ID:

LEFT JOIN batchprocessitems ON batchprocessitems.item_id = samples.id AND batchprocessitems.batchprocess_id = 1
AND batchprocessitems.item_id IS NULL

  • For reports, replace samples.id with reports.id; for orders, with orders.id.

Example (datatype Samples, batch processing with ID 1, action Create report for sample):

SELECT
CONCAT('link==../samples/view/', samples.id, '==', samples.name) AS 'Sample'

FROM samples
LEFT JOIN reports_samples ON reports_samples.sample_id = samples.id
LEFT JOIN batchprocessitems ON batchprocessitems.item_id = samples.id AND batchprocessitems.batchprocess_id = 1

WHERE samples.visible_to != 'deleted'
AND reports_samples.report_id IS NULL # no report created yet
AND batchprocessitems.item_id IS NULL # not yet in this batch processing
LIMIT 1000;

Link to the batch processing

image

Figure: Linking the introductory query report to the batch processing

  • Open the introductory query report under: Edit query report → Interfaces → section Batch processing
  • Batch processing: Select the batch processing created in Step 1.
  • attach Data records to Batch processing: Select manually for testing, then every 10 minutes if required (Enterprise Cloud only).

Step 3:

Create the processing query report

This step is only required for the actions Execute query report with SFTP export / HTTP PUSH / import interface. Two query reports are needed here:

  • The introductory query report (Step 2) determines which data records enter the batch processing. It is mandatory here as well.
  • The processing query report is selected in the batch processing in the Query report field and determines what is transferred per data record.

Requirements for the processing query report:

  • The ID of the data record is passed as variable 0. Variable 0 must therefore be defined, e.g. WHERE samples.id IN (_VAR0_).
  • The SFTP server, HTTP URL or import interface is configured in this query report.
  • The processing query report is not linked to the batch processing. The Batch processing section under Interfaces remains empty.

How the result is transferred depends on the action:

HTTP PUSH

  • The result is sent as JSON, one object per row with the column names as keys.
  • A link== value is shortened to its display text. If the recipient needs the ID, output it as a separate column.
  • The entry is successful if the recipient responds with HTTP status 2xx.

Further information: Export data from query reports, section HTTP PUSH

Import interface

  • By default, the result is passed to the import interface as CSV.
  • The column names must exist in the import mapping of the import interface.

Further information: Import Interfaces Overview

SFTP

  • With SFTP, a file is uploaded to a server you specify.
  • The type of file to be uploaded is set in the processing query report. The entry is considered successful once the file has been uploaded.

Further information: Export data from query reports, section SFTP


Step 4:

Test and monitor

  • Open the introductory query report and attach the data records manually via the menu item bearing the name of the batch processing. (This menu item appears as soon as you have linked the batch processing to the introductory query report as described in Step 2.)
  • Open the batch processing and click execute now for an open entry. Check the message in the Status column.
  • Failed entries are not repeated automatically. Restart them in the detail view of the batch processing with execute again. Entries that are done cannot be restarted.
  • Use triggered manually in the overview to process all open entries immediately.
  • Then switch the trigger in the introductory query report to every 10 minutes if required.
  • In the detail view, you can filter by done, failed and in progress (including open entries). Delete all entries of this batch processing removes all entries.

Our recommendation: Test every new batch processing first with the trigger manually and individual entries before activating automatic processing.


Process flow and limits

  • A maximum of 1,000 open entries are processed per run (demo system: 100), for no longer than about 120 seconds. The remaining entries follow in the next run.
  • You can see in the overview whether the automatic run is active for your instance: If the sentence "Batch processing runs automatically every 2 minutes and processes open entries." is struck through, open entries are only processed manually. Contact your customer support if the automatic option is not yet active (requires Enterprise cloud).
  • A batch processing cannot be deleted, only its entries.

Practical example: Transferring samples via HTTP PUSH

For each new sample with the description "HR", the sample data is to be sent individually as JSON to an external web service.

1. Create the processing query report

Follow this path: Navigation bar → Settings → Query reports → Create query report

This query report takes the data from the batch processing and performs the selected action. It is called individually for each open entry and receives the sample ID as variable 0.

SELECT
samples.id AS 'ID',
samples.name AS 'Sample',
samples.description AS 'Description'
FROM samples
WHERE samples.visible_to != 'deleted'
AND samples.id IN (_VAR0_);
  • Define variable 0.
  • In the Interfaces tab under HTTP PUSH, enter the target URL. Further information: Export data from query reports, section HTTP PUSH
  • Do not link it to the batch processing.

2. Create the batch processing

Follow this path: Navigation bar → Settings → Batch processing → Create Batch processing

  • Datatype: Samples
  • Action: Execute query report with HTTP PUSH
  • Query report: the processing query report from step 1

image

Figure: Create Batch processing


3. Create the introductory query report

Follow this path: Navigation bar → Settings → Query reports → Create query report

SELECT
CONCAT('link==../samples/view/', samples.id, '==', samples.name) AS 'Sample',
samples.description AS 'Description'
FROM samples
LEFT JOIN batchprocessitems ON batchprocessitems.item_id = samples.id AND batchprocessitems.batchprocess_id = 1
WHERE samples.visible_to != 'deleted'
AND batchprocessitems.item_id IS NULL # not yet in this batch processing
AND samples.description = 'HR'
ORDER BY samples.date DESC
LIMIT 1000;
  • Under Edit query report → Interfaces → Batch processing, select the batch processing from step 2.
  • attach Data records to Batch processing: manually for testing, then every 10 minutes if required.

image

Figure: Linking the introductory query report to the batch processing


4. Test

  • Open the introductory query report and pass the samples by clicking the menu item bearing the name of the batch processing.

image

Figure: Passing samples to the batch processing

  • In the batch processing overview, click the number of currently open entries shown in the open column, then click execute now.

image

Figure: Triggering processing individually

  • If the response has HTTP status 2xx, the entry is successful. Otherwise, the entry shows the error code and, if available, the recipient's response.

image

Figure: Transmission status


Edit Batch processing

  • Open the overview under: Navigation bar → Settings → Batch processing
  • Click the pencil icon next to the desired batch processing.
  • Alternatively: Click the name highlighted in blue to open the detail view, then click Edit Batch processing.

image

Figure: Edit Batch processing


Delete Batch processing

  • A batch processing cannot be deleted, only its entries.

Related Topics:

Last change: 11/26/26

General information

Client zone (optional)

8D-report

Supplier evaluation

Material

Employees

Customers

Orders

Samples

PDF templates

Assets

Recipes

Reports

Report table editor

Interfaces

AI functions

Introductory phase

Query reports

Templates

Offers

Invoices

Parameters

Calculating with parameters

Webservices

Transformationscode

Test plans / limit values / specifications

Documents control

Questions and answers

Equipment

Trainings

Others

File management

Processes

We use our own cookies and third-party cookies so that we can display the website to you and better understand how you use it, in order to improve the services we offer.