Creating Expectations
An Expectation has three parts: the success criteria, the trigger and timing, and the scope of files to watch for.
Expectation Success Criteria
Success criteria define what a valid delivery looks like. Files.com evaluates the matched files against these rules when the window closes.
File-level validation rules check characteristics of the files being processed, such as the number of files, file names, extensions, and file sizes. Content Validation rules examine the data inside the files instead. You decide which rules apply to your Expectation.
The File Count rule specifies how many files are expected. It supports an exact number, a range, a minimum, or a maximum.
The File Size rule sets a size constraint on the combined set of matched files. It supports an exact size, a range, a minimum, or a maximum.
The Allowed Extensions rule limits which file extensions are expected. Every matched filename must satisfy this rule. Other file extensions cause the criteria to fail.
The Filename Pattern rule takes a Regular Expression (regex) pattern that every received filename must match. For example, to match filenames that start with "Acme" followed by an underscore and an 8-figure date (YYYYmmdd), specify a regex pattern of ^Acme_\d{8}.
The Forbidden Files rule is a glob pattern for filenames that must not appear in the matched set, like *.tmp or *.partial. If any forbidden file is present, the criteria fail. The rule succeeds only when the listed glob patterns are not found.
The Required Files rule checks that a particular file, or subset of files, exists among the delivered files. For each required file, you can specify criteria for filename, file count, file extension, and file size. Use this rule when a batch delivery of multiple files must also include specific files among them. For example, a batch of XML files might need to be accompanied by a single manifest CSV file.
The Content Validation rule runs a TransformScript against the matched files, checking what's in a file against your script's rules. Use it when checking the file's existence, name, and size doesn't prevent downstream errors, like a CSV that arrives on time with the wrong columns. Your script decides whether each file passes and supplies the error detail for each failure.
Expectation Trigger
The trigger controls how each evaluation window opens.
Custom Schedule
Custom Schedule runs an Expectation on specific days of the week.
Choose the Days of the Week and enter a Time of Day as the due time for those days.
Schedules run in the selected time zone. A Holiday Region skips the Expectation on the public holidays of that region, or on the days covered by a Holiday Calendar created on your site.
Interval
Interval triggers open a delivery window daily, weekly, monthly, quarterly, or yearly. Use this trigger when a delivery is due on a date rather than on a weekday, such as an invoice file due on the 15th of every month.
An interval-based Expectation is due on one or more days inside the interval, at one or more Time of Day values. Weekly, monthly, quarterly, and yearly Expectations need at least one day and allow several, and every due time applies to every day. A semi-monthly delivery due on the 1st and the 15th is one Expectation covering both days, not two Expectations watching the same folder.
A day the period does not contain is skipped rather than moved, so an Expectation on day 31 has no due date in February, April, June, September, or November. When the deadline is the close of the period rather than a fixed date, an interval can instead fall due at the end of the period. No day numbers are needed and it falls due once, on the last day.
Intervals run in the selected time zone. A Holiday Region skips the Expectation on the public holidays of that region, or on the days covered by a Holiday Calendar.
Saved Schedule
Saved Schedule offers the same timing settings as Custom Schedule, already filled in by a Site Administrator and shared across your site. Choosing one takes the Expectation's due days and times from that Schedule instead of from fields on the Expectation.
Use it when several Expectations share the same deadline. Partner deliveries are the common case: each partner needs its own Expectation because each watches a different folder, so twenty partners all due by 6 AM on weekdays means twenty Expectations running off one Schedule. Moving that deadline is then one edit rather than twenty.
Upload
Upload-triggered windows open when the first matching file upload is detected.
The window stays open until uploads matching your scope have been quiet for the configured Inactivity Interval. There is no deadline for this trigger, so results cannot be late. This trigger suits Expectations driven by upload bursts rather than a clock.
Manual
The Manual trigger starts an Expectation on an ad-hoc basis using the Evaluate now option. Our API and SDKs can also trigger Manual Expectations.
Delivery Windows
Delivery Window specifies the duration prior to the due time that files are expected to arrive in. Files delivered before this duration are ignored when the Expectation is evaluated. The maximum length of a delivery window is 14 days.
The optional Late Window accepts expected files delivered after the due time. Files delivered during the late window cause the Expectation to be marked as "Late" rather than "Missed".
The optional Inactivity Interval is a grace period that waits for in-transit file uploads to complete when the due time occurs while uploads are still active.
Max Open Interval sets a maximum duration for the delivery window. When this duration is reached, the delivery window closes and the Expectation is evaluated. This option is only available for Upload and Manual triggers.
Scope
The scope defines which files Files.com considers when evaluating your Expectation.
The Path field specifies the folder to watch. You can select whether only this folder is watched or whether subfolders are included. The path supports globs and refers to folders, not files.
Target Pattern specifies a file glob pattern for matching files within folders, such as *.csv.
The optional Exclude Pattern specifies a file glob pattern for files that are ignored, such as *.tmp.
The combination of path, target pattern, and exclude pattern identifies which files the Expectation evaluates.
If your path glob matches multiple folders, Files.com treats all matched files as a single candidate set. It does not create separate evaluation windows per folder. If you need independent evaluations for separate partners or customers, create one Expectation per scope.