Spring Batch 在 tasklet 中运行重复的步骤不止一次

问题描述

假设我有以下流程, 开始->Step1->Step2->Step3->Step2->End

我已经为每个步骤创建了 tasklet,并按上述方式配置了一个作业。 当作业被触发时,执行到 Step3 为止都很好,并无限循环。 那么有没有一种方法可以在 JobFlow 中多次执行步骤。

我使用的是 Spring Batch 4.2.1.RELEASE。

解决方法

你怎么写你的工作?我曾经在使用基于批处理的许多流程时遇到过这种问题。

你有没有尝试过这样的事情?

public class RowsSum {
  public static void main(String[] args) {
    int[][] nums = new int[5][3]; //declaring a 2D array of type int
    int num = 2;
    for (int i = 0; i < nums.length; i++) {
      for (int j = 0; j < nums[i].length; j++) {
        nums[i][j] = (int) Math.pow(num,((i*nums[i].length)+j+1)); //code A
        System.out.print(nums[i][j] + "\t");
      }//closing inner loop
      System.out.println("");
    }// closing nested for loop
  }// closing main method
}//closing class

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...