The accepts
Statement
The section Handling Data defines how data is mapped. This can include adding a specific Type
field to data sets, or by allowing the language to identify the most appropriate script to handle a given piece of data.
To support the selection of the most appropriate script to handle a piece of data, the accepts
statement is used to build a definition of what the script expects to have passed to it. The statement defines the fields that the script uses, so the language can map data to the most appropriate script (where applicable).
In the event that there is a Type
field specified on the data, the Type
field will be used to select the script and the accepts
statement will be ignored. However, the accepts
statement is required to be included to ensure support for both methods of data mapping.
The accepts
statement lists the fields that are expected, and used by the script.
accepts(FirstName, LastName, Age);