Table of Contents

Conditions

Conditions let PDMShell decide whether something is true before continuing. The same condition style is used by:

Use conditions when a script needs to check file names, folder paths, PDM variables, placeholder values, process state, generated output files, or simple numeric comparisons.

For the complete context-aware placeholder tables, workflow/state tokens, function families, and copyable recipes, see IF statements and conditions. The shared text editor checks syntax automatically; a green check is not a runtime result. From 4.1.1, vault script-level gates opened in the main editor use that same dialog, with their existing support for blank gates and standalone boolean expressions preserved.

Basic Shape

A condition usually has three parts:

Part Example
Left value $fileName
Operator contains
Right value "ECO"

Example:

$fileName contains "ECO"

PDMShell evaluates the expression at runtime. If the condition is true, the waiting command, IF branch, or add-in script rule can continue.

Supported Operators

Operator Example
exists $localPath exists
equals, equal, is, =, == $revision equals "A"
not equals, !=, <> $fileName not equals "test.pdf"
contains $fileName contains "ECO"
starts with $fileName starts with "PRJ"
ends with $fileName ends with ".pdf"
matches, regex $fileName matches ".*\.pdf"
less than, < $version less than 5
less than or equal, <= $version less than or equal 5
greater than, > $version greater than 1
greater than or equal, >= $version greater than or equal 1

Exists Checks

Use exists to check files, folders, or processes.

$localPath exists
$folderPath\ready.pdf exists
file exists "$folderPath\ready.pdf"
folder exists "$folderPath"
process exists "notepad"

When the left side is not explicitly file, folder, or process, PDMShell treats it as a file check unless the value looks like a folder path.

PDM Variables

Use $(VariableName.ConfigurationName) to read a PDM variable from the current file context. Use .@ for the file @ tab. Folder variables can use $(VariableName) because folders do not use file configurations.

"$(Description.@)" contains "ECO"
"$(Revision.@)" equals "A"

For file data card variables, the .@ suffix is required when reading the file @ tab, for example $(Description.@). Bracketed text is literal and is not evaluated as a PDM variable.

Placeholders

Conditions can use PDMShell placeholders.

Common examples:

Placeholder Meaning
$fileName Current file name.
$filePath Current file path.
$folderName Current folder name.
$folderPath Current folder path.
$vaultName Current vault name.
$revision Current file revision when available.
$version Current file version when available.
Note

File-specific placeholders need file or folder context. In the Visual Code Editor, use a run option that provides selected items when the condition depends on a selected file or folder.

Checkout Conditions

For visual IF and until, compare the function's boolean result explicitly. This format also works in vault script conditions:

${isCheckedOut()} equals true
${isCheckedByMe()} equals true
${isCheckedOutByUsername("Admin")} equals true

Supply a file path to inspect a different file. Relative paths resolve from the current PDM folder:

${isCheckedOut("RelatedDrawing.slddrw")} equals true
${isCheckedOutByUsername("Admin", "$folderPath\RelatedDrawing.slddrw")} equals true
${checkedOutOnComputer()} equals "PDM-WORKSTATION"

These functions are available in visual IF statements, until, and PDMShell add-in conditions.

Combining Conditions

Use and, or, and parentheses to combine checks.

$folderPath\ready.pdf exists and $folderPath\ready.dxf exists

($folderPath\ready.pdf exists or $folderPath\ready.dxf exists) and "$(Description.@)" contains "Released"

Numeric Comparisons

Numeric expressions can be used on either side of a comparison.

1 + 3 greater than 3
2 * 5 equals 10
"$(Quantity.@)" greater than 0

Where Conditions Are Used

Feature How conditions are used
IF statements and conditions Choose between Conditions Met and Else paths.
until Wait until a condition becomes true or timeout is reached.
PDMShell add-in conditions Decide whether a configured add-in script should run.

Tips

  • Quote PDM variable expressions when they appear inside a larger condition.
  • Separate comparison operators with spaces: (1 + 1 = 2), not (1+1=2).
  • Use Expression Evaluator to test placeholder values before relying on them in a condition.
  • Keep conditions small and readable when possible.