Batch Core
I decided to extract the core classes of my last Java batch example and put them in their own
project. The project is uploaded to Maven Central. There are two versions of batch-core:
- version 1.x.x = JBoss Weld 4.x
- version 2.x.x = JBoss Weld 6.x
So far I mostly used Weld 4 but as I have no conflicting dependencies I wanted to give Weld 6 a try.
1 | <dependency> |
Most simple example
The simplest example is to just implement WorkflowStep and be done.
1 |
|
That’s it! No other classes need. No other files needed (besides those for CDI support).
Note: Don’t forget to setup your project for CDI because your step implementation needs to be a bean.
More icing on the cake
And as the step implementation is a bean I can inject a configuration value directly into the bean without any fuzz.
1 |
|
… or I could inject other beans here. Feel free! :)
Happy batching!
Mihael