Announcement

Collapse
No announcement yet.

Accessing transformed and error message in alert

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

  • Accessing transformed and error message in alert

    I want to access the transformed message and the error I get from a request response in my alert template message.

    What I did is setting 2 global variables in the postprocessor script of my channel and then I read them in the alert.
    globalMap.put("requestError", responseMap.get("d"+j).getMessage());
    globalMap.put("transformed", connectorMessage.getTransformedData());

    I'm not so sure this is the best way to access these values.

    Any suggestion?

  • #2
    Another way to do it is to send a custom event with alerts.sendAlert, with your own custom message. That way it can include whatever information you want.

    If you go the global map route, make sure that those keys are unique and won't collide with other channels. Since multiple messages may trigger the same alert, it would be prudent to use some kind of queue or something in the actual map value.
    Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

    Nicholas Rupley
    Work: 949-237-6069
    Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


    - How do I foo?
    - You just bar.

    Comment


    • #3
      other option is logger.info();
      But the alerts option suits better i guess
      Best Regards,
      Alex Neiva

      Comment


      • #4
        Thanks for the suggestions but I need to access just these values in the alert and I can through global variables in the postprocessing but I just realized that doing this in the postprocessing it creates a problem.
        Since the alert is launched before the postprocessing script on the first "error" I'm not getting any value in the alert. The errors just arrive from second error.
        Nobody knows any other way to access the transformed message and the error I get from a request response in my alert template message?

        Comment

        Working...
        X