Archive for javascript

Calling stored procedures from Mirth

Posted in Computación with tags , , , , , , on 27/October/2010 by Alex Pérez

Mirth JDBC reader/writer are well suited for simplest cases: only one SELECT and (optionally) a UPDATE for each row, but normally you need to use JDBC reader/writer with JS enabled.

Mirth JDBC API when using JS is very basic and does not allow easily deal with stored procedures: there are only executeCachedQuery() and executeUpdate(). If you’re lucky you can use executeUpdate() as long as your SP doesn’t use IN/OUT parameters or returns any resultset. Otherwise you should call the SPs in a java library and then invoke it from Mirth JS. Some time ago I documented how to call custom java classes from Mirth and this may be used to extend its database API. Continue reading

SOAP polling with Mirth

Posted in Computación with tags , , , , , , on 10/October/2010 by Alex Pérez

There are some recurrent problems when developing interfaces with Mirth, and one of the trickiest is SOAP polling. From early versions of Mirth there is a SOAP sender connector, but it doesn’t have any direct connector to poll a webservice. As far as I know polling is considered to be a near-antipattern, but under some circunstances you may be forced to use it if the integration counter-part is closed-source.

To read periodically from a WS you need to setup an interface with these connectors:

  • source: JS Reader
  • destination 1: SOAP Sender
  • postprocessor or destination 2: JS Writer (or any other destination-type with a JS Transformer inside) Continue reading