[jboss-dev-forums] [Design of JBoss ESB] - Smooks Splitting Message

ama1 do-not-reply at jboss.com
Thu Apr 16 11:38:37 EDT 2009


Hi,
I trying to split a message into pieces and write those pieces to a file.

But in difference to the available examples I want to write all e.g. order-items to a file order-item.txt and dont want to create a file/order-item.

I tryed a configuration like that (my order-item is my product, which is a child element of Company):
<!-- Hotel - Create/open a file output stream.  -->
  | 	<file:outputStream openOnElement="Company" resourceName="hotelSplitStream">
  | 		<file:fileNamePattern>hotel.csv</file:fileNamePattern>
  | 		<file:destinationDirectoryPattern>d:/temp/inbound/</file:destinationDirectoryPattern>
  | 		<file:listFileNamePattern>sam-files.lst</file:listFileNamePattern>
  | 		<file:highWaterMark mark="1" />
  | 	</file:outputStream>
  | 	
  | 	<!-- Hotel -->
  | 	<ftl:freemarker applyOnElement="Product">
  | 		<ftl:template><!--${bla}--></ftl:template>
  | 		<ftl:use>
  | 			<ftl:outputTo outputStreamResource="hotelSplitStream" />
  | 		</ftl:use>
  | 	</ftl:freemarker>

But that produces me this error message: 
Caused by: org.milyn.SmooksException: OutputResource 'hotelSplitStream' not bound to context.  Configure an 'org.milyn.io.AbstractOutputStreamResource' implementation, or change resource ordering.

Apperently, the stream is only visible on the same element...?
Is my use case feasible like this? Or do I have to find another way?

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4225973#4225973

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4225973



More information about the jboss-dev-forums mailing list