Run PDMShell Scripts from Workflow Transitions
A workflow transition can start pdmcli.exe as an external command. For direct PDM event handling, use a PDMShell add-in trigger, which supplies the affected item's event context. Scripts are edited in standalone PDMShell.
If your transition launches a PDMShell PDM task, configure multi-file handling in that task's properties. For one ECO per drawing, see Transition two drawings.
Configure the external command
- Choose Execute Command as the transition action.
- In Enter command to execute, enter the full path of your installed
pdmcli.exe, followed by the script arguments. Find the executable through the PDMShell shortcut. - Enable Wait until the started program terminates when the transition must wait for completion.
Command pattern:
"C:\Path\To\pdmcli.exe" runscript -source "C:\Scripts\Inspect.pdmshell" -filePath "<affected file path>"
Replace <affected file path> with the appropriate file-path substitution provided by your PDM action. It is explanatory text, not a PDMShell placeholder. Confirm that the action passes a complete file path. The script must be readable on the executing computer, and PDMShell must connect to the vault under the intended account.
Write the script
Use $localPath inside the script to refer to that target:
fileinfo -filePath "$localPath"
quit -silent
Replace fileinfo with the commands your workflow needs, keeping the target argument on commands that act on the file. See RUNSCRIPT for selection, placeholders and execution order.
Completion and failures
The standalone process returns 0 for success or 1 if a command/script failed or was canceled. A later successful command does not clear a failure. quit -silent closes the application when execution reaches that line; if the script stops earlier, the application can remain open.
Do not use -single when the caller must wait for and inspect the script result. The forwarding process does not wait for the script in the receiving window. See command-line startup.
Transition information
Passing -filePath supplies a file context, not an event snapshot. It does not populate $fromState, $toState or $transition. Use an add-in event script when those values are needed; see event placeholders.
For values stored on the file, use PDM variable expressions such as $(Description.@). RUNSCRIPT does not define arbitrary positional parameters for extra transition values.