JBoss Community

Smooks-Is it possible to add dynamic date to the file name under file:fileNamePattern element?

reply from Daniel Bevenius in JBoss ESB Development - View the full discussion

Hi,

 

you could create a new Date instance in your smooks configuration and then referens it in the fileNamePattern element.

 

For example:

<smooks-resource-list>
 
    <jb:bean beanId="myDate" createOnElement="order-item"/>
 
    ...
    <file:outputStream resourceName="orderItemSplitStream" openOnElement="order-item">
        <file:fileNamePattern>order-${order.orderItem.itemId}-${myDate?date}.xml</file:fileNamePattern>
    ...

</smooks-resource-list>
 

 

The format that Freemarker uses, above specified as '?date', can be configured. You can find more information about the formatting here

 

Regards,

 

/Daniel

Reply to this message by going to Community

Start a new discussion in JBoss ESB Development at Community