[XD-1972] Add ability to define nested jobs Created: 14/Jul/14  Updated: 15/Oct/14  Resolved: 15/Oct/14

Status: Done
Project: Spring XD
Component/s: Batch
Affects Version/s: M7
Fix Version/s: 1.1 M1

Type: Improvement Priority: Major
Reporter: Michael Minella Assignee: liujiong
Resolution: Complete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Epic Link: OOTB Batch Jobs
Story Points: 3
Rank (Obsolete): 214
Sprint: Sprint 36

 Description   

Narrative

As a developer, I need to be able to create a Spring XD job module that consists of a job orchestrating the execution of other Spring Batch jobs using the Spring Batch Job Step (see section 5.3.6 here: http://docs.spring.io/spring-batch/reference/html/configureStep.html) within the same module definition.

Acceptance Criteria

  1. Define the "contract" for a job module
    1. Currently the contract consists of a single job definition within the assembled ApplicationContext (context.getBean(Job.class)).
    2. The new version will need to document what job definition within the assembled ApplicationContext should be run as the entry point. I'm assuming it would be by id (context.getBean("job") for example) of the job but am open to other options.
  2. A custom job module that orchestrates multiple Spring Batch jobs via Job steps should be able to be deployed and executed as a single Spring XD module.
    1. Spring XD launches the job that conforms to the previously defined "contract".
    2. Spring Batch manages the execution of the child jobs.
  3. The existing OOTB jobs should work under the new "contract".

Assumptions

  1. The UI should "just work" in that child jobs update the job repository independently so no updates should be needed for an MVP of this functionality.
  2. This will be a breaking change for users that have developed custom job modules.

Out of Scope

  1. Execution of child jobs that are remote (deployed on another node / ApplicationContext).
  2. Dynamically assembling jobs via the shell's DSL or the UI.


 Comments   
Comment by liujiong [ 08/Aug/14 ]

Could you give an xml example of nested job?

Comment by Michael Minella [ 08/Aug/14 ]

See the test here: https://github.com/spring-projects/spring-batch/blob/master/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/JobStepParserTests-context.xml

Comment by liujiong [ 11/Aug/14 ]

https://github.com/spring-projects/spring-xd/pull/1153

Comment by Sabby Anandan [ 15/Oct/14 ]

Changes were merged and the documentation is complete.

Generated at Fri Jan 24 04:40:23 UTC 2020 using Jira 7.13.8#713008-sha1:1606a5c1e7006e1ab135aac81f7a9566b2dbc3a6.