Click Configure > EVENTS > Complex.
Click Create Complex Event.
- Provide the name and description of the new Complex Event activity in the Name and Description text boxes.

Write the java code in the Script text box. Click Help link (above Script text box) to view the sample code.
- Select the date on which Complex event will stop triggering in the Event Expiry Date. The date must be in MM/dd/yyyy format. Click the Calendar icon and select the required date from the calendar.
- Provide the expiry time in the Time field.
Provide the time interval when the event checks the database Server in the Polling Frequency. Enter the digit in the Frequency field and select the unit of time, that is, seconds, minutes or hours from the Duration.
Expand Advanced Properties to view the advanced properties of Complex Event.

Type the email id in the Notification Receiver Email-ID(s) (comma separated) to receive error emails related to this complex event.
If you want to enable misfire handling for your complex event then select the Run Once option in the Action on Misfire Event field. If you do not wish to enable misfire handling for your file event then select the Ignore Misfire option.
Select the Project in the Project field.
Click Save.