How to route a file based on file type
This question came in on an Ensemble email list:
- I need to route a file based on its type in Ensemble Production. But I don't want to write a Business Process code to achieve this.
- Am using FilePassThroughService to get a file. There are two FilePassthrough operations for different type of files.
- Is there anyway to achieve this routing using Business Process Rule itself?
- Also how to get the filename in Business Process Rule that comes from FilePassThroughService?
Are you determining the file type by the file name extension or by the contents of the file?
If you're doing it by the file name extension, the easiest way to handle this is to have different pass through business services for each file type and then send it directly to the correct file operation. You don't need a router at all.
If you do need to do this in a router. Here is the overall process.
Persistent > ENS > StreamContainer
That's the message class used by the pass-through file service/operation. You can also specify the business service as the source.
But you may not need the router at all.