cozy roc remote file list help

43 views
Skip to first unread message

Mike S

unread,
Jan 11, 2017, 10:01:34 AM1/11/17
to COZYROC
All,

we are trying to set up our jobs to look for a remote file if there is no file it will go to sleep. We are planning to use Cozy Roc remote file list check and push it to an object variable. 

The problem is it does not seem to be working it is probably a configuration issue.

Can you please check and advise? 

screenshot 1 shows the variable set up. 

We then have a script task with the following code in it to push the results to the screen :


 public void Main()
        {
            MessageBox.Show(Dts.Variables["User::CheckFile"].Value.ToString());
     Dts.TaskResult = (int)ScriptResults.Success;
        }


the problem is it shows the object as being empty which is not true as there are files in the directory. I know this works as we just changed a sent SFTP task to Remote file check we left all the variables the same except the results variable. 

Mike sherwood
       

screenshot1.PNG

Ivan Peev

unread,
Jan 11, 2017, 10:07:21 AM1/11/17
to COZYROC
Hi Mike,

What does the variable content show when you run the package in Debug mode in the Watch window ? Set a breakpoint immediately after you populate the variable content and inspect.

Mike S

unread,
Jan 11, 2017, 11:01:52 AM1/11/17
to COZYROC
Hi Ivan, 

We found out what the issue is. We changed the code to a list. Here is the code. I wanted to put this out there in case someone else in the future runs into this issue.

Public Sub Main()

 

        Dim list() As Object = Dts.Variables("User::RemoteFileList").Value

        If list.Length = 0 Then

            'Dts.TaskResult = ScriptResults.Failure

            Dts.Variables("User::ExistsFlag").Value = 0

        Else

            'Dts.TaskResult = ScriptResults.Success

            Dts.Variables("User::ExistsFlag").Value = 1

        End If

 

        Dts.TaskResult = ScriptResults.Success

    End Sub

Reply all
Reply to author
Forward
0 new messages