Changed Event
- Last UpdatedJul 25, 2023
- 3 minute read
The Changed event gets triggered when an existing file is replaced in the folder to be monitored.
To trigger changed 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 Changed.
-
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.
Note: If file pattern is mentioned, the File Watcher triggers an event for only those 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, the 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 Version drop-down list, select the version of the workflow which should get triggered for the Changed 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 Changed Event gets 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 ChangedEventWF.
-
Design the ChangedEventWF workflow with an Approval activity. Configure the Activity Properties for the same.
-
Publish the workflow.
-
Select ChangedEventWF 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 Changed.
-
In the Event Folder drop-down list, select the folder to be monitored 'C:\FileWatcher'.
-
Click Attach Event.
-
Click OK.
-
Go to C:\FileWatcher. Copy a file with the same name, that is 'sample.txt'. A file called sample.txt should exist in the folder.
-
As soon as the new file overwrites the existing file 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 and type is specified. The Changed Event gets 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 'ChangedEventWF'.
-
Design the 'ChangedEventWF' workflow with an Approval activity. Configure the Activity Properties for the same.
-
Publish the workflow.
-
Select 'ChangedEventWF' 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 Changed.
-
In the Event Folder drop-down list, select the folder to be monitored 'C:\FileWatcher'.
-
In the File Name/Pattern box, enter the file name as 'File.txt'.
-
Click Attach Event.
-
Click OK.
-
Go to C:\FileWatcher and overwrite a file with the name 'File' which is of type .txt.
-
As soon as the new file overwrites the existing 'File.txt' 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.