Community forum

Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


ErikC
  •  ErikC
  • Paid support Topic Starter
2012-04-05T09:12:29Z
Hi,

I want to copy file from directories where the directory names come from a loop.
If I do this I receive the following exception:

Exception in Task: Could not find a part of the path 'G:\xxxx\[Current context (running Task) is not in a loop]'.
Exception in Task: No file(s) copied

That's strange because the copy task is in the loop.
The sourcefolder includes the {LOOP(CurrentValueX)} variable to get the current value (just as the other tasks in the loop).

Am I making a mistake here?

Regards,
Erik
Uses Visualcron since 2006.
Sponsor
Forum information
Support
2012-04-05T09:13:53Z
Could you export a sample Job and send to us?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
ErikC
  •  ErikC
  • Paid support Topic Starter
2012-04-05T09:33:04Z
done
Uses Visualcron since 2006.
ErikC
  •  ErikC
  • Paid support Topic Starter
2012-04-05T09:53:58Z
Looks like it has to do with my file mask.

I have now a variable in there. It's an output of a .net task showing the last month/year in mmmyy format.
If I use *.* the task runs fine..

Regards,
Erik
Uses Visualcron since 2006.
Support
2012-04-05T09:54:52Z
Originally Posted by: ErikC 

Looks like it has to do with my file mask.

I have now a variable in there. It's an output of a .net task showing the last month/year in mmmyy format.
If I use *.* the task runs fine..

Regards,
Erik



We haven't had a time to look at this yet. Is this still a bug?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
ErikC
  •  ErikC
  • Paid support Topic Starter
2012-04-05T10:46:07Z
I think this is still an issue yes,

The include file mask can look like this, right?

*_DETAIL_OZ_{TASK(68e9e286-c338-4e9e-b564-44b0ddddb5c2,StdOut)}.csv

If I remove the {TASK...} than it works, but I copy too much files.
I have to use a variable here. Variables in a file mask are allowed right?

Regards,
Erik
Uses Visualcron since 2006.
Support
2012-04-05T10:47:32Z
Originally Posted by: ErikC 

I think this is still an issue yes,

The include file mask can look like this, right?

*_DETAIL_OZ_{TASK(68e9e286-c338-4e9e-b564-44b0ddddb5c2,StdOut)}.csv

If I remove the {TASK...} than it works, but I copy too much files.
I have to use a variable here. Variables in a file mask are allowed right?

Regards,
Erik



Yes, but I think you need to analyze the output of that Task in a text editor so that it does not contain any new lines or not allowed characters. I recommend writing it to a file and check in Notepad++.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
ErikC
  •  ErikC
  • Paid support Topic Starter
2012-04-05T10:58:57Z
I used the file write task to check this.

The value of the .net output of the task I need is: MRT12

If I put in:

{TASK(68e9e286-c338-4e9e-b564-44b0ddddb5c2,StdOut)}{TASK(68e9e286-c338-4e9e-b564-44b0ddddb5c2,StdOut)}

I have in my output file this line:

MRT12MRT12

So it looks no funny characters and no linebreak.
Must be something else.

Regards
Erik
Uses Visualcron since 2006.
ErikC
  •  ErikC
  • Paid support Topic Starter
2012-04-05T11:27:01Z
Strange...

If I use the filemask:

*_DETAIL_OZ_*{DATEFORMAT(yy)}.csv

It works fine, but I copy too much files, so variables are allowed.

If I'm using the regex and use the following:

.*_DETAIL_OZ_{TASK(68e9e286-c338-4e9e-b564-44b0ddddb5c2,StdOut)}\.csv

I still reveice the same error. So it looks like somekind of .net task output problem?

Regards
Erik
Uses Visualcron since 2006.
Support
2012-04-05T11:44:27Z
Could you write the output to a file and send the file to us?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
ErikC
  •  ErikC
  • Paid support Topic Starter
2012-04-05T11:53:18Z
done
Uses Visualcron since 2006.
Support
2012-04-05T13:09:40Z
Originally Posted by: ErikC 

Hi,

I want to copy file from directories where the directory names come from a loop.
If I do this I receive the following exception:

Exception in Task: Could not find a part of the path 'G:\xxxx\[Current context (running Task) is not in a loop]'.
Exception in Task: No file(s) copied

That's strange because the copy task is in the loop.
The sourcefolder includes the {LOOP(CurrentValueX)} variable to get the current value (just as the other tasks in the loop).

Am I making a mistake here?

Regards,
Erik



I tried using different Variables but I never got the error above. It should only occur if you use any LOOP Variable outside of a loop.

I had to simplify your sample as I do not know what the executables do and the exact output. I will send you my simplified example and maybe you can tell the difference.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
ErikC
  •  ErikC
  • Paid support Topic Starter
2012-04-05T14:00:40Z
Hi Henrick,

I looked at the job you sended me.

There is a difference here. You are using the output of the .NET task as the looping source. I'm having an other task for this.
This task is a dir listing task. The output is a list of directory names.

In every directory listed there are files names [prefix]_DETAIL_OZ_[mmmyy].csv
The mmmyy is made by the .NET task.

In the file copy I need to copy all the matching files from a particular directory into an other temp directory for further processing.
That's why I need the output of the .NET task as a file mask.

I tried this also in the current 6.1.0 beta version and same issue:

Exception in Task: Could not find a part of the path 'F:\temp\[Current context (running Task) is not in a loop]'.
Exception in Task: No file(s) copied


Here a quick setup of the three tasks:

1. command task.
command: c:\windows\system32\cmd.exe
Arguments: /c dir /b /A:D /O:N
working dir: f:\temp
2. .NET task giving the last month year combination in mmmyy
3. copy file task
source folder: F:\temp\{LOOP(CurrentValueX)}
Include file mask: *{TASK([id of task2],StdOut)}.txt
destination folder: f:\test

Looping on the 3rd task with the for each on the output of the 1st task.


This should give you the same error.

Regards
Erik
Uses Visualcron since 2006.
Support
2012-04-05T14:02:15Z
I think we should use the chat because that might be faster in this case.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
trevinom
2012-04-08T06:49:07Z
I would like to know what the outcome of this was.
Support
2012-04-09T09:04:21Z
Originally Posted by: trevinom 

I would like to know what the outcome of this was.



The problem was a bug that could occur if two Variables were used in one Task where one of the Variables is a loop Variable. This could cause a confusion of which was the current Task and refer to the wrong one. We have made a fix for this and will publish this fix in the beta 6.1.0 later today.

Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
ErikC
  •  ErikC
  • Paid support Topic Starter
2012-04-10T07:52:01Z
Looks like it is fixed in the 6.1.0 beta.

Thanks!


Regards,
Erik
Uses Visualcron since 2006.
Scroll to Top