Skip to content

Contexts

The contexts section is where you can configure the contexts in which your business logic will be performed, for example, ReadAll is a business context where certain business logic must be performed so that all data is obtained from the database.

To learn more about the types of contexts that exist, see Existing Controller Contexts section.

Fields

A context contains the following fields to be defined:

Context

The type of context to be created.

Requirements Rules:

Example:

1
2
Contexts:
- Context: Create # Create resource on the Server. Equivalent POST verb


Validations

A collection of business rule validations for this context. See Validations section for more details.

Requirements Rules:

  • Each validation must have an exclusive 'Name' property value;
  • Each validation on list must follows rules as specified in Validation

Example:

1
2
3
4
5
6
7
Contexts:
- Context: Create # Create resource on the Server. Equivalent POST verb
  Validations:
  - Name: My_First_Validation
    ...
  - Name: My_Second_Validation
    ...


Rules

A collection of business rules for this context. See Rules section for more details.

Requirements Rules:

  • Each rule must have an exclusive 'Name' property value;
  • Each rule on list must follows rules as specified in Rule

Example:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
Contexts:
- Context: Create # Create resource on the Server. Equivalent POST verb
  Validations:
  - Name: My_First_Validation
    ...
  - Name: My_Second_Validation
    ...
  Rules:
  - Name: My_First_Rule
    ...
  - Name: My_Second_Rule
    ...

Note

A context must have at least one Validation or Rule to operate.

Back to top