有没有办法取消 Mirth Channel 目标文件编写器?

Is there a way to cancel a Mirth Channel destination file writer?

有没有办法在没有返回数据时取消 Mirth Channel 目标文件编写器。我不想每次频道为 运行 时都创建一个文件。频道需要每 2-5 分钟 运行 来处理位于 sql 服务器的队列中的任何未决记录。

我正在使用 Mirth 频道查询 sql 服务器数据库并将数据输出为 CSV 文件。我正在使用 Mirth Connect 服务器 3.2.0.7628。

这是我在目标转换器上的脚本。 如果 result.Size() 不大于零,我试图跳过添加到 tmp。 在 Mirth Connect 文档中找不到此用例。

var dbConn = DatabaseConnectionFactory.createDatabaseConnection('net.sourceforge.jtds.jdbc.Driver','jdbc:jtds:sqlserver://xx.xx.x.xx:1433/<dbname>',<user>,<password>);

var result1 = dbConn.executeCachedQuery("exec [z_stored_procedure] param1");

var i = 0;  
if (result1.size()>0)   
{   logger.debug(result1.size())
    while(result1.next())
    {        
          tmp.row += <row>
           <DataField1>"{result1.getString('DataField1')}"</DataField1>
           <DataField2>"{result1.getString('DataField2')}"</DataField2>                                            
          </row>; 
      } 
}

dbConn.close();

您始终可以从处理邮件中排除该目的地。

For instance if a channel has many destinations and each message only needs to be processed by a single destination, by calling destinationSet.removeAllExcept(connectorName) in the source transformer, only that destination will receive the message. Those destinations will have no data stored and will not show up in the Message Browser. This is an alternative to filtering on each destination and can save processing time and disk space.

将您的代码放入目标 Filter 而不是 Transformer.

应该可以

在你的 if 语句之后,添加:

else {
return false;
}

如果您有数据,它将 运行 您的转换并将其传递给目标。 如果不这样做,它将过滤消息并且不对 Destination 执行任何操作。