web stats
User Guide 3.6 on page 257 - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 12-03-2018, 02:32 PM
StickyBandit's Avatar
StickyBandit StickyBandit is offline
Mirth Guru
 
Join Date: Aug 2013
Location: Home Alone
Posts: 893
StickyBandit is on a distinguished road
Cool User Guide 3.6 on page 257

This code snippet below used in a Batch File Reader channel
and does not work. It does seem to work in our port channels though.

I added the code from User Guide 3.6 on page 257 into the javascript edit for the Set Data Types-->Batch-->Split Batch By:
(...Meaning a blank segment line does not break the message apart anymore.)

Need help getting this to work in the file reader batch processor.

CODE:
var message = new java.lang.StringBuilder();

var line;
while ((line = reader.readLine()) != null) {
message.append(line).append('\r');

// Mark the stream for 3 characters while we check for MSH
reader.mark(3);
// Check for the code points corresponding to MSH
if (reader.read() == 77 && reader.read() == 83 && reader.read() == 72) {
reader.reset();
break;
}
reader.reset();
}

return message.toString();
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 04:22 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Mirth Corporation