web stats
Mirth Community - View Single Post - Using Correct Java Sytax in Mirth via Javascript
View Single Post
Old 05-06-2015, 08:30 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
Join Date: Oct 2010
Posts: 7,126
narupley is on a distinguished road

The code is almost the same in JavaScript. Except, you should be using "var", because it's JavaScript. Also you need to invoke Java classes using fully-qualified class names, or import the package first.

    // The document is stored in byte form in the FileContent column.
    // Retrieve these bytes of the first matching record to a new buffer.
    var buffer = resultSet.getBytes("FileContent");

    // Wrap the bytes from the buffer into a new ByteArrayInputStream object.
    var newStream = new java.io.ByteArrayInputStream(buffer);
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.

- How do I foo?
- You just bar.
Reply With Quote