Introduction to Event Rules

EFT Server has extensive automation capabilities that you can set up and modify using Event Rules. You can create and implement an Event Rule in seconds.

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 EFT Administrator.

Sample Logic

You can easily create complex programmatic events using EFT Server’s Event Rules. Below are some examples of logic you can create (in pseudo code).

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 equate to 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 ghoffer@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.