Created Event
- Last UpdatedJul 25, 2023
- 3 minute read
The Created event gets triggered when the following actions are performed:
-
A new file is created in the folder to be monitored.
-
A new file is copied to the folder to be monitored.
To trigger a created 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 Created.
-
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 Created event. By default, Latest is selected. This field is not mandatory.
-
Click Attach Event.
-
Click OK in the confirmation dialog box.
Example 1:
In the following example, the file type is not specified. So the Created 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 CreatedEventWF.
-
Design the CreatedEventWF workflow with an Approval activity. Configure the Activity Properties for the same.
-
Publish the workflow.
-
Select CreatedEventWF 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 Created.
-
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.
-
Create a new file called sample.txt and save the same to C:\FileWatcher.
-
As soon as a new file is saved (created event) in 'C:\FileWatcher', the 'CreatedEventWF' workflow gets triggered. The approval activity will be assigned to the specified actor.
-
To check the Work items list, click Inbox.
Example 2:
In the following example, the file name and type is specified. The Created 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 CreatedEventWF.
-
Design the CreatedEventWF workflow with an Approval activity. Configure the Activity Properties for the same.
-
Publish the workflow.
-
Select CreatedEventWF 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 Created.
-
In the Event Folder drop-down list, select the monitoring folder 'C:\FileWatcher'.
-
In the File Name/Pattern text box, enter 'File.txt'.
-
Click Attach Event.
-
Click OK.
-
Go to C:\FileWatcher and create a new file called 'File.txt'.
-
As soon as a text file with the name 'File' is created 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.