JobRouter® is a scalable digitalisation platform which links processes, data
and documents. The TYPO3 extension JobRouter Base acts as a base library
for the TYPO3 JobRouter extensions:
The correlation ID is generated from the form identifier and a unique key
to identify associated transfers – as you can start multiple instances from one
form and transmit data to a JobData table. The correlation ID is stored in a
column in the transfer tables together with the form data. This is useful if you
want to check the data from the instance against the original data from the
form.
The correlation ID looks like this: form_demo-20_63fca23b1accb where form
indicates the ID is generated by a from finisher, demo-20 is the form
identifier with the content element uid of the form plugin and 63fca23b1accb
is the unique key.
Use the
{__correlationId} variable to add the correlation ID.
Note
The correlation ID is the same for every JobRouter form finisher in a form
instance.
Tip
The correlation id can be used to set the initiator for a process instance
start (if the initiator is not used to assign a step to a JobRouter® user).
This way the correlation id is easy to spot in the step overview.
Localisation labels
Values can be localised with the help of the localisation labels known from
various parts in TYPO3. The variable starts with
{__LLL: and holds
the path to the translation file and the according key, for example,
{__LLL:EXT:your_ext/Resources/Private/Language/locallang.xlf:your.label}.
If the label is not found and therefore cannot be translated the value is
untouched.
You can use multiple localisation labels in one form value.
Language information
The language information defined in the Site Configuration can be used, namely:
{__language.base}
The base URL for the language, for example, https://example.org/en/.
{__language.flagIdentifier}
The defined TYPO3 flag identifier used in TYPO3's backend, for example,
flags-gb.
{__language.hreflang}
Language tag for the language defined by RFC 1766 / 3066 for langhreflang attributes, for example, en-gb.
{__language.languageId}
The language ID defined in the site configuration.
The navigation title defined in the site configuration, used as label
within language menus, for example, English.
{__language.title}
The title defined in the site configuration, for example, English.
{__language.typo3Language}
default for English, otherwise one of TYPO3's internal language keys.
Multiple language variables can be used in one form value.
JobRouter language information
Sometimes it is necessary to use not the language code of the page in your form
but instead the language string JobRouter® uses (for example, german instead
of de). This can be useful for sending localised emails from the process in
the relevant language.
Use the
{__jobRouterLanguage} variable for that. The following languages
are supported by JobRouter® in recent version:
ISO 639-1 code
JobRouter® language
ar
arabic
cs
czech
da
danish
de
german
en
english
es
spanish
fi
finnish
fr
french
hr
croatian
hu
hungarian
it
italian
ja
japanese
lt
lithuanian
nl
dutch
pl
polish
pt
portuguese
ro
romanian
ru
russian
sk
slovak
sl
slovenian
sr
serbian
tr
turkish
uk
ukrainian
zh
chinese
If the language is not available, an empty string is returned by the variable
resolver.
Page properties
The properties of the page where the form is located can be retrieved. The
variable starts with __page.. Any existing page property, such as uid or
title, can be used, for example: {__page.title}.
If a page property is not present, the variable is used unchanged.
With variables it is possible to add
information to a process start which is resolved when submitting a form. This
extension ships some variable resolvers already, for example, for translation or
language information.
You can write your own variable resolvers dependent on your needs. Variable
resolvers are implemented as PSR-14 event listeners.
The event listener receives the event
\JobRouter\AddOn\Typo3Base\Event\ResolveFinisherVariableEvent. It
provides the following methods:
Get the field type, like
FieldType::Text for text or
FieldType::Integer for int. Have a look in the class
\JobRouter\AddOn\Typo3Base\Enumeration\FieldType for the available
field types.
getValue(): string
getValue(): string
Get the current value of the field. One or more variables can be defined
inside.
setValue(string $value): void
setValue(string $value): void
Set the new value after resolving one or more variables.
getCorrelationId(): string
getCorrelationId(): string
Get the current correlation ID.
getFormValues(): array
getFormValues(): array
Get the form values, for example,
['company' => 'Acme Ltd.', 'name' => 'John Smith'].
Some variable resolvers are already shipped with the extension. Have a look
into the folder Classes/Domain/VariableResolver for implementation
details.
Example
As an example we want to resolve a variable to a cookie value with an event
listener: