A key feature of Switch is its ability to remember information about a job (file or job folder) while it is being processed through a flow. This information is stored in an internal job ticket managed by Switch.
The internal job ticket for each job contains housekeeping information (such as where the job was last located) in addition to information about the job's origin and routing.
For example, a job's hierarchy info and email info (attached by specific tools) are stored in its internal job ticket.
Switch needs a way to associate a particular internal job ticket with its corresponding job, and vice versa. To maximize flexibility and transparency for the user, Switch uses the filename as the basis for this mechanism rather than hiding jobs in some database. However Switch may be handed two or more jobs with the same name (in different input folders, or even in the same input folder after the first job was moved along).
Thus Switch employs a "trick" to keep similarly named jobs apart: unique name prefixes.
A job is associated with its internal job ticket by prefixing the file or folder name with a unique identifier that consists of five letters or digits preceded and followed by an underscore.
For example: "myjob.txt" may become "_0G63D_myjob.txt".
Note that the files inside a job folder are not renamed; only the job folder name receives the unique name prefix. When a job folder is disassembled into separate files, each of the files of course receives its own unique name prefix.
For the technically-minded: each of the five characters in the unique name prefix can be a digit (0-9) or an uppercase letter (A-Z). This allows 36^5 or about 60 million combinations. A different unique name prefix can be generated every second for about 23 months.
Switch generates a new unique name prefix (and a corresponding internal job ticket) when:
It detects a job in a folder or in a submit hierarchy.
It makes a copy of a job.
A producer (such as email receive) injects a new job in the flow.
A processor produces a secondary output job that is injected in the flow.
The primary output of a processor (i.e. the incoming job with any changes applied by the processor) retains the same unique name prefix as the incoming job.
When a job loses its unique name prefix (for example because the "strip unique name" property is set for an archive or a final folder), it also loses the association with its internal job ticket.
Switch can pass along a job from one flow to another without loosing the job's association with its internal job ticket (assuming both flows are being executed by the same instance of Switch; hand-over between different instances of Switch does not preserve the internal job ticket information at this time).
This feature enables splitting up a complex flow in smaller segments without losing any information.
To hand over jobs from flow A to flow B:
In flow A, create a user-managed folder with no outgoing connections and make sure its "strip unique name" property is set to No.
In flow B, create a user-managed folder with the same backing folder (the folder in flow B may or may not have incoming connections).
