Deleted Event
- Last UpdatedJul 25, 2023
- 3 minute read
The Deleted event gets triggered, when a file is deleted from the folder to be monitored.
To trigger the deleted event
-
In the Enterprise Console, click the Menu button, and then click Workflows. The Workflows page appears.
-
Select the workflow to be associated, and then click Associate.
-
Click FileWatcher to associate the workflow with a new file watcher event.
-
In the Event Type drop-down list, select Deleted.
-
In the Event Folder drop-down list, select the folder to be monitored.
-
In the File Name/Pattern box, enter a file type. For example, .txt, .doc. Use * for all file patterns. You can also mention a specific file, such as sample.txt.
If the file pattern is mentioned, then the File Watcher triggers an event only for files that match with the file pattern and ignores all other files that might arrive at the same time. This field is not mandatory. If the file pattern is not mentioned, File Watcher triggers an event for all file patterns. -
Click the calendar icon to select the Effective From and Effective To dates. The event will be triggered for changes in the folder to be monitored only during this period. These two field are not mandatory.
-
In the Workflow Version drop-down list, select version of the workflow which should get triggered for the 'Deleted' event. By default, Latest is selected. This field is not mandatory.
-
Click Attach Event.
-
Click OK in the confirmation dialog box.
Example 1
In this example, the file type is not specified. So the Deleted Event will be triggered for all file types.
-
Create a new folder in the local drive. For example, create a folder called 'FileWatcher' in 'C' drive.
-
Add the folder to the File Watcher list through Add Folder.
-
Create a workflow called 'DeletedEventWF'.
-
Design the 'DeletedEventWF' workflow with an Approval activity. Configure the Activity Properties for the same.
-
Publish the workflow.
-
Select 'DeletedEventWF' from the Workflows list, and then click Associate.
-
Click FileWatcher to associate the workflow with a new file watcher event.
-
In the Event Type drop-down list, select Deleted.
-
In the Event Folder drop-down list, select the monitoring folder 'C:\FileWatcher'.
-
Leave the File Name/Pattern box empty.
-
Click the calendar icon to select the Effective From and Effective To dates if you want the event to be triggered only for a specific period. These two fields are not mandatory.
-
Click Attach Event.
-
Click OK.
-
Go to C:\FileWatcher, delete a file Sample.doc'.
As soon as the 'Sample.doc' file is deleted in 'C:\FileWatcher', the workflow gets triggered. The approval activity will be assigned to the specified actor.
-
To check the Work items list, click Inbox.
Example 2
In this example, the file name is specified. The Deleted event will be triggered only for the specified file.
-
Create a new folder in the local drive. For example, create a folder called FileWatcher in 'C' drive.
-
Add the folder to the File Watcher list through Add Folder.
-
Create a workflow called DeletedEventWF.
-
Design the DeletedEventWF workflow with an Approval activity. Configure the Activity Properties for the same.
-
Publish the workflow.
-
Select 'DeletedEventWF' from the Workflows list, and then click Associate.
-
Click FileWatcher to associate the workflow with a new file watcher event.
-
In the Event Type drop-down list, select Deleted.
-
In the Event Folder drop-down list, select the monitoring folder 'C:\FileWatcher'.
-
In the File Name/Pattern text box, enter the file name as 'File.txt'.
-
Click Attach Event.
-
Click OK.
-
Go to C:\FileWatcher path, delete a file 'File.txt'.
As soon as a file 'File.txt' is deleted in the 'C:\FileWatcher', the workflow gets triggered. The approval activity will be assigned to the specified actor.
-
To check the Work items list, click Inbox.