Announcement

Collapse
No announcement yet.

How to stop Transformer ?

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

  • How to stop Transformer ?

    i work with many steps of javascript in my destination transformer. if i have a problem
    for ex. wrong datetime i will stop the transformer and set a error. at the moment i send my ack , bat the destination works continue. How can help?

    thanks and regards

  • #2
    Re:How to stop Transformer ?

    i find out, that with " return false" the transformer stop the work bat for ex al filewriter writes continue. So how can i cancel that and set error? Any body an Idea?

    regards

    Comment


    • #3
      Re:How to stop Transformer ?

      You can throw or raise an exception and halt the channel.
      Jon Bartels

      Zen is hiring!!!!
      http://consultzen.com/careers/
      Talented healthcare IT professionals wanted. Engineers to sales to management.
      Good benefits, great working environment, genuinely interesting work.

      Comment


      • #4
        Re:How to stop Transformer ?

        I use a generic error handler that I added as a code template (function) context = Channel

        Code to invoke errorHandler:
        var str1 = "Unable to Locate HL7 General Parameters for: " + InterfaceID + " Status: " + str2;
        ErrorHandler(20, str1);

        Error Handler code:
        // Generic error handler
        // Input:
        // Action:
        // 0=Log Error,
        // 10=Log Error, Send Email,
        // 20=Log Error, Send Email, Stop Channel
        //
        // ErrorString:
        // Error text
        function ErrorHandler(Action, ErrorString){
        switch(Action)
        {

        case 20:
        var channelID = messageObject.getChannelId();
        var channelStatusController = Packages.com.webreach.mirth.server.controllers.Cha nnelStatusController.getInstance();
        channelStatusController.stopChannel( channelID );
        case 10:
        alerts.sendAlert(ErrorString);
        case 0:
        logger.error(ErrorString);
        }
        }

        Comment


        • #5
          Re:How to stop Transformer ?

          thanks for your sample, but where you find the documentation of the classes like ChannelStatusController ? Is there any API - Doku ?

          Comment


          • #6
            Re:How to stop Transformer ?

            Download the Mirth source and you will be able to locate Mirth Specific classes and methods

            Comment

            Working...
            X