マップでルーチンを使用
ランダムな文字列を生成するルーチンを呼び出す場合はJava関数を使います。
始める前に
このタスクについて
<customers>
   <customer>
      <firstName>Grover</firstName>
      <lastName>Truman</lastName>
   </customer>
   <customer>
      <firstName>Millard</firstName>
      <lastName>Roosevelt</lastName>
   </customer>
   <customer>
      <firstName>Theodore</firstName>
      <lastName>Garfield</lastName>
   </customer>
</customers> 
 手順
タスクの結果
<root>
  <customer>
    <firstName>Grover</firstName>
    <lastName>Truman</lastName>
    <id>tc2m9HQ9BQjbS7h</id>
  </customer>
  <customer>
    <firstName>Millard</firstName>
    <lastName>Roosevelt</lastName>
    <id>BcTd14JScXQQyjP</id>
  </customer>
  <customer>
    <firstName>Theodore</firstName>
    <lastName>Garfield</lastName>
    <id>BBCUINwgqXUh9ls</id>
  </customer>
</root>![[Expression Java Properties] (式のJavaのプロパティ)ウィンドウ。](/talend/ja-JP/data-mapper-user-guide/8.0-R2025-10/Content/Resources/images/use_routine_02_java.png) 
 ![[Expression Constant Properties] (式の定数のプロパティ)ウィンドウ。](/talend/ja-JP/data-mapper-user-guide/8.0-R2025-10/Content/Resources/images/use_routine_03_constant.png)