Using the Restart attribute

The Restart attribute provides instructions for handling errors encountered in a data stream. The Restart attribute gets assigned to a component and takes effect during data validation.

During data validation, the Restart attribute identifies a "start over" point when an unidentified foreign object (UFO) is encountered in the data. All unrecognized data is considered an error of the type with the Restart attribute assigned.

If you are mapping data of a component with a Restart attribute in place, only the valid occurrences of that component are mapped. For example, suppose your input is a file of records, and the Record component of File has the Restart attribute. Suppose some of the records are invalid. When you map the Record objects, only the valid records are mapped. To map the invalid records (for example, to an error file) use an error-handling function, such as REJECT, in the map rule.

For information about error-handling functions, see the Functions and Expressions documentation.

Typically, you would assign the Restart attribute to a component that has a series range. For example, (1:20) or (s), and the objects in the series are independent of one another. If each record in your file is independent from the others, it makes sense to ignore an error if it encounters an invalid one. A bad record does not make the next record meaningless. But suppose the records are related. Maybe they are records related to one purchase order; if any record is bad, you want to stop after validation because it is important to have all records. Losing any records would make the overall data incomplete.

For additional information about using the Restart attribute, see the Map Designer documentation.

To assign the Restart attribute to a component

Tip: To capture all errors of the component using Restart, place the Restart attribute at the highest level possible in the type tree.
  1. From the type tree editor, double-click the component. The component view opens.
  2. Right-click the component and select Restart from the context menu. You can remove the Restart attribute by performing the same action again.

JSON native schema restart

JSON schema fields with _V following the name and fields starting with oneOf, allOf and anyOf are the virtual fields.

Virtual JSON fields do not appear in the data and have no syntax. Syntax is controlled by real fields above these virtual fields.

Real fields are fields that appear in the JSON data. It is impossible to restart to a data location that does not appear in the data.

Selecting a virtual field for restart may fail. Use a real field either above or below the virtual fields for restart.