web stats
[MirthConnect3] Javascript Reader does not work anymore - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 03-04-2014, 07:20 AM
gkittlaus gkittlaus is offline
OBX.3 Kenobi
 
Join Date: Jan 2012
Posts: 104
gkittlaus is on a distinguished road
Thumbs down [MirthConnect3] Javascript Reader does not work anymore

Hi,

I am currently testing MC3. We previously used MC2.2.3 and everything worked like a charm

Now I imported my channel to MC3 and it seems it doesn't work anymore.

Only script I've entered in the source screen seems to run. Filters and Transformers are completely ignored.

Why is that? Was there a drastic change in design from MC2 to MC3?

kind regards
Reply With Quote
  #2  
Old 03-04-2014, 08:06 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,126
narupley is on a distinguished road
Default

Quote:
Originally Posted by gkittlaus View Post
Hi,

I am currently testing MC3. We previously used MC2.2.3 and everything worked like a charm

Now I imported my channel to MC3 and it seems it doesn't work anymore.

Only script I've entered in the source screen seems to run. Filters and Transformers are completely ignored.

Why is that? Was there a drastic change in design from MC2 to MC3?

kind regards
Hard to troubleshoot without the channel in question...
__________________
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.
Reply With Quote
  #3  
Old 03-07-2014, 12:28 AM
gkittlaus gkittlaus is offline
OBX.3 Kenobi
 
Join Date: Jan 2012
Posts: 104
gkittlaus is on a distinguished road
Default

Hey, sorry to let you wait.
I cannot attach the real one because of the whole environment but I have created a very plain example.

Attached you'll find a channel which simply does a logger.info() in the source filters, transformers and also in the destinations.

As you will see it will only print the logger.info text from the main source window.

Everything in my original channel is done by javascript. The filters, the transformations.
Am I missing something?

EDIT: So I got the source filter working. I simply set it to RAW data. But it won't proceed with my source transformer and my whole destination.

EDIT: sorry, my bad, I am still not used to the new dashboard :-\ how ever. when I defined a variable in MC2 in the source filter or transformer with
Code:
bla = 'blubb'
this variable was available in the whole channel. Now it's pointing out, that the variable was not declared.
Do I have to put the variables which I have declared in the source in a channel map to make them available in the destinations?
Attached Files
File Type: xml Javascript Tester.xml (20.4 KB, 5 views)

Last edited by gkittlaus; 03-07-2014 at 01:21 AM.
Reply With Quote
  #4  
Old 03-07-2014, 07:44 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,126
narupley is on a distinguished road
Default

Everything appears to be working as expected. The issue is that you're not returning anything from your JavaScript Reader. If you want to dispatch a message (or list of messages) to the channel, you need to return something.

Quote:
Originally Posted by gkittlaus View Post
when I defined a variable in MC2 in the source filter or transformer with
Code:
bla = 'blubb'
this variable was available in the whole channel. Now it's pointing out, that the variable was not declared.
Do I have to put the variables which I have declared in the source in a channel map to make them available in the destinations?
I tested this out in 2.2.3 and it does not work, as expected. You cannot define a variable in one script and expect to use it in an entirely different script. That's what the variable maps (connector/channel/global channel/global) are for. You're likely misunderstanding what you did in 2.x. If you post your original 2.x channel here it would be easier to troubleshoot.
__________________
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.
Reply With Quote
  #5  
Old 03-10-2014, 07:36 AM
gkittlaus gkittlaus is offline
OBX.3 Kenobi
 
Join Date: Jan 2012
Posts: 104
gkittlaus is on a distinguished road
Default

sorry to give you headache with this. I was wrong with the scope of variables.
I got it to run anyway with some testings and switching the data to RAW data.

It appears that my problem was the stricter parsing according to the datatype of MC3 compared to MC2.
Reply With Quote
Reply

Tags
javascript, javascript reader, mirth 3

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 04:56 PM.


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