Event Rules are based on a simple premise: an event occurs that triggers an action. Beyond that, you can specify conditions that must exist before an action is taken or that change the action that is taken. For example, suppose you have a folder in which customers can drop files. You can set up an Event Rule that monitors that folder, and when someone puts a file into that folder, EFT Server will encrypt that file, move it into another folder, perhaps a safer location, and then send e-mails to anyone you specify informing them that a file has been moved. You can also set up a rule that only moves particular files. For example, you can configure the rule to move only the files with "Important" in the name, or you can route particular files to different folders.
Event Rules consist of triggering Events, any optional Conditions affecting the Event Rule, and the resulting Actions that are carried out. You can modify your rules any time in the Administrator.
While you can have two administrators working on Event Rules at the same time, if they are working on the same rule at the same time, when they save their rule, the second administrator to save will get a notice that the changes could not be saved because the system changed underneath them. They then need to refresh to see the other changes, and then make their changes to the rule again |
You can easily create complex programmatic events using EFT Server’s Event Rules. The Event Rule system contains objects that you simply click to add to the Rule builder, then click in the Rule to modify parameters and add variables. Below are some examples of logic you can create (in pseudo code).
("ON FILE UPLOAD" is the Event, the "if" statements are Conditions, and the "PGP," "UNZIP," "MOVE," and "SEND NOTIFICATION" are the resulting Actions.)
Always run an Action if an Event occurs:
ON FILE UPLOAD { PGP Encrypt %FS.FILE_PATH% } |
Conditionally run an Action if an Event occurs (IF-THEN statement):
ON FILE UPLOAD { if ( %FS.FILE_NAME% = "*.pgp" ) { PGP Decrypt %FS.FILE_PATH% } } |
Multiple IF-THEN statements (if something, do this; if something else, do that):
ON FILE UPLOAD { if ( %FS.FILE_NAME% = "*.pgp" ) { PGP Decrypt %FS.FILE_PATH% } if ( %FS.FILE_NAME% = "*.zip" ) { UNZIP %FS.FILE_PATH% to "%FS.FILE_PATH%\%EVENT.DATE%_%EVENT.TIME%\" } } |
Else statements (if preceding condition is not met, do something):
ON FILE UPLOAD { if ( %FS.FILE_NAME% = "*.pgp" ) { PGP Decrypt %FS.FILE_PATH% } if ( %FS.FILE_NAME% = "*.zip" ) { UNZIP %FS.FILE_PATH% to "%FS.FILE_PATH%\%EVENT.DATE%_%EVENT.TIME%\" } else { MOVE %FS.FILE_PATH% to "%FS.FILE_PATH%\%EVENT.DATE%_%EVENT.TIME%\" } } |
Run always action (action that will always run when the event occurs even if preceding IF-THEN-ELSE statements are true):
ON FILE UPLOAD { if ( %FS.FILE_NAME% = "*.pgp" ) { PGP Decrypt %FS.FILE_PATH% } else { MOVE %FS.FILE_PATH% to "%FS.FILE_PATH%\%EVENT.DATE%_%EVENT.TIME%\" } MOVE "%FS.FILE_PATH%\%EVENT.DATE%_%EVENT.TIME%\*.*" to https://somehost/%USER.LOGON%/ SEND NOTIFICATION e-mail TO %user.e-mail% } |
Run the same action more than once:
ON FILE UPLOAD { SEND NOTIFICATION e-mail TO serveradmin@globalscape.com SEND NOTIFICATION e-mail TO %user.e-mail% } |
Create compound conditional statements supporting AND and OR logical operators:
ON FILE UPLOAD { if ( %FS.FILE_NAME% = "*.pgp" ) || ( %FS.FILE_NAME% = "*.encrypted" ) { PGP Decrypt %FS.FILE_PATH% } else { MOVE %FS.FILE_PATH% to "%FS.FILE_PATH%\%EVENT.DATE%_%EVENT.TIME%\" } SEND NOTIFICATION e-mail TO %user.e-mail% } |
It is possible to configure Event Rules that create infinitely recursive cycles. Since all Event Rules operate synchronously, a file upload event cannot be completed until all corresponding event actions are finished. This could lead to unpredictable server behavior due to conflicts with shared access to the same files or deleting open files. Be careful not to create circumstances where such recursive cycles might occur. For file upload events, recursive cycles are not typical. It is recommended that you move files on the same server using the filesystem - not FTP. |