-
Feature Request
-
Resolution: Done
-
Major
-
1.0.2.Final
-
None
Batch applications should be able to write chunk reader, writer & processor in common script languages.
- javascript
- groovy
- ruby
- python
- scala
- php
- R language for statistical computing
Scripting chunk reader, writer, or processor can be handy for writing simple steps, including no-op ones. For example,
<processor> <script type="javascript" src="foo.js"></script> </processor> <!-- or with embedded script in job xml --> <writer> <script type="javascript"> <![CDATA[ ...code... ]]> </script> </writer>
An ItemReader script must implement readItem function, or another function mapped to readItem method. Other methods from ItemReader interface (open, close, checkpointInfo) may be omitted, if nothing needs to be done there.
An ItemProcessor script must implement processItem function, or another function mapped to processItem method.
An ItemWriter script must implement writeItems function, or another function mapped to writeItems method. Other methods from ItemWriter interface (open, close, checkpointInfo) may be omitted, if nothing needs to be done there.
An example of mapping script function named differently to batch API methods (e.g., readItem => myReadItem):
https://github.com/jberet/jsr352/blob/master/test-apps/scripting/src/main/resources/META-INF/batch-jobs/chunkPython.xml
- is related to
-
JBERET-297 Support Java as a script language for writing batch components
- Open
- relates to
-
JBERET-61 Support scripting in batchlet
- Resolved