You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Where should i write code to get the response time of "Source" ? If i write the code in the "Source" transformer , the channel will report an error.
my code in "Source" transformer :
var date = connectorMessage.getResponseDate().getTime();
var dateString = DateUtil.formatDate('yyyy-MM-dd HH:mm:ss', date);
logger.info(dateString);
Error Message:
Transformer error
ERROR MESSAGE: Error evaluating transformer
com.mirth.connect.server.MirthJavascriptTransformerException:
CHANNEL: TEST_WS
CONNECTOR: sourceConnector
SCRIPT SOURCE: TRANSFORMER
SOURCE CODE:
118: }
119: }function doFilter() { phase[0] = 'filter'; return ((filterRule1() == true)); }
120: function doTransform() { phase[0] = 'transformer'; logger = Packages.org.apache.log4j.Logger.getLogger(phase[0]);
121:
122:
123: var date = connectorMessage.getResponseDate().getTime();
124: var dateString = DateUtil.formatDate('yyyy-MM-dd HH:mm:ss', date);
125: logger.info(dateString);
126: if ('xml' === typeof msg) {
127: if (msg.hasSimpleContent()) {
LINE NUMBER: 123
DETAILS: TypeError: Cannot call method "getTime" of null
at fe0115da-a468-4d29-926b-a427260e0c6e:123 (doTransform)
at fe0115da-a468-4d29-926b-a427260e0c6e:147 (doScript)
at fe0115da-a468-4d29-926b-a427260e0c6e:149
at com.mirth.connect.server.transformers.JavaScriptFilterTransformer$FilterTransformerTask.doCall(JavaScriptFilterTransformer.java:154)
at com.mirth.connect.server.transformers.JavaScriptFilterTransformer$FilterTransformerTask.doCall(JavaScriptFilterTransformer.java:119)
at com.mirth.connect.server.util.javascript.JavaScriptTask.call(JavaScriptTask.java:113)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Where should i write code to get the response time of "Source" ? If i write the code in the "Source" transformer , the channel will report an error.
my code in "Source" transformer :
Error Message:
Beta Was this translation helpful? Give feedback.
All reactions