Announcement

Collapse
No announcement yet.

Java in javascript

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Java in javascript

    Rhino javascript allows you to easily import Java packages, and integrate Java code.

    In the transformer I would like to write this code as an alternative to mapping incoming data to XML.

    import com...ArchetypeModel;
    import com...ArchetypeClusterModel;

    arch = new ArchtypeModel();
    for (i=0; i< msg['definition']['attributes']['children'].length(); i++) {
    cluster = new ArchetypeClusterModel();
    cluster.getArchetypeClusterRef().setIdvalue(msg['definition']['attributes']['children']['rm_type_name'].toString());
    arch.getClusters().add(cluster);
    }

    tmp = arch.toXml();



    Any plans on supporting that?

    thanks

    Greg

  • #2
    Re:Java in javascript

    AFAIK This can be done with Mirth yet:

    1) Put the java jar files at the custom dir.
    2) To import an object, use:
    var object = Packages.[fully-qualified name];

    There are some examples at the board:

    http://www.mirthproject.org/index.ph...9&catid=2#3949

    http://www.mirthproject.org/index.ph...3&catid=2#3723

    Comment

    Working...
    X