web stats
JavaScript wiht own Class - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Thread Tools Display Modes
Old 03-22-2007, 03:04 AM
orlowjb3 orlowjb3 is offline
OBX.1 Kenobi
Join Date: Feb 2007
Posts: 48
Default JavaScript wiht own Class

i built a simple class to test if mirth can handle extern classes.
My class lies in mirth/lib/custom and i used the code that i found in the devboard:

var extern=new Packages.com.bhi.MirthUtils.MirthLib(); // where mirthlib is my jar-package
var result=extern.Ausgabe("Hallo");

And i got this error during parsing messages:
ECMAError :..MirthLib ...is not a function, it is org.mozilla.javascript.NativeJavaPackage.

Or is it only possible to run JS?

Thanks for your help

Reply With Quote
Old 03-22-2007, 10:48 PM
chrisl chrisl is offline
Mirth Employee
Join Date: Aug 2006
Posts: 967
chrisl is an unknown quantity at this point
Default Re: JavaScript wiht own Class

I believe you need to use the "importPackages" command to import Packages.com.bhi.MirthUtils

Then you can do var extern = new MirthLib();

Check the posting about calling external libs for the alternate way.

Chris Lang
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
calling my class method in javascript writer kashif Support 6 01-21-2009 11:59 PM
set classpath in Mirth or how to use my own class albert.punsola General Discussion 8 12-17-2008 02:56 PM
Using a new java class in my transformer dvenier Support 1 02-15-2008 06:38 AM
What XML class is Mirth using? jbartels Development 2 08-16-2007 11:44 AM
Problem using own java class Harminator Support 1 06-01-2007 11:56 AM

All times are GMT -8. The time now is 12:49 PM.

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