I'm still having trouble getting a variable to work as a part of the variable name, if that is what you mean - I've tried it with {JOB(Active,Name)}, and {JOB(Active,Id)}.
This is what happens when using {JOB(Active,Id)}
1) Set up two variables with the names {USERVAR(IF_FOLDER_{JOB(Active,Id)}) and {USERVAR(IF_FILE_{JOB(Active,Id)})}, with no assigned value.
2) Set up a test job to copy the file from one location to another. The first two tasks in the job assign the values to the above variables that will be used just for this job, and the third task does the copy.
3) The copy task is set up like this:
Source Folder:
{USERVAR(IF_Path)}{USERVAR(IF_FOLDER_{JOB(Active,Id)})}\
FileName:
{USERVAR(IF_FILE_{JOB(Active,Id)})}
Destination Folder:
{USERVAR(IF_Path)}{USERVAR(IF_FOLDER_{JOB(Active,Id)})}\{DATEFORMAT(yyyyMMdd)}\
Where,
{USERVAR(IF_Path)} = \\servername\foldername\ (global variable - this works fine, when not used in conjunction with these user variables)
{USERVAR(IF_FOLDER_{JOB(Active,Id)})} = Client Folder Name (Unique folder name, contains spaces, does not include the backslash for the path)
{USERVAR(IF_FILE_{JOB(Active,Id)})} = FileName (No spaces, no extension)
This is the error from the copy task:
1/12/2009 7:24:36 PM Err Unhandled exception in Task: The given path's format is not supported.
I don't see a way to directly see what VC is reading for the variables, since there is no output for the copy, just the error, and the value preview pane doesn't help in this case (more below.)
One that that looks strange is that for the output for the two "set variable" tasks, I see the following output:
Variable 'IF_FOLDER_0c4bb7da-5e55-4414-9793-a9b3ef935d3c' was added.
Variable 'IF_FILE_0c4bb7da-5e55-4414-9793-a9b3ef935d3c' was added.
However, if I look in the list of user variables after the job runs, I don't see variables with those names - I would have thought that running the set variable task would have added variables with those names to the list of user-defined variables?
When I look at the variables that I set originally, when I look in the value preview pane, I see the following:
{USERVAR(IF_FILE_{JOB(Active,Id)})} = User Variable not found: IF_FILE_0c4bb7da-5e55-4414-9793-a9b3ef935d3c
{USERVAR(IF_FOLDER_{JOB(Active,Id)})} = User Variable not found: IF_FOLDER_0c4bb7da-5e55-4414-9793-a9b3ef935d3c
Given that I don't actually see user variables added for IF_FILE_0c4bb7da-5e55-4414-9793-a9b3ef935d3c and IF_FOLDER_0c4bb7da-5e55-4414-9793-a9b3ef935d3c, in spite of the output in the set variable task that says that they were created, the error message makes sense - but I think it should have added those variables to the list of variables, right? If I do an edit on the variables {USERVAR(IF_FILE_{JOB(Active,Id)})} and {USERVAR(IF_FOLDER_{JOB(Active,Id)})}, I do see the values that the task set for those variables - but that doesn't help, since I'm trying to create the unique variables for this job IF_FILE_0c4bb7da-5e55-4414-9793-a9b3ef935d3c and IF_FOLDER_0c4bb7da-5e55-4414-9793-a9b3ef935d3c.
Edited by user
2009-01-13T08:37:32Z
|
Reason: Not specified