ComposantsComponents › Logs & ErreursLogs & Errors
Vérifie une condition Java et envoie le résultat, Ok ou Failed, aux tAssertCatcher du job. Il n'arrête rien : que la condition soit vraie ou fausse, le job continue et se termine avec le code 0. Sans tAssertCatcher dans le job, il ne fait rien du tout. À choisir pour contrôler un résultat (nombre de lignes, total, fichier produit) et en garder la trace.
Checks a Java condition and sends the result, Ok or Failed, to the tAssertCatcher components of the job. It stops nothing: whether the condition is true or false, the job goes on and ends with code 0. Without a tAssertCatcher in the job, it does nothing at all. Choose it to check a result (row count, total, produced file) and keep a record of it.
EntréeInput
Aucune : il peut commencer un sous-job. Sinon un lien Main (une vérification par ligne) ou Iterate (une par itération). None: it can start a subjob. Otherwise one Main link (one check per row) or Iterate link (one per iteration).
SortieOutput
Le résultat ne sort pas par un lien : il arrive dans le tAssertCatcher. Le composant n'a pas de schéma ; placez-le en fin de flux. The result does not leave through a link: it arrives in the tAssertCatcher. The component has no schema; place it at the end of a flow.
DéclencheursTriggers
On Subjob Ok On Subjob Error On Component Ok On Component Error Run if
En entrée comme en sortie. Une condition fausse n'est pas une erreur : c'est On Component Ok qui est suivi. As input and as output. A false condition is not an error: On Component Ok is the one followed.
L'expression lit une variable globale du traitement, par exemple ((Integer) globalMap.get("tDBOutput_1_NB_LINE")) > 0. Le tAssertCatcher est posé à part, sans lien avec le reste.
The expression reads a global variable of the processing, for example ((Integer) globalMap.get("tDBOutput_1_NB_LINE")) > 0. The tAssertCatcher is placed apart, with no link to the rest.
L'expression et la description peuvent lire la ligne reçue : row1.amount > 0. Le tAssertCatcher reçoit un message par ligne, vraie ou fausse.
The expression and the description can read the received row: row1.amount > 0. The tAssertCatcher receives one message per row, true or false.
boolean, sans point-virgule. Donnez une Description entre guillemets, qui dira dans le journal ce qui a été vérifié.
Write the expression: a Java expression of type boolean, without a semicolon. Give a description in quotes, which will tell in the log what was checked.
Les libellés sont ceux de l'onglet Composant (en anglais, ils sont écrits en minuscules) ; le nom technique, en gris, est celui du paramètre dans le fichier du job. Le composant n'a pas de paramètres avancés propres, seulement la case Statistiques du tStatCatcher commune à tous les composants (voir tStatCatcher). Labels are those of the Component tab (written in lower case in English); the technical name, in grey, is the parameter name in the job file. The component has no advanced settings of its own, only the tStatCatcher Statistics box shared by all components (see tStatCatcher).
| ParamètreSetting | DéfautDefault | VisibleShown | Description |
|---|---|---|---|
| DescriptiondescriptionDESCRIPTION | "" |
ToujoursAlways |
Expression Java de type String, recopiée dans la colonne description du tAssertCatcher. Elle peut lire la ligne reçue ou une variable : "Amount of " + row1.name. Gardez au moins "" : un champ tout à fait vide empêche le job de compiler (voir Pièges).
Java expression of type String, copied to the description column of the tAssertCatcher. It can read the received row or a variable: "Amount of " + row1.name. Keep at least "": a completely empty field prevents the job from compiling (see Pitfalls).
|
| ExpressionexpressionEXPRESSION | videempty | ToujoursAlways |
Obligatoire. Expression Java de type boolean, recopiée telle quelle dans un if (…) : pas de point-virgule. Vraie : statut Ok. Fausse : statut Failed. Elle est évaluée à chaque passage (une fois, ou une fois par ligne ou par itération).
Required. Java expression of type boolean, copied as is into an if (…): no semicolon. True: status Ok. False: status Failed. It is evaluated at each pass (once, or once per row or per iteration).
|
| Expression | status |
substatus |
|---|---|---|
| vraietrue | Ok | -- |
| faussefalse | Failed | Test logically failed |
La colonne origin reçoit le nom du composant (tAssert_1) et description la Description. Les autres colonnes sont décrites sur la page du tAssertCatcher.
The origin column receives the name of the component (tAssert_1) and description the description. The other columns are described on the tAssertCatcher page.
Pour chaque tAssertCatcher du job dont la case Capturer les tAssert est cochée, le message est ajouté puis le sous-job du tAssertCatcher est exécuté aussitôt : For each tAssertCatcher of the job whose Catch tAssert box is checked, the message is added, then the subjob of the tAssertCatcher is run at once:
if(((Integer) globalMap.get("count")) > 0) {
tAssertCatcher_1.addMessage(pid, projectName, jobName, "java",
"tAssert_1", "Ok", "--", "At least one row");
tAssertCatcher_1Process(globalMap);
}else {
tAssertCatcher_1.addMessage(pid, projectName, jobName, "java",
"tAssert_1", "Failed", "Test logically failed", "At least one row");
tAssertCatcher_1Process(globalMap);
}
Le composant n'a pas de variable globale (RETURNS vide) : le résultat n'est lisible que par le tAssertCatcher.
The component has no global variable (empty RETURNS): the result can only be read through the tAssertCatcher.
Sorties copiées depuis une exécution de chaque job. Le tAssertCatcher est relié à un tLogRow en mode Table. Les colonnes moment (date et heure) et pid (identifiant tiré au hasard à chaque exécution) changent d'une exécution à l'autre ; project et job sont ceux du job d'essai.
Outputs copied from a run of each job. The tAssertCatcher is connected to a tLogRow in Table mode. The moment (date and time) and pid (identifier drawn at random for each run) columns change from one run to the next; project and job are those of the test job.
tJava_1 range 3 dans la variable count ; tJava_2 écrit End of job.
tJava_1 stores 3 in the count variable; tJava_2 writes End of job.
// tJava_1
globalMap.put("count", 3);
System.out.println("Loaded 3 rows");
// tAssert_1 — description: "At least one row"
((Integer) globalMap.get("count")) > 0
// tAssert_2 — description: "At most 2 rows"
((Integer) globalMap.get("count")) <= 2
Loaded 3 rows .-------------------+------+-------+------------+--------+---------+------+---------+----------------. | tLogRow_1 | |=------------------+------+-------+------------+--------+---------+------+---------+---------------=| |moment |pid |project|job |language|origin |status|substatus|description | |=------------------+------+-------+------------+--------+---------+------+---------+---------------=| |2026-11-18 14:32:16|DEjWwy|DEMO |JOB_DocLB_A1|java |tAssert_1|Ok |-- |At least one row| '-------------------+------+-------+------------+--------+---------+------+---------+----------------' .-------------------+------+-------+------------+--------+---------+------+---------------------+--------------. | tLogRow_1 | |=------------------+------+-------+------------+--------+---------+------+---------------------+-------------=| |moment |pid |project|job |language|origin |status|substatus |description | |=------------------+------+-------+------------+--------+---------+------+---------------------+-------------=| |2026-11-18 14:32:16|DEjWwy|DEMO |JOB_DocLB_A1|java |tAssert_2|Failed|Test logically failed|At most 2 rows| '-------------------+------+-------+------------+--------+---------+------+---------------------+--------------' End of job
Chaque tAssert produit son message au moment où il s'exécute : d'où deux tableaux, un par message. Après le Failed, le job continue (tJava_2 s'exécute) et se termine avec le code 0.
Each tAssert produces its message when it runs: hence two tables, one per message. After the Failed, the job goes on (tJava_2 runs) and ends with code 0.
Trois lignes name, amount : pen 12, ink -3, paper 40. Expression : row1.amount > 0 ; Description : "Amount of " + row1.name.
Three name, amount rows: pen 12, ink -3, paper 40. expression: row1.amount > 0; description: "Amount of " + row1.name.
.-------------------+------+-------+------------+--------+---------+------+---------+-------------. | tLogRow_1 | |=------------------+------+-------+------------+--------+---------+------+---------+------------=| |moment |pid |project|job |language|origin |status|substatus|description | |=------------------+------+-------+------------+--------+---------+------+---------+------------=| |2026-11-18 14:32:25|ief7BA|DEMO |JOB_DocLB_A4|java |tAssert_1|Ok |-- |Amount of pen| '-------------------+------+-------+------------+--------+---------+------+---------+-------------' .-------------------+------+-------+------------+--------+---------+------+---------------------+-------------. | tLogRow_1 | |=------------------+------+-------+------------+--------+---------+------+---------------------+------------=| |moment |pid |project|job |language|origin |status|substatus |description | |=------------------+------+-------+------------+--------+---------+------+---------------------+------------=| |2026-11-18 14:32:25|ief7BA|DEMO |JOB_DocLB_A4|java |tAssert_1|Failed|Test logically failed|Amount of ink| '-------------------+------+-------+------------+--------+---------+------+---------------------+-------------' .-------------------+------+-------+------------+--------+---------+------+---------+---------------. | tLogRow_1 | |=------------------+------+-------+------------+--------+---------+------+---------+--------------=| |moment |pid |project|job |language|origin |status|substatus|description | |=------------------+------+-------+------------+--------+---------+------+---------+--------------=| |2026-11-18 14:32:25|ief7BA|DEMO |JOB_DocLB_A4|java |tAssert_1|Ok |-- |Amount of paper| '-------------------+------+-------+------------+--------+---------+------+---------+---------------'
Un message par ligne, les lignes correctes comprises. Sur un grand flux, cela fait autant de lignes dans le journal que dans le flux : filtrez plutôt la sortie du tAssertCatcher sur status, ou vérifiez un total après le flux.
One message per row, the correct rows included. On a large flow, this gives as many log rows as flow rows: rather filter the tAssertCatcher output on status, or check a total after the flow.
Le premier job, sans le tAssertCatcher ni son tLogRow : The first job, without the tAssertCatcher and its tLogRow:
Loaded 3 rows End of job
Rien n'indique que la deuxième condition est fausse ; code de sortie 0. Même résultat avec un tAssertCatcher dont la case Capturer les tAssert est décochée. Nothing tells that the second condition is false; exit code 0. Same result with a tAssertCatcher whose Catch tAssert box is unchecked.
tJava_1 puis le tAssert « At most 2 rows », et deux tAssertCatcher, chacun vers un tLogRow en mode Simple : tJava_1 then the "At most 2 rows" tAssert, and two tAssertCatcher components, each to a tLogRow in Basic mode:
Loaded 3 rows 2026-11-18 14:32:51|5ZNHBu|DEMO|JOB_DocLB_A13|java|tAssert_1|Failed|Test logically failed|At most 2 rows 2026-11-18 14:32:51|5ZNHBu|DEMO|JOB_DocLB_A13|java|tAssert_1|Failed|Test logically failed|At most 2 rows
Chaque tAssertCatcher reçoit le message : l'un peut écrire dans la console, l'autre dans un fichier ou une table. Each tAssertCatcher receives the message: one can write to the console, the other to a file or a table.
tJava_1 ne range pas count ; l'expression ((Integer) globalMap.get("count")) > 0 convertit alors null en nombre. Trace abrégée :
tJava_1 does not store count; the expression ((Integer) globalMap.get("count")) > 0 then converts null to a number. Shortened trace:
count is not set Exception in component tAssert_1 (JOB_DocLB_A11) java.lang.NullPointerException: Cannot invoke "java.lang.Integer.intValue()" because the return value of "java.util.Map.get(Object)" is null at demo.job_doclb_a11_0_1.JOB_DocLB_A11.tAssert_1Process(JOB_DocLB_A11.java:650) … .-------------------+------+-------+-------------+--------+------+------+-------------------+------------------------------------------------------------------------------------------------------------. | tLogRow_1 | |=------------------+------+-------+-------------+--------+------+------+-------------------+-----------------------------------------------------------------------------------------------------------=| |moment |pid |project|job |language|origin|status|substatus |description | |=------------------+------+-------+-------------+--------+------+------+-------------------+-----------------------------------------------------------------------------------------------------------=| |2026-11-18 14:32:46|3GHi3M|DEMO |JOB_DocLB_A11|java |null |Failed|Job execution error|Cannot invoke "java.lang.Integer.intValue()" because the return value of "java.util.Map.get(Object)" is null| '-------------------+------+-------+-------------+--------+------+------+-------------------+------------------------------------------------------------------------------------------------------------'
Ce n'est plus un Failed du tAssert : c'est une erreur Java, et le job s'arrête avec le code 1. Le tAssertCatcher la reçoit quand même (case Capturer les exceptions Java), avec Job execution error et sans nom de composant. Écrivez une expression qui supporte null : globalMap.get("count") != null && ((Integer) globalMap.get("count")) > 0.
This is no longer a Failed from the tAssert: it is a Java error, and the job stops with code 1. The tAssertCatcher still receives it (Catch Java Exception box), with Job execution error and no component name. Write an expression that copes with null: globalMap.get("count") != null && ((Integer) globalMap.get("count")) > 0.
Un tAssert dont l'Expression est restée vide (sa valeur par défaut), dans un job qui a un tAssertCatcher : A tAssert whose expression was left empty (its default value), in a job that has a tAssertCatcher:
JOB_DocLB_A12.java:430: error: illegal start of expression
if() {
^
1 error
Le modèle remplace une Description tout à fait vide par null, que Java ne sait pas attribuer à l'une des deux méthodes addMessage (description ou exception). Message de compilation abrégé :
The template replaces a completely empty description with null, which Java cannot assign to one of the two addMessage methods (description or exception). Shortened compilation message:
JOB_DocLB_B1.java:652: error: reference to addMessage is ambiguous tAssertCatcher_1.addMessage(pid, projectName, jobName, "java", "tAssert_1", "Ok", "--", null); ^ both method addMessage(String,String,String,String,String,String,String,String) in AssertCatcherUtils and method addMessage(String,String,String,String,String,String,String,Exception) in AssertCatcherUtils match …
La valeur par défaut, "", compile : la colonne description est alors vide.
The default value, "", compiles: the description column is then empty.
Le job se termine avec le code 0 même si toutes les conditions sont fausses. Pour qu'un échec arrête le job, faites suivre le tAssertCatcher d'un tFilterRow sur status puis d'un tDie, ou testez la même condition dans un Run if vers un tDie.
The job ends with code 0 even if all the conditions are false. For a failure to stop the job, follow the tAssertCatcher with a tFilterRow on status then a tDie, or test the same condition in a Run if to a tDie.
Les messages du tAssert ne vont qu'aux tAssertCatcher. Le tLogCatcher reçoit ceux des tWarn et des tDie. The messages of the tAssert only go to the tAssertCatcher components. The tLogCatcher receives those of tWarn and tDie.
Le message ne contient ni l'expression ni les valeurs testées. Mettez-les dans la description : "Rows loaded: " + globalMap.get("tDBOutput_1_NB_LINE") + " (expected > 0)".
The message holds neither the expression nor the tested values. Put them in the description: "Rows loaded: " + globalMap.get("tDBOutput_1_NB_LINE") + " (expected > 0)".
Les variables NB_LINE ne sont remplies qu'à la fin du composant qui les produit : reliez le tAssert par On Subjob Ok ou On Component Ok, pas au milieu du flux qu'il contrôle.
The NB_LINE variables are only filled at the end of the component that produces them: connect the tAssert with On Subjob Ok or On Component Ok, not in the middle of the flow it checks.
tAssertCatcher · reçoit les messages du tAssert ; son schémareceives the messages of the tAssert; its schematLogRow · afficher les messages dans la consoleshow the messages in the consoletWarn · un message pour le tLogCatcher, sans arrêter le joba message for the tLogCatcher, without stopping the jobtDie · arrêter le job avec un code de sortiestop the job with an exit codetLogCatcher · le journal des tWarn, tDie et erreurs Javathe log of tWarn, tDie and Java errorstStatCatcher · début, fin et durée des composantsstart, end and duration of the components