Here's one I've used that works well.
batchRouter.ignored=false
batchRouter.tracked=true
batchRouter.stageType=Router
batchRouter.nextStage=Writer
batchRouter.nextStage.CCDWriter=#if("CCD" == (${document.get("batchType")}))true#end
batchRouter.nextStage.CTXWriter=#if("CTX" == (${document.get("batchType")}))true#end
Basically it uses an attribute of the document setup in a previous XpathExtract step to divide the document into separate batches based upon the attribute content. Note the ...NextStage if statements are similar to velocity macros and simply must result in a true (select that stage) or false (try next statement or on end use the unquilified nextStage value). Hope this helps
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
hi all,
Please, are there any router stage configuration examples?
Thanks.
Massimo
Here's one I've used that works well.
batchRouter.ignored=false
batchRouter.tracked=true
batchRouter.stageType=Router
batchRouter.nextStage=Writer
batchRouter.nextStage.CCDWriter=#if("CCD" == (${document.get("batchType")}))true#end
batchRouter.nextStage.CTXWriter=#if("CTX" == (${document.get("batchType")}))true#end
Basically it uses an attribute of the document setup in a previous XpathExtract step to divide the document into separate batches based upon the attribute content. Note the ...NextStage if statements are similar to velocity macros and simply must result in a true (select that stage) or false (try next statement or on end use the unquilified nextStage value). Hope this helps
Thanks,
it works very fine.
I've used it to redirect the document into 3 different pipelines based on the name (and then the type) of the file.
........
........
fWriter0.stageType = FileWriter
fWriter0.nextStage = router
fWriter0.outputFile = ../Unzipped/${document.get("unzipped")}
fWriter0.errorStage = errorHandler
fWriter0.failOnError = false
fWriter0.tracked = true
router.stageType = Router
router.nextStage.MTLconvert = #if ("MTL" == (${document.name.substring(0,3)}))true#end
router.nextStage.ATIconvert = #if ("ATI" == (${document.name.substring(0,3)}))true#end
router.nextStage.OPCconvert = #if ("OPC" == (${document.name.substring(0,3)}))true#end
router.nextStage = null
router.errorStage = errorHandler
router.failOnError = false
router.tracked = true
........
........
Massimo