File events

You can customize the orchestration event conditions with file events to create a trigger in the workflow. When the event conditions met, it triggers the workflow and submits the associated tasks. You can customize the event conditions to create multiple triggers and extend the functionality.

Overview

You can configure the event conditions with the different types of file events. You can customize both mandatory and optional attribute filters to define specific conditions to trigger an event.

Enter the workflow definition in the following format and configure the attributes as per requirement to set up specific event conditions. The mandatory attribute filters that you need provide to configure the event are:
  • FileName
    Specify the name of the file and its file path that you want to monitor. The supported value type is string and the operator type is EQ. Wildcard characters are permitted.
    Restriction: If you want to start the event condition name with the prefix "in", ensure that the name is enclosed within double quotes.

    The singlePredicate property is enabled, so you can add a single value for the FileName attribute, and the value is case sensitive.

    For more information, see Event driven orchestration configuration attributes.

  • Workstation
    Specify the name of the workstation where you expect the file to be created and monitored. Only workstations created on HCL UnO agent are supported. The supported value type is string, and the operator type is EQ. Wildcard characters are not permitted.

    The multipleFilters property is disabled, and you can add the workstation attribute only once.

    For more information, see Event driven orchestration configuration attributes.

  • SampleInterval
    Specify a value in seconds as the polling interval. The workflow monitors the file for changes at these specified intervals. The supported value type is numeric, and the operator type is EQ.

    The multipleFilters property is disabled, and you can add the SampleInterval attribute only once.

    The singlePredicate property is enabled, and you can add a single value for the SampleInterval attribute.

    For more information, see Event driven orchestration configuration attributes.

The optional attribute filters that you can add to trigger the event only for specific scenarios are:
  • TimeStamp
    You can add this attribute if you want to trigger the workflow only when the event occurs within a specific range. You must provide the date and time in YYYY-MM-DDTHH:MM:SS format.

    The supported operators are GE, LE, GT, and LT.

  • HostName
    Specify a valid host name if you want to trigger the workflow only when the event occurs on a specific host. The supported value type is string, and the operator types are EQ and NE. Wildcard characters are permitted.

    The multipleFilters property is enabled, and if required, you can provide multiple values separated by a comma (,) for a single instance of the HostName attribute.

    Note: After saving the workflow, the workstation starts monitoring for changes within 30 seconds. You can check the status of the workstation to confirm. If it shows D, the latest set of event rules are deployed and monitoring starts.

Example

To create a workflow that triggers the tasks LS1 and LS2 when the following filters are satisfied,
  • /Users/username/file13.txt is created.
  • /Users/username/file14.txt is modified.
  • /Users/username/file15.txt is deleted.
Enter the workflow definition as follows:
$jobstream

WORKFLOW /UNO_AGT#/JS_EVT_TRIGGER
  DESCRIPTION "Event driven workflow"
  TRIGGER TRIGGER_1 DESCRIPTION "Trigger_LS1_and_LS2" TIMEOUT PT2M 
    CONDITIONS
    NAME EC_CREATE TYPE "FileMonitor/FileCreated"  
    FILTERS 
    FileName = /Users/username/file13.txt, Workstation = UNO_AGT, SampleInterval = 1
    NAME EC_UPDATE TYPE "FileMonitor/ModificationCompleted"  
    FILTERS 
    FileName = /Users/riyas/username/file14.txt, Workstation = HCL_AGENT-LNX, SampleInterval = 1
    NAME EC_DELETE TYPE "FileMonitor/FileDeleted"  
    FILTERS 
    FileName = /Users/username/file15.txt, Workstation = UNO_AGT, SampleInterval = 1
  ENDTRIGGER
:
  /WS_AGT_0#/LS1
  /WS_AGT_0#/LS2
END