You are here: Automating Actions with Triggers > Adding triggers > Adding triggers to run executables

Adding triggers to run executables

Note: Pre-event triggers that run scripts can cause performance issues because the Surround SCM Server waits for the script to complete before moving to the next file. Post-event triggers should always be used to run scripts unless the trigger is used for validation. Even a 1 second pre-event script will significantly slow down the server because it takes an additional second per file that the trigger fires on.

You can run scripts and compiled programs from both pre- and post-event triggers. Surround SCM accepts any command line call.

If Surround SCM cannot find the script, an error is returned to the client and the action fails. In addition, if multiple triggers are associated with a file and one trigger fails, the remaining triggers do not run. The server administrator should make sure that the appropriate directory access permissions are set up for the script.

Scripts that run from pre-event triggers must return a value that tells the server whether or not the event should be allowed to complete. A return value of zero means that the event can continue. A non-zero return value means that the event should be not be performed. If a non-zero value is returned, any messages output by the script or program (output to stdout) are sent back to Surround SCM with the error. This error is truncated to 1024 characters.

Following are some examples of how to return a value from the trigger application:

1. Choose Tools > Administration > Triggers.

The Triggers dialog box opens.

2. Click Add.

The Add Trigger dialog box opens.

3. Enter a Trigger Name, select the Trigger When events, and select the Preconditions. See Adding triggers.

4. Click the Actions tab and click Add to add an action.

5. Select Run [executable] from the Action list.

6. Enter the full path to the Executable location and click OK.

7. Select Disable trigger after it runs once if you only want the trigger to run once.

8. Click OK to add the trigger.

 

Additional documentation  Knowledgebase  |  Blog  |  Technical support