This post is part of a series delving into the details of the JSR-352 (Java Batch) specification. Each post examines a very specific part of the specification and looks at how it works and how you might use it in a real batch application.
To start at the beginning, follow the link to the first post.
The next post in the series is here.
This series is also available as a podcast on iTunes, Google Play, Stitcher, or use the link to the RSS feed.
We’re going to step aside from talking about the REST interface and ways to exploit it to follow up on the WebSphere Developer Tools (WDT) and how they can help you create Java Batch applications.
The batch support in WDT allows you to create a Batch Project and inside of that you can create Batch Jobs. Creating a job creates a JSL file in the batch-jobs folder. The cool thing about using WDT to create the job is that it knows all the XML syntax for JSL. You can use the wizard to create steps, chunks, properties, listeners, etc.
This is especially awesome if you are using substitution with job parameters, properties, etc. You might recall the rather complicated syntax with all those quotes and brackets and so forth. WDT understands that all and has a little panel where you can explain what you want, and it will generate the correct syntax.
As you define the job, you’ll start specifying various Java artifacts that you’ll need to use. Your JSL will specify a batchlet, or an ItemReader or a Listener. WDT knows what the interfaces are for all of the artifacts and can help you by creating a skeleton implementation for you to fill in. It even knows all the various listener types. If you add a listener to the JSL, it will ask you which type you want and set up the proper skeleton.
I don’t want to go through specific directions to create and run a job here (there are a few writeups/labs about doing that in DeveloperWorks and IBM Techdocs). I just wanted to make you aware the tooling existed. I use it all the time developing samples and tests for various things and it certainly prevents me from making a lot of simple, annoying mistakes.