Menu

Router examples

Help
maxdaros
2004-12-13
2013-04-16
  • maxdaros

    maxdaros - 2004-12-13

    hi all,

    Please, are there any router stage configuration examples?

    Thanks.
    Massimo

     
    • johnMac

      johnMac - 2004-12-13

      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

       
    • maxdaros

      maxdaros - 2004-12-13

      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

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.