Loop by Number of Data

Operation Name

Loop by Number of Data

Function overview

Repeat the process for times as the number of input data.
Record is the repeat unit if the data is of model data type such as database or excel.
All elements are the repeat unit if the data is of XML type.

Loop by Number of Data structure

Icon Name Description
Loop by Number of Data Loop by Number of Data starts.
End Loop by Number of Data Loop by Number of Data ends.

Properties

For information about using variables, refer to "variables".
Basic settings
Item name Required/Optional Use of Variables Description Remarks
Name Required Not available Enter the name on the script canvas.  
Input data Required Not available Select the component on the script canvas.  
Required settings
Item name Required/Optional Use of Variables Description Remarks
Number of process at one loop Required Available Enter the number of transactions in one loop.
  • Default value is "1".
XML data processing
Item name Required/Optional Use of Variables Description Remarks
Separation path Optional Not available Enter path as the base point of repeat.
Optional if the type is table model.
 
Log setting
Item name Required/Optional Use of Variables Description Remarks
Edit log setting Optional Not available Select whether to temporarily edit the log setting in the loop processing.
  • [Checked]:
    Enables to edit log setting.
  • [Not checked]:(default)
    Does not enable to edit log setting.
 
Output logs Optional Not available Select whether to output logs.
  • [Checked]:(default)
    Enables to output logs.
  • [Not checked]:
    Stops outputting logs.
  • This action is available if you check the [Edit log setting] box.
Log level Optional Not available Select the editing log level.
  • [NOTICE]:
  • [INFO]:(default)
  • [FINFO]:
  • [FINEST]:
  • [DEBUG]:
  • This action is available, if you check the [Output logs] box.
Comment
Item name Required/Optional Use of Variables Description Remarks
Comment Optional Not available You can write a short description of this adapter.
The description will be reflected in the specifications.
 

PSP Usage

PSP is supported.
For details on PSP, refer to "Parallel Stream Processing".

Available component variables

Component variable name Description Remarks
count Returns the number of loop counts.
  • The value defaults to null.

Loop by Number of Data operation

Create Loop by Number of Data

Set the process to repeat between [Loop by Number of Data] and [End Loop by Number of Data].



Specification Limits

Main exceptions

None.

Notes

If input data is Merge

Output data of merge is always XML type.
Therefore, even while setting the table model schema as output schema, when drawing data flow to [Loop by Number of Data], [/table/row] needs to be specified to [Separation path].

When place write process of file system adapters in loop

Write process of file system adapters such as CSV adapter opens and closes file each time in the loop, therefore, the performance may deteriorates.
In that case, performance deterioration can be prevented by enclosing loop with transaction to eliminate opening and closing of file to write.

The following scripts is the process of reads CSV file and adds one line of data at a time by using loop.Though the process is equivalent to Read CSV file -> Write CSV file, the performance deteriorates.
Loop performance degradation

The script preventing performance deterioration by enclosing the whole loop process by transaction is as follows.
Loop to prevent performance degradation

Sample

Creates a script that uses Loop by Number of Data to write the data read from CSV file to CSV file.
  1. Create script as follows.



    Contents of CSV file.

    id value
    S001 10000
    S002 20000
    S003 30000

  2. Properties of Loop by Number of Data is set as follows.


  3. Check the process from execution log.



    In addition, due to the Write CSV process, the follow contents will be output as CSV file.

    id value
    S001 10000
    S002 20000
    S003 30000