Introduction 

JobRouter® is a scalable digitalisation platform which links processes, data and documents. The TYPO3 extension TYPO3 JobRouter Process connects JobRouter® processes with TYPO3.

What does it do? 

TYPO3 JobRouter Process is a TYPO3 extension for

  • Managing process links and step links to JobRouter® installations in a backend module
  • Providing a form finisher to start a process instance

This extension uses the JobRouter REST Client library and has the TYPO3 JobRouter Connector extension as a requirement to define connections to JobRouter® installations.

Current limitations 

  • Only process table fields can be used in the form finisher. Subtable fields are not handled by now.
  • Only text, integer and attachment types are available for process table fields in the process link configuration.

Release management 

This extension uses semantic versioning which basically means for you, that

  • Bugfix updates (for example, 1.0.0 => 1.0.1) just includes small bug fixes or security relevant stuff without breaking changes.
  • Minor updates (for example, 1.0.0 => 1.1.0) includes new features and smaller tasks without breaking changes.
  • Major updates (for example, 1.0.0 => 2.0.0) includes breaking changes which can be refactorings, features or bug fixes.

The changes between the different versions can be found in the changelog.

Installation 

Target group: Administrators

Requirements 

Version matrix 

JobRouter Process PHP TYPO3
4.0 8.1 - 8.4 12.4 / 13.4
3.0 8.1 - 8.3 11.5 / 12.4
2.0 8.1 - 8.3 11.5 / 12.4
1.2 7.4 - 8.2 10.4 / 11.5
1.1 7.3 - 8.1 10.4 / 11.5
1.0 7.2 - 7.4 10.4

Installation via Composer 

The recommended way to install this extension is by using Composer. In your Composer-based TYPO3 project root, just type:

composer req jobrouter/typo3-process
Copied!

The extension offers some configuration which is explained in the Configuration chapter.

Installation in the extension manager 

You can also install the extension from the TYPO3 Extension Repository (TER).

Configuration 

Target group: Administrators

Table of Contents

Extension configuration 

To configure the extension, go to Admin Tools > Settings > Extension Configuration and click on the Configure extensions button. Open the jobrouter_process configuration:

Options in the extension configuration

Options in the extension configuration

Encryption 

Encrypt transfer data 

If activated, the fields processtable and summary are encrypted for enhanced security in the transfer table when using the Preparer class or the JobRouterStartInstance form finisher.

Logging 

If logging is necessary to track process instance starts and possible warnings or errors, you can set up log writers depending on your needs.

Example: To log all warnings and higher levels of this extension into a file, add this snippet to the ext_localconf.php file of your site package extension:

EXT:my_sitepackage/ext_localconf.php
use Psr\Log\Level;
use TYPO3\CMS\Core\Log\Writer\FileWriter;

$GLOBALS['TYPO3_CONF_VARS']['LOG']['JobRouter']['AddOn']['Typo3Process']['writerConfiguration'][Level::WARNING] = [
   FileWriter::class => [
      'logFileInfix' => 'jobrouter_process'
   ]
];
Copied!

The messages are then written to the var/log/typo3_jobrouter_process_<hash>.log file.

Commands 

Target group: Administrators

Table of Contents

Surely you want to execute the commands regularly. Simply set up cron jobs that will execute the commands regularly, for example, once an hour or once a day, depending on your needs.

Starting instances 

If you rely on the form finisher or use the transfer table directly to start instances in JobRouter® installations, you have to use the start command in the project directory:

vendor/bin/typo3 jobrouter:process:start
Copied!
php public/typo3/sysext/core/bin/typo3 jobrouter:process:start
Copied!

In general you should receive a successful answer:

[OK] 18 incident(s) started successfully
Copied!

If an error occurs, the command issues a warning:

[WARNING] 4 out of 11 incident(s) had errors on start
Copied!

Other process starts are not affected by an error in one start. According to your logging configuration, the error is also logged.

The last run of the command is displayed in the system information toolbar (Last Instance Start):

System information with last run of the start command

System information with last run of the start command

Clean up transfers 

Changed in version

The default value for the "ageOfDays" option has been lowered from 30 days to 7 days.

After successfully starting instances from the transfer table, these transfers are marked as successful. They may contain sensitive data and should be deleted regularly. A command is available for this task. Enter in the project directory:

vendor/bin/typo3 jobrouter:process:cleanuptransfers
Copied!
php public/typo3/sysext/core/bin/typo3 jobrouter:process:cleanuptransfers
Copied!

In general you should receive a successful answer:

[OK] 42 successful transfers older than 7 days deleted
Copied!

By default, successful transfer records that are older than 30 days are deleted. You can adjust this value by adding an argument to the command:

vendor/bin/typo3 jobrouter:process:cleanuptransfers 14
Copied!
php public/typo3/sysext/core/bin/typo3 jobrouter:process:cleanuptransfers 14
Copied!

Now successful transfer records that are older than 14 days are deleted. If you use 0 as argument, all successful transfers are deleted.

Module 

Target group: Integrators, Administrators

The links to processes and instances in JobRouter® installations are managed in the module JobRouter > Processes.

On your first visit after installing the extension you will see the following screen:

Initial Process module screen

Initial Process module screen

First you have to define a process link. It is the representation of a JobRouter® process. Then configure the step links you need. These represent the steps of a process and are used in the form finisher.

Form finisher 

Target group: Integrators, Developers

Configuring JobRouter® 

Before you can start instances successfully you have to configure your JobRouter® installation to execute steps automatically. The command for starting instances only saves the step. To send the step you need a JobRobot configuration and add the robot user to the Job Function of the start step.

  1. Configure JobRobot module

    If you haven't an activated JobRobot configuration create a new user in your JobRouter® installation and configure it under System > Configuration > Modules > JobRobot. You see the following screen:

    JobRobot configuration

    JobRobot configuration

    After activating and saving the form the JobRobot user is available.

  2. Add JobRobot user to Job Function of start step

    Then add the robot user to the Job Function of the start step. It can then look like this:

    Robot user in Job Function of start step

    Robot user in Job Function of start step

Start instances 

Changed in version 4.0

The "type" option has been removed as it serves no purpose anymore.

A form finisher JobRouterStartInstance is available to start a JobRouter® process instance. After submitting a form, the form values are stored in a transfer table. A command, hopefully executed regularly, takes these transfer records and start a process instance. This is due the fact, that a JobRouter® installation can temporarily not available due to maintenance or network problems. Also the submitting of a form on the website should be as fast as possible for a good user experience.

Start one instance 

So, let's start with an example. The form finisher is defined in the YAML configuration of the specific form:

finishers:
   -
      identifier: JobRouterStartInstance
      options:
         handle: 'start_website_contact'
         summary: 'Demo Contact'
         # It is important to add the JobRobot username.
         # The concrete name depends on your configuration above,
         # we assume "robot" here:
         username: 'robot'
         processtable:
            name: '{preName} {lastName}'
            company: '{company}'
            email_address: '{email}'
            phone_number: '{phone}'
            message: '{message}'
            form_identifier: 'www.example.com/demo'
Copied!

As you can see, you can define some options. These are:

  • handle (required): The step handle defined in the Processes module.
  • summary: The summary of the instance.
  • initiator: The initiator of the instance.
  • username: The username the instance should be assigned to.
  • jobfunction: The Job Function the instance should be assigned to.
  • priority: The priority of the instance (number between 1 and 3).
  • pool: The pool of the instance (positive number).
  • processtable: You can map the form fields to the process table fields. As you can see in the example above, you define the process table field as the key (for example, email_address) and then map it with the to the form field identifier which is enclosed in curly brackets (for example, {email}). You can also set a static value, combine a static value with a form field or map multiple form fields to a process table field.

Start multiple instances 

It is also possible to start multiple instances – even on different JobRouter® installations. Just use the array notation in options:

finishers:
   -
      identifier: JobRouterStartInstance
      options:
         -
            handle: 'start_website_contact'
            summary: 'Demo Contact'
            username: 'robot'
            processtable:
               name: '{preName} {lastName}'
               company: '{company}'
               email_address: '{email}'
               phone_number: '{phone}'
               message: '{message}'
               form_identifier: 'www.example.com/demo'
         -
            handle: 'collect_anonymous_messages'
            summary: 'Demo Contact'
            username: 'robot'
            processtable:
               ANON_MESSAGE: '{message}'
               FROM_URL: 'https://www.example.com/demo'
Copied!

Attachments 

New in version 2.0.0

One or more attachments (files) can be added to a form and processed with the JobRouterStartInstance form finisher. By default, the files are stored in the first file storage 1:/user_upload/, for example fileadmin/user_upload, but can be overwritten in your form configuration, for instance:

renderables:
  -
    # ...
    renderables:
      -
        properties:
        saveToFileMount: '3:/my_form_uploads/'
        allowedMimeTypes:
          - application/pdf
        type: FileUpload
        identifier: the_pdf_file
        label: 'The PDF file'
Copied!

In this example, the files are stored in the file storage with the ID 3, and there in a folder named my_form_uploads.

When running the "clean up transfers" command, the files are deleted alongside the according transfer records.

Variables 

You can use variables in the common parameters, such as summary or initiator, and in the process table fields.

For more information have a look into the available variable resolvers. You can also write your own variable resolvers.

Dashboard widgets 

Target group: Editors, Integrators, Administrators

Changed in version 4.0

The widgets "Instance Starts" and "Instance Start Types" have been removed. Use a web analytics tool instead.

Table of Contents

With the dashboard system extension installed, some widgets can be used to display process information. You can find them in the Add widget wizard in the JobRouter section:

Add JobRouter widgets

Add JobRouter widgets

Instance start status 

The status of the instance starts can be shown with this widget:

Instance Start Status widget

Instance Start Status widget

Instance start errors 

If errors occur when starting an instance, they can be displayed with this widget:

Instance Start Error widget

Instance Start Errors widget

Developer corner 

Target group: Developers

Table of Contents

Start instances 

Sometimes it is necessary to start instances in a JobRouter® installation programmatically. An API and a start command are available for this use case.

Instances are started asynchronously when submitting a form and using the form finisher since a JobRouter® installation may be unavailable or in maintenance mode and to avoid long page loads. Let's take a look at the flow:

Transferring data sets

Transferring data sets

As you can see from the diagram, you can prepare multiple instances. The different instances can be started on different JobRouter® installations – depending on the configuration of the step link in the Process module.

Preparing the instance data 

If you want to start instances programmatically in a JobRouter® installation, you can use the Preparer class within TYPO3, for example in an Extbase controller:

EXT:my_extension/Controller/MyController.php
<?php
declare(strict_types=1);

namespace MyVendor\MyExtension\Controller;

use JobRouter\AddOn\Typo3Process\Domain\Dto\Transfer;
use JobRouter\AddOn\Typo3Process\Domain\Repository\StepRepository;
use JobRouter\AddOn\Typo3Process\Exception\PrepareException;
use JobRouter\AddOn\Typo3Process\Transfer\Preparer;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;

final class MyController extends ActionController
{
   public function __construct(
      private readonly Preparer $preparer,
      private readonly StepRepository $stepRepository,
   ) {
   }

   public function myAction()
   {
      // ... some other code

      // First get the step link uid from the step handle.
      // It is advised to use the handle because the step link uid can differ
      // from development to production system (it is an auto increment).
      $step = $this->stepRepository->findByHandle('your_step_handle');

      // Define the transfer DTO with your parameters
      // Have a look in the Domain\Dto\Transfer class to see the available setters
      $transfer = new Transfer(time(), $step->getUid(), 'my-correlation-id);
      $transfer->setType('Demo');
      $transfer->setSummary('My summary');
      $transfer->setProcesstable(
         \json_encode([
            'name' => 'John Doe',
            'company' => 'Acme Ltd.',
            'email_address' => 'jdoe@example.com',
            'message' => 'Please send me information.',
         ])
      );

      try {
         $this->preparer->store($transfer);
      } catch (PrepareException $e) {
         // On errors an exception can be thrown
         var_dump($e->getMessage());
      }
Copied!

The start command must be activated with a cron job to periodically start instances in the JobRouter® installation(s).

Upgrade 

Target group: Developers

From version 3.0 to 4.0 

Dashboard 

The dashboard widgets "Instance Starts" and "Instance Start Types" have been removed. If statistics are necessary, use Matomo, Google Analytics or another web analytics tool.

Form finisher 

The "type" option has been removed from the "JobRouterStartInstance" form finisher as it serves no purpose anymore.

Command 

The default value for the "ageOfDays" option in the Clean up transfers command has been lowered from 30 days to 7 days. If you rely on the 30 days, and haven't used the "ageOfDays" option before, you can set it explicitly:

vendor/bin/typo3 jobrouter:process:cleanuptransfers 30
Copied!
php public/typo3/sysext/core/bin/typo3 jobrouter:process:cleanuptransfers 30
Copied!

From version 2.0 to 3.0 

The namespace of the JobRouter TYPO3 Process classes have changed from

\Brotkrueml\JobRouterProcess
Copied!

to

\JobRouter\Addon\Typo3Process
Copied!

The easiest way to update your code to the new namespace is to use search/replace in your project.

The package name (used in composer.json) has changed from brotkrueml/jobrouter-typo3-process to jobrouter/typo3-process.

From version 1.x to version 2 

Version 2 of this extension introduced some breaking changes, notably:

  • The repository classes are no longer based on Extbase. They are now using the connection object or the query builder provided by TYPO3 and Doctrine DBAL.
  • The Extbase model classes are gone. Instead there are now immutable entity classes for process, processtablefield, step and transfer under the namespace \JobRouter\AddOn\Typo3Process\Domain\Entity. There are also no getters available anymore, instead use the public properties (which are readonly).

Changelog 

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Unreleased 

4.0.1 - 2025-05-22 

Fixed 

  • Finisher preset identified by "JobRouterStartInstance" could not be found

4.0.0 - 2024-10-01 

Added 

  • Compatibility with TYPO3 v13

Changed 

  • Default value of "ageOfDays" option in cleanup command lowered from 30 to 7 days

Removed 

  • Compatibility with TYPO3 v11
  • Widgets "Instance Starts" and "Instance Start Types"
  • "type" option from the "JobRouterStartInstance" form finisher

3.0.1 - 2024-06-06 

Fixed 

  • Closing edit view in backend shows empty page

3.0.0 - 2024-02-21 

Changed 

  • Require JobRouter REST Client in version 3
  • Namespace from Brotkrueml\JobRouterProcess to JobRouter\AddOn\Typo3Process

2.0.0 - 2023-05-31 

Added 

  • Allow attachment and date types for an instance start (#9)
  • Compatibility with TYPO3 v12

Changed 

  • Require JobRouter Client in version 2
  • Require JobRouter Connector extension in version 2
  • Require JobRouter Base extension in version 2
  • Models are no longer Extbase-based and are moved to the Domain/Entity namespace
  • Repositories are no longer Extbase-based

Removed 

  • Compatibility with TYPO3 v10 (#5)
  • Compatibility with PHP 7.4 and 8.0
  • Configuration of log writers in the extension configuration

1.2.0 - 2022-05-31 

Removed 

  • Compatibility with PHP 7.3

1.1.1 - 2022-05-20 

Fixed 

  • Database error in module DB Check > Records Statistics due to wrong label in TCA
  • Handle multibyte characters correctly when cutting string to specific length for transfer

1.1.0 - 2021-11-21 

Added 

  • Compatibility with TYPO3 v11 LTS
  • Possibility to refresh dashboard widgets (TYPO3 v11+ only)

Deprecated 

  • Configuration of log writers in the extension configuration

Removed 

  • Compatibility with PHP 7.2

1.0.0 - 2021-03-14 

Added 

  • Show number of days for available transfers in status widget

Fixed 

  • Set crdate in transfer table correctly

0.5.1 - 2021-03-07 

Added 

  • Dashboard widget "Instance Start Errors"

Changed 

  • Raise minimum required version to TYPO3 10.4.11

0.5.0 - 2020-10-19 

Changed 

  • Identifiers of widgets
  • Use log table from TYPO3 JobRouter Base extension
  • Rename "transfer identifier" to "correlation id" in transfer table

Fixed 

  • Differentiate between empty string and 0 in form finisher (integer field)
  • Consider maximum length of step parameters

0.4.1 - 2020-09-07 

Added 

  • Possibility to encrypt transfer data

0.4.0 - 2020-09-02 

Added 

  • Change/add description field for process/step record
  • JobRouter language variable resolver
  • Get form values from ResolveFinisherVariableEvent

Changed 

  • Rework "Instance Start Status" widget

Updated 

  • TYPO3 JobRouter Connector to version 0.11

Removed 

  • RestClientFactory is not available anymore, use from TYPO3 JobRouter connector extension instead
  • Default parameters in step record

Fixed 

  • Show disabled hint in list view
  • Resolve all form values in StartInstanceFinisher (also not available because of unfulfilled conditions)

0.3.0 - 2020-06-06 

Added 

  • Support for TYPO3 v10 LTS
  • Prepare for upcoming major PHP versions
  • Dashboard widget "Instance starts"
  • Dashboard widget "Instance start status"
  • Dashboard widget "Types of instance starts"
  • Identify types of transfers

Changed 

  • Rename DeleteOldTransfersCommand to CleanUpTransfersCommand

Removed 

  • Support for TYPO3 v9 LTS

0.2.2 - 2020-04-03 

Added 

  • Use toggle to display process table fields in module

Changed 

  • Throw exception when using undefined process table field

Fixed 

  • Assign correct value to process table field when using multi checkbox

0.2.1 - 2020-04-01 

Added 

  • Type to list of process table fields in module

Fixed 

  • Correct translation for frontend context

0.2.0 - 2020-03-30 

Changed 

  • Simplify configuration in form finisher

Fixed 

  • Shorten strings to the maximum length of process field in form finisher

0.1.1 - 2020-03-02 

Added 

  • Language variable resolver for form finisher
  • Localised label variable resolver for form finisher
  • Display last run of start command in system information toolbar

0.1.0 - 2020-02-24 

Initial pre-release