Combining Action Strings |
Top Previous Next |
|
A script line can contain multiple action strings separated by |||.
Whether action strings are on the same line separated by ||| or whether they are on multiple lines in the script that are triggered by matching tests, by default if even ONE action string fails, the entire set of actions for that file will be marked as failed and needing to be re-run later.
For example, this action script uses a single line to perform two actions: IMAGE ||| run convert.exe %filepath% %filepath%.png ||| run emailme.exe %filepath%.png If the emailme.exe process fails, the entire line, including the conversion, will be marked as having failed and needing to be re-queued.
The same behavior will occur if we do: IMAGE ||| run convert.exe %filepath% %filepath%.png IMAGE ||| run emailme.exe %filepath%.png
If either action fails, all will be marked as failing and needing to be re-run.
However, if you want to isolate one or more action strings from subsequent ones, so that if they succeed they will be considered finished and will not be marked as neeting to be re-run if future actions fail, use the CHECKPOINT action string.
For example:
IMAGE ||| run convert.exe %filepath% %filepath%.png ||| checkpoint IMAGE ||| run emailme.exe %filepath%.png
In this case, if the email fails, it will not cause the conversion to be marked as failed, and only the email attempt will be marked as needing to be re-run.
BUT Note that if the first line (the conversion) fails, the subsequent line (the email) will still be attempted(!), because it is now treated as an independent action.
SO, in this case if you want to mark a checkpoint that will fail all subsequent action lines (until end of script lines for a file or until next pure checkpoint) you can use the action string CHECKPOINTF (meaning checkpoint-forward).
So for example:
IMAGE ||| run convert.exe %filepath% %filepath%.png ||| checkpointf IMAGE ||| run emailme.exe %filepath%.png
In this case, if the first convert command succeeds, it will be marked as finished and done, regardless of what happens with the email command. If it fails, all commands will be considered failed. If the second email command fails, it will only mark itself as having failed.
So CHECKPOINT isolates failures from sections, while CHECKPOINTF has the effect of marking a point at which above failure taints all future actions but future actions won't reach back up above it.
NOTE: |