web stats
External Javascript BasePath - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Thread Tools Display Modes
Old 04-10-2012, 11:01 AM
owright owright is offline
Mirth Newb
Join Date: Aug 2011
Posts: 6
owright is on a distinguished road
Default External Javascript BasePath

Hello Mirth Community,

I am trying to specify a base path in the External Javascript path textbox and cannot seem to do it. Is there a way to hack one in?

I was trying:

where MirthConnectInstallDir is defined in my global and channel Map.

Thank you for your time.
Reply With Quote
Old 04-10-2012, 11:06 AM
owright owright is offline
Mirth Newb
Join Date: Aug 2011
Posts: 6
owright is on a distinguished road

OK so I suppose just having, "custom-script\mine.js" works fine.

However, I would still like to know if there is a way to make a base path work with this though.
Reply With Quote
Old 04-11-2012, 12:15 AM
mourisj mourisj is offline
Mirth Guru
Join Date: Feb 2007
Location: Luxembourg
Posts: 405
mourisj is an unknown quantity at this point

In fact, you can use any path accessible on your network.
Like '//myfilserver/myshare$/myfolder/mysubflolder' or any other.
This will be an absolute path, this is good if you need to access the same script from different servers.
If you do not start your path with slashes, it will be relative to the installation directory.

If you use backslashes, you eventually need to escape them by doubling them, so the above path would be '\\\\myfilserver\\myshare$\\myfolder\\mysubflolder '
JJ Mouris
FFE Luxembourg
Reply With Quote
Old 04-11-2012, 04:39 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
Join Date: Oct 2010
Posts: 6,971
narupley is on a distinguished road

As far as using a variable in that external script path, I don't think there's in "easy" way to do it, but you could have something in the deploy script that iterates through each step of every transformer, checks whether it's an External Script step, and if it is, runs a TemplateValueReplacer against the path property. Then the deploy script would need to save and redeploy the channel (an infinite loop would be avoided by only redeploying if any changes were made).

It's ugly, but it'd work. Of course, if the global variable you want to use is, for example, set earlier in the channel and then used in a later External Script transformer step, then that method wouldn't avail you.
Reply With Quote

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 08:32 AM.

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