Sunny
Sunny

Reputation: 1

How can you share Transformers across mirth channels

We are using appliance based mirth connect ver 3.4.2

We have few transformers which are common to all the channels but still they are under each channel. Anytime we have to modify something, we have to make changes in all channels.

We have transformers for

  1. some functions with javascript and java code
  2. some mappings
  3. some database operations like inserts etc

Can we put this code somewhere where it is shared across channels and we don't need to write transformers under each channel ?

Thanks Sid

Upvotes: 0

Views: 830

Answers (2)

Vibin Guevara
Vibin Guevara

Reputation: 826

some functions with javascript - Edit Code Templates will be a place where you can provide common codes which has to go for all channels.

some database operations like inserts - I believe/(good practice) these should be specific to channels, and if you have functions specific to certain channel and used in many places in that specific channel, then declare that function in modes of process needed like either in deploy,pre-processor,undeploy or post-processor.

some mappings - I'm not sure about this. If you choose Javascript for mapping we can achieve this mapping by making it as a global variable in global script places or coded templates.

some JAVA code - If it is a JAVA code, and a library built to invoke script on top of the library, then make the JAVA library to have get and set objects that way you can traverse to any depth on your Mirth script to access JAVA objects

For Eg: If you are building XML, there are many libraries you can use like Stax parser, JDOM etc, but using a document builder factory for developing XML will allow you to access JAVA objects to depth in Mirth script .

Upvotes: 0

MikeyW
MikeyW

Reputation: 51

A good way to do this is to move common code (functions, database operations, etc) into code templates.

Upvotes: 2

Related Questions