Defining Variable for Archive Hierarchy
Posted: Thu Jun 23, 2022 6:07 pm
This is a simple question I hope. You cannot define variables for a path using the Archive Hierarchy flow element.
I am on a Mac. When writing files to a network volume, the path always begins as:
/Volumes
I came up with a way to include variables with Archive Hierarchy. The element uses the path as described above.
Before the Archive Hierarchy, I assign variables in Set Hierarchy Path.
This seems to work well. My files go to the correct destination.
My question is: what is wrong with doing this, if anything? I don't see any issues, but that doesn't make this flow structure a good idea.
To further test, I set up a flow where the network volume did not exist. As expected, the job went into the problem jobs folder. It didn't cause a major problem or a system crash.
I am hesitant to move forward with this solution, because Archive Hierarchy does NOT have the define variables option, and so there must be some reason.
Consider the path:
/Volumes/Jobs
Jobs, as seen on the Mac, is not a folder, it is a mounted network volume. When using Archive Hierarchy, Switch normally creates any folders in the path that are not already there.
So if Archive Hierarchy path is:
/Volumes
And you have a private data tag "TOP", defined as "Jobs"
Set Hierarchy preceding Archive Hierarchy uses the variable "{Job.PrivateData:Key="TOP"]
When the job reaches the Archive Hierarchy element, Switch is attempting to write the file to:
/Volumes/Jobs
If the network volume "Jobs" is mounted, the file goes on into "Jobs" with no issue.
If "Jobs" is not mounted on the Mac, Switch cannot create a folder on the level "/Volumes" and so the job goes into Problem Jobs, which is good.
Any problems with what I have described?
I am on a Mac. When writing files to a network volume, the path always begins as:
/Volumes
I came up with a way to include variables with Archive Hierarchy. The element uses the path as described above.
Before the Archive Hierarchy, I assign variables in Set Hierarchy Path.
This seems to work well. My files go to the correct destination.
My question is: what is wrong with doing this, if anything? I don't see any issues, but that doesn't make this flow structure a good idea.
To further test, I set up a flow where the network volume did not exist. As expected, the job went into the problem jobs folder. It didn't cause a major problem or a system crash.
I am hesitant to move forward with this solution, because Archive Hierarchy does NOT have the define variables option, and so there must be some reason.
Consider the path:
/Volumes/Jobs
Jobs, as seen on the Mac, is not a folder, it is a mounted network volume. When using Archive Hierarchy, Switch normally creates any folders in the path that are not already there.
So if Archive Hierarchy path is:
/Volumes
And you have a private data tag "TOP", defined as "Jobs"
Set Hierarchy preceding Archive Hierarchy uses the variable "{Job.PrivateData:Key="TOP"]
When the job reaches the Archive Hierarchy element, Switch is attempting to write the file to:
/Volumes/Jobs
If the network volume "Jobs" is mounted, the file goes on into "Jobs" with no issue.
If "Jobs" is not mounted on the Mac, Switch cannot create a folder on the level "/Volumes" and so the job goes into Problem Jobs, which is good.
Any problems with what I have described?