web stats
Access to channelMap in postprocessor - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 08-02-2011, 04:28 AM
ignaciofedz ignaciofedz is offline
Mirth Newb
 
Join Date: Apr 2009
Posts: 14
ignaciofedz is on a distinguished road
Question Access to channelMap in postprocessor

Hi,

I have a channel with a post processing script. From this script I can read channelMap but if I want to store something in it does not appear in the dashboard. Is it normal or is it a bug?

Thanks in advance!

Ignacio
__________________
--
Ignacio
Reply With Quote
  #2  
Old 08-02-2011, 05:00 AM
Bostad Bostad is offline
Level 85 Channel Wizard
 
Join Date: Mar 2009
Location: Stratford Ontario
Posts: 712
Bostad is an unknown quantity at this point
Default

Not sure what you mean by it not appearing on the dashboard. Do you mean a logger statement?
__________________
I can be reached through gmail and Google Talk using davidrothbauer at gmail dot com
http://www.linkedin.com/pub/david-rothbauer/5/923/518
codeismydrug.wordpress.com
hl7coders.wordpress.com

Test all my code suggestions prior to implementation
Reply With Quote
  #3  
Old 08-02-2011, 05:04 AM
ignaciofedz ignaciofedz is offline
Mirth Newb
 
Join Date: Apr 2009
Posts: 14
ignaciofedz is on a distinguished road
Default

No, in Mappings tab (on Dashboard), when you select the message.
__________________
--
Ignacio
Reply With Quote
  #4  
Old 08-02-2011, 05:21 AM
Bostad Bostad is offline
Level 85 Channel Wizard
 
Join Date: Mar 2009
Location: Stratford Ontario
Posts: 712
Bostad is an unknown quantity at this point
Default

Oh! I refer to that as the message browser...hence the confusion.

I'm pretty sure this is working by design as the post-processor script kicks in after the message leaves the channel (and the details written into the the browser tabs).

If you want to see what the value is, the quick way is to use one of these statements:

Code:
logger.error('This is what my variable says: ' + $(variable));

logger.debug('This is what my variable says: ' + $(variable));

logger.info('This is what my variable says: ' + $(variable));
That you use will depend on what your logging level is set at. (I set mine on my appliance, not sure where to set it on a non-appliance).

You'll find these statements appear on the server log.

Just some tips for using logger statements (learned from experience);

I will throw my channel name, and where it resides in the logger statement (so I can go take it out if it gets annoying).
If I have a lot of statements (as in I'm trying to figure out why something isn't working), I will put a logger statement at the start of the section I'm working on identifying the channel and location (to save me putting it in at each line)
__________________
I can be reached through gmail and Google Talk using davidrothbauer at gmail dot com
http://www.linkedin.com/pub/david-rothbauer/5/923/518
codeismydrug.wordpress.com
hl7coders.wordpress.com

Test all my code suggestions prior to implementation
Reply With Quote
  #5  
Old 08-03-2011, 12:24 AM
ignaciofedz ignaciofedz is offline
Mirth Newb
 
Join Date: Apr 2009
Posts: 14
ignaciofedz is on a distinguished road
Default

Thanks, but the problem is that the keys i put on postprocessor it does not show on mapping tab.

I attached an example of the problem. It's a simple channel with a javascript reader and one destination. I put two keys on channelMap, one on destination (called var1) and other on postprocessor (called var2).

Like you can see in screenshot attached: var1 it shows on mapping but var2 not.

Cheers.

Ignacio.
Attached Images
File Type: jpg dashboard_mapping.jpg (74.2 KB, 37 views)
Attached Files
File Type: xml TestPostProcessor.xml (4.6 KB, 24 views)
__________________
--
Ignacio
Reply With Quote
  #6  
Old 08-03-2011, 04:16 AM
Bostad Bostad is offline
Level 85 Channel Wizard
 
Join Date: Mar 2009
Location: Stratford Ontario
Posts: 712
Bostad is an unknown quantity at this point
Default

Right, if var2 is mapped in the post-processor its being established after this message is written to the dashboard, hence, there is no var2 variable at this time.

You need to use a logger statement to write it to the server log if you need to see it after the message goes through.
__________________
I can be reached through gmail and Google Talk using davidrothbauer at gmail dot com
http://www.linkedin.com/pub/david-rothbauer/5/923/518
codeismydrug.wordpress.com
hl7coders.wordpress.com

Test all my code suggestions prior to implementation
Reply With Quote
  #7  
Old 08-03-2011, 04:28 AM
ignaciofedz ignaciofedz is offline
Mirth Newb
 
Join Date: Apr 2009
Posts: 14
ignaciofedz is on a distinguished road
Default

Thanks Bostad for your replies and advices.
__________________
--
Ignacio
Reply With Quote
  #8  
Old 05-28-2019, 03:33 AM
imransaeed imransaeed is offline
What's HL7?
 
Join Date: May 2019
Posts: 1
imransaeed is on a distinguished road
Post How to create & send acknowledgment in POSTPROCESSOR

How to create & send acknowledgment in POSTPROCESSOR? Please share sample javascript code thanks
Reply With Quote
Reply

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 07:59 AM.


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