ComposantsComponents

ComposantsComponents › TechniqueTechnical

tArrayIn

tArrayIn

TechniqueTechnical masqué par défauthidden by default

Pièce interne des composants tIterateToFlow et tDenormalize : dans le code généré, chacun d'eux devient deux composants, dont un tArrayIn qui relit la liste de lignes rangée dans globalMap par le premier et l'envoie dans un flux. Déposé seul dans un job, même après un tArray, il ne fonctionne pas : prenez tIterateToFlow, ou tHashOutput et tHashInput. Internal part of the tIterateToFlow and tDenormalize components: in the generated code, each of them becomes two components, one of which is a tArrayIn that reads the list of rows stored in globalMap by the first one and sends it into a flow. Dropped alone in a job, even after a tArray, it does not work: take tIterateToFlow, or tHashOutput and tHashInput.

EntréeInput

Aucune : il commence son sous-job. Sinon un lien Iterate. None: it starts its subjob. Otherwise one Iterate link.

SortieOutput

Main un flux : les lignes de la listeone flow: the rows of the list

Déclencheurs en sortieOutput triggers

On Subjob Ok On Subjob Error On Component Ok On Component Error Run if

FonctionnementHow it works

Dans le jobIn the job

Iterate row1 (Main) tLoop_1 tIterateToFlow_1 tLogRow_1

Le job ne montre qu'un tIterateToFlow : il change chaque itération en une ligne du flux. The job only shows a tIterateToFlow: it turns each iteration into a row of the flow.

Dans le code généréIn the generated code

Iterate OnSubjobOk row1 (Main) tLoop_1 tIterateToFlow_1_ITFO tIterateToFlow_1_AI tLogRow_1

Le tIterateToFlow devient un tIterateToFlowOut (_ITFO), qui ajoute une ligne par itération à la liste globalMap.get("tIterateToFlow_1"), puis un tArrayIn (_AI) qui la lit une fois la boucle finie. The tIterateToFlow becomes a tIterateToFlowOut (_ITFO), which adds one row per iteration to the globalMap.get("tIterateToFlow_1") list, then a tArrayIn (_AI) which reads it once the loop is over.

Le tDenormalize suit le même schéma : un tDenormalizeOut prépare les lignes, puis un tArrayIn les envoie dans le flux. Dans les deux cas, le composant fixe lui-même l'Origine (son nom unique) et le schéma du tArrayIn. The tDenormalize follows the same pattern: a tDenormalizeOut prepares the rows, then a tArrayIn sends them into the flow. In both cases, the component sets the Origin (its unique name) and the schema of the tArrayIn itself.

Le tArrayIn attend une liste dont les éléments sont d'une classe nommée d'après son lien entrant et son Origine (OnSubjobOkStructtIterateToFlow_1 ici). Seuls les composants qui l'utilisent produisent une telle liste ; celle d'un tArray est faite d'objets d'une autre classe (row1Struct). The tArrayIn expects a list whose elements are of a class named after its incoming link and its Origin (OnSubjobOkStructtIterateToFlow_1 here). Only the components that use it produce such a list; the list of a tArray is made of objects of another class (row1Struct).

Afficher le composant dans la paletteShow the component in the palette

Le tArrayIn est masqué par défaut : il n'est pas dans la palette tant qu'il n'est pas affiché dans les paramètres du projet. Il n'y a pas besoin de l'afficher pour se servir de tIterateToFlow ou de tDenormalize. Le réglage est enregistré dans le projet : il vaut pour tous ses jobs et pour tous ceux qui ouvrent le projet. The tArrayIn is hidden by default: it is not in the palette until it is shown in the project settings. It does not need to be shown to use tIterateToFlow or tDenormalize. The setting is saved in the project: it applies to all its jobs and to everyone who opens the project.

  1. Menu Fichier › Modifier les propriétés du projet, ou bouton Paramètres du projet de la barre d'outils. Dans l'éditeur d'un job, un clic droit sur le titre de la palette › PaletteFilter ouvre directement la bonne page. File › Edit Project properties menu, or Project settings button of the toolbar. In a job editor, a right-click on the palette title › PaletteFilter opens the right page directly.
  2. Dans l'arbre de gauche, ouvrez Designer › Paramètres de la Palette. In the tree on the left, open Designer › Palette Settings.
  3. La liste Hide (à gauche) contient les composants masqués. Dépliez-la jusqu'à la famille Technique et sélectionnez tArrayIn (Ctrl+clic pour en prendre plusieurs). The Hide list (on the left) holds the hidden components. Unfold it down to the Technical family and select tArrayIn (Ctrl+click to take several).
  4. Cliquez sur la flèche vers la droite, entre les deux listes : le composant passe dans la liste Show. Click the right arrow, between the two lists: the component moves to the Show list.
  5. Validez avec Apply and Close : le composant apparaît dans la famille Technique de la palette. Confirm with Apply and Close: the component appears in the Technical family of the palette.

Les libellés Hide, Show, PaletteFilter et Apply and Close sont en anglais, même dans le Studio en français. Un composant déjà utilisé dans un job du projet ne peut pas être masqué de nouveau : le Studio le laisse visible et le signale. The Hide, Show, PaletteFilter and Apply and Close labels are in English, even in the French Studio. A component already used in a job of the project cannot be hidden again: the Studio leaves it visible and says so.

ParamètresSettings

Le nom technique, en gris, est celui du paramètre dans le fichier du job. Dans un tIterateToFlow ou un tDenormalize, ces réglages sont remplis par le composant. The technical name, in grey, is the parameter name in the job file. In a tIterateToFlow or a tDenormalize, these settings are filled by the component.

ParamètreSetting DéfautDefault OngletTab Description
OrigineOriginORIGIN array_tArray_1 Paramètres simplesBasic settings Le nom de la liste dans globalMap, sans guillemets. Il entre aussi dans le nom de la classe attendue. Si globalMap n'a rien sous ce nom, aucune ligne ne sort, sans erreur. The name of the list in globalMap, without quotes. It is also part of the name of the expected class. If globalMap has nothing under this name, no row comes out, without an error.
SchémaSchemaSCHEMA — Paramètres simplesBasic settings Les colonnes envoyées dans le flux, copiées par nom depuis chaque élément de la liste. The columns sent into the flow, copied by name from each element of the list.

ExemplesExamples

Sorties copiées depuis une exécution du job. Dans les erreurs, le nom du job est remplacé par MyJob ; les traces et messages de compilation sont abrégés. Outputs copied from a run of the job. In the errors, the job name is replaced with MyJob; the traces and compilation messages are shortened.

Dans un tIterateToFlowInside a tIterateToFlow

Iterate row1 (Main) tLoop_1 tIterateToFlow_1 tLogRow_1

tLoop de 1 à 3. Schéma du tIterateToFlow : value (Integer), valeur ((Integer) globalMap.get("tLoop_1_CURRENT_VALUE")). tLoop from 1 to 3. tIterateToFlow schema: value (Integer), value ((Integer) globalMap.get("tLoop_1_CURRENT_VALUE")).

Extrait du code généré, partie tArrayInExcerpt of the generated code, tArrayIn part

java.util.List<OnSubjobOkStructtIterateToFlow_1> list_tIterateToFlow_1_AI = (java.util.List<OnSubjobOkStructtIterateToFlow_1>)globalMap.get("tIterateToFlow_1");
if(list_tIterateToFlow_1_AI == null) {
    list_tIterateToFlow_1_AI = new java.util.ArrayList<OnSubjobOkStructtIterateToFlow_1>();
}
for(OnSubjobOkStructtIterateToFlow_1 row_tIterateToFlow_1_AI : list_tIterateToFlow_1_AI){
    row1.value = row_tIterateToFlow_1_AI.value;

Console (tLogRow en mode Simple)Console (tLogRow in Basic mode)

1
2
3

Après un tArrayAfter a tArray

row1 (Main) OnSubjobOk row2 (Main) tFixedFlowInput_1 tArray_1 tArrayIn_1 tLogRow_1

Réglages par défaut des deux côtés : même nom de liste (array_tArray_1), même schéma (id, name, city). Le job compile, mais s'arrête à la lecture : Default settings on both sides: same list name (array_tArray_1), same schema (id, name, city). The job compiles, but stops when reading:

Exception in component tArrayIn_1 (MyJob)
java.lang.ClassCastException: class demo.myjob_0_1.MyJob$row1Struct cannot be cast to class demo.myjob_0_1.MyJob$OnSubjobOkStructarray_tArray_1 (…)
	at demo.myjob_0_1.MyJob.tArrayIn_1Process(MyJob.java:2198)
	…

Le tArray range des row1Struct ; le tArrayIn, relié par On Subjob Ok avec l'Origine array_tArray_1, attend des OnSubjobOkStructarray_tArray_1. The tArray stores row1Struct objects; the tArrayIn, connected with On Subjob Ok and with the array_tArray_1 Origin, expects OnSubjobOkStructarray_tArray_1 objects.

Seul, sans lien entrantAlone, without an incoming link

row1 (Main) tArrayIn_1 tLogRow_1

Sans lien entrant, la classe attendue n'existe pas : le job ne compile pas. Without an incoming link, the expected class does not exist: the job does not compile.

error: cannot find symbol
        java.util.List<Structarray_tArray_1> list_tArrayIn_1 = (java.util.List<Structarray_tArray_1>)globalMap.get("array_tArray_1");
                       ^
  symbol:   class Structarray_tArray_1
  location: class MyJob

Variable globaleGlobal variable

NB_LINE (Integer, disponible après l'exécution du composant) : nombre de lignes envoyées. Dans un tIterateToFlow, elle porte le nom de la partie tArrayIn. L'exemple ci-dessus, avec un tJava relié au tLoop_1 par On Subjob Ok : NB_LINE (Integer, available after the component has run): number of rows sent. In a tIterateToFlow, it carries the name of the tArrayIn part. The example above, with a tJava connected to tLoop_1 through On Subjob Ok:

System.out.println("tIterateToFlow_1_AI_NB_LINE: " + globalMap.get("tIterateToFlow_1_AI_NB_LINE"));
System.out.println("tIterateToFlow_1_NB_LINE: " + globalMap.get("tIterateToFlow_1_NB_LINE"));
1
2
3
tIterateToFlow_1_AI_NB_LINE: 3
tIterateToFlow_1_NB_LINE: null

ConseilsTips

Le bon composantThe right component

Noms dans les messagesNames in messages

Dans le code généré, la partie tArrayIn d'un tIterateToFlow s'appelle tIterateToFlow_1_AI : le nom du composant du job, suivi de celui de sa partie interne. C'est ce nom que citent ses messages d'erreur et ses variables. In the generated code, the tArrayIn part of a tIterateToFlow is called tIterateToFlow_1_AI: the name of the job component, followed by the name of its internal part. This is the name its error messages and variables use.

Voir aussiSee also