|
Home > Archive > BizTalk Server Applications Integration > August 2005 > File Transport Issue
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
File Transport Issue
|
|
|
| Hi all,
I am trying to pickup a file dropped off by BTS 2004, and then move it to a
new location. I have created a simple file watcher service to do this (see
code below). This works great if I manually drop a file in the source
folder. However, if BTS puts the file there, nothing happens. Any hints as
to why would be great. The file is being dropped by a file send port, using
a custom HIPAA pipeline, along with a HIPAA send port, using PassThruTransmit
pipe. Thanks.
John
Private SrcPath As String = "D:\BTS\CLAIMS\Claim_OUT\"
Private CIGNATgtPath As String = "D:\BTS\CLAIMS\Claim_OUT\DOODAD\CIGNA\"
Private CTCareTgtPath As String
=" D:\BTS\CLAIMS\Claim_OUT\DOODAD\CONNECTIC
ARE\"
Protected Overrides Sub OnStart(ByVal args() As String)
Me.FileSystemWatcher1.Path = SrcPath
Me.FileSystemWatcher1.EnableRaisingEvents = True
End Sub
Protected Overrides Sub OnStop()
' Add code here to perform any tear-down necessary to stop your
service.
Me.FileSystemWatcher1.EnableRaisingEvents = False
End Sub
Protected Overrides Sub OnContinue()
Me.FileSystemWatcher1.Path = SrcPath
Me.FileSystemWatcher1.EnableRaisingEvents = True
End Sub
Protected Overrides Sub OnPause()
Me.FileSystemWatcher1.EnableRaisingEvents = False
End Sub
Private Sub FileSystemWatcher1_Created(ByVal sender As Object, ByVal e
As System.IO.FileSystemEventArgs) Handles FileSystemWatcher1.Created
If e.ChangeType = WatcherChangeTypes.Created Then
Me.FileSystemWatcher1.Filter = "*.837"
If e.Name.StartsWith("62308") Then
TransportFiles(e.Name, CIGNATgtPath)
ElseIf e.Name.StartsWith("06105") Then
TransportFiles(e.Name, CTCareTgtPath)
End If
End If
End Sub
Private Sub TransportFiles(ByVal strFileName As String, ByVal destPath
As String)
Try
Dim strDestfileName As String = destPath & strFileName
If File.Exists(strDestfileName) Then File.Delete(strDestfileName)
File.Move(SrcPath + strFileName, strDestfileName)
Catch ex As Exception
Throw New ApplicationException("The Doodad Claim File Management
Service threw the following exception: " & ex.ToString)
End Try
End Sub
--
John
| |
| yves dot peneveyre at ctp dot com 2005-08-05, 2:48 am |
| Hello John,
I think it is not a BTS issue, because I wrote such a watcher service and an asp.net
web application to put files in the source directory and it was not working.
As if the FileSystemWatcher did not see the file drop.
So, if anyone had this issue and solved it, I would be interrested to know how.
Best Regards
Yves Peneveyre
[vbcol=seagreen]
Hi all,
I am trying to pickup a file dropped off by BTS 2004, and then move it to a
new location. I have created a simple file watcher service to do this (see
code below). This works great if I manually drop a file in the source
folder. However, if BTS puts the file there, nothing happens. Any hints as
to why would be great. The file is being dropped by a file send port, using
a custom HIPAA pipeline, along with a HIPAA send port, using PassThruTransmit
pipe. Thanks.
John
Private SrcPath As String = "D:\BTS\CLAIMS\Claim_OUT\"
Private CIGNATgtPath As String = "D:\BTS\CLAIMS\Claim_OUT\DOODAD\CIGNA\"
Private CTCareTgtPath As String
=" D:\BTS\CLAIMS\Claim_OUT\DOODAD\CONNECTIC
ARE\"
Protected Overrides Sub OnStart(ByVal args() As String)
Me.FileSystemWatcher1.Path = SrcPath
Me.FileSystemWatcher1.EnableRaisingEvents = True
End Sub
Protected Overrides Sub OnStop()
' Add code here to perform any tear-down necessary to stop your
service.
Me.FileSystemWatcher1.EnableRaisingEvents = False
End Sub
Protected Overrides Sub OnContinue()
Me.FileSystemWatcher1.Path = SrcPath
Me.FileSystemWatcher1.EnableRaisingEvents = True
End Sub
Protected Overrides Sub OnPause()
Me.FileSystemWatcher1.EnableRaisingEvents = False
End Sub
Private Sub FileSystemWatcher1_Created(ByVal sender As Object, ByVal e
As System.IO.FileSystemEventArgs) Handles FileSystemWatcher1.Created
If e.ChangeType = WatcherChangeTypes.Created Then
Me.FileSystemWatcher1.Filter = "*.837"
If e.Name.StartsWith("62308") Then
TransportFiles(e.Name, CIGNATgtPath)
ElseIf e.Name.StartsWith("06105") Then
TransportFiles(e.Name, CTCareTgtPath)
End If
End If
End Sub
Private Sub TransportFiles(ByVal strFileName As String, ByVal destPath
As String)
Try
Dim strDestfileName As String = destPath & strFileName
If File.Exists(strDestfileName) Then File.Delete(strDestfileName)
File.Move(SrcPath + strFileName, strDestfileName)
Catch ex As Exception
Throw New ApplicationException("The Doodad Claim File Management
Service threw the following exception: " & ex.ToString)
End Try
End Sub
--
John
| |
|
| Amidst all of the 'My nice girlfriend', rhinestones, and lambskin that
pollute this newsgroup, can anyone actually answer my question please?
--
John
"JT" wrote:
> Hi all,
> I am trying to pickup a file dropped off by BTS 2004, and then move it to a
> new location. I have created a simple file watcher service to do this (see
> code below). This works great if I manually drop a file in the source
> folder. However, if BTS puts the file there, nothing happens. Any hints as
> to why would be great. The file is being dropped by a file send port, using
> a custom HIPAA pipeline, along with a HIPAA send port, using PassThruTransmit
> pipe. Thanks.
>
> John
>
> Private SrcPath As String = "D:\BTS\CLAIMS\Claim_OUT\"
> Private CIGNATgtPath As String = "D:\BTS\CLAIMS\Claim_OUT\DOODAD\CIGNA\"
> Private CTCareTgtPath As String
> =" D:\BTS\CLAIMS\Claim_OUT\DOODAD\CONNECTIC
ARE\"
>
> Protected Overrides Sub OnStart(ByVal args() As String)
>
> Me.FileSystemWatcher1.Path = SrcPath
>
> Me.FileSystemWatcher1.EnableRaisingEvents = True
>
> End Sub
>
> Protected Overrides Sub OnStop()
> ' Add code here to perform any tear-down necessary to stop your
> service.
> Me.FileSystemWatcher1.EnableRaisingEvents = False
> End Sub
> Protected Overrides Sub OnContinue()
>
> Me.FileSystemWatcher1.Path = SrcPath
>
> Me.FileSystemWatcher1.EnableRaisingEvents = True
>
> End Sub
>
> Protected Overrides Sub OnPause()
> Me.FileSystemWatcher1.EnableRaisingEvents = False
> End Sub
>
>
> Private Sub FileSystemWatcher1_Created(ByVal sender As Object, ByVal e
> As System.IO.FileSystemEventArgs) Handles FileSystemWatcher1.Created
>
> If e.ChangeType = WatcherChangeTypes.Created Then
>
> Me.FileSystemWatcher1.Filter = "*.837"
>
> If e.Name.StartsWith("62308") Then
> TransportFiles(e.Name, CIGNATgtPath)
> ElseIf e.Name.StartsWith("06105") Then
> TransportFiles(e.Name, CTCareTgtPath)
> End If
>
> End If
>
> End Sub
>
> Private Sub TransportFiles(ByVal strFileName As String, ByVal destPath
> As String)
>
> Try
>
> Dim strDestfileName As String = destPath & strFileName
>
> If File.Exists(strDestfileName) Then File.Delete(strDestfileName)
>
> File.Move(SrcPath + strFileName, strDestfileName)
>
> Catch ex As Exception
> Throw New ApplicationException("The Doodad Claim File Management
> Service threw the following exception: " & ex.ToString)
> End Try
>
> End Sub
> --
> John
| |
| WenJun Zhang[msft] 2005-08-12, 7:51 am |
| Hi John,
I agree with Yves, this should not be a biztalk issue. Maybe you'd
check the permission of files sent by Biztalk file adapter.
Also I think you may consider doing the task via WMI query, use
ManagementEvenWatcher resides in the System.Management namespace. The
WMI notification query should be like:
select * from __instancemodificationevent within 10 where
targetinstance ISA cim_datafile and
cim_datafile.name="c:\\filereceivedir"
Thanks.
Best regards,
WenJun Zhang
Microsoft Online Partner Support
This posting is provided "AS IS" with no warranties, and confers no
rights.
|
|
|
|
|