Skip to main content

Data Operation

For what data operationsData Operation (DataOperation). A type-safe action (e.g., Create, Update, Custom) executed on DataElement instances to modify data or trigger business logic. are and how they build on CRUD, see CRUD and Data Operations.

Data OperationsData Operation (DataOperation). A type-safe action (e.g., Create, Update, Custom) executed on DataElement instances to modify data or trigger business logic. (also known as data actions) provide a way to execute tasks or change data for one or more data element instances.

The elaborate model allows us to design different actions instead of implementing them custom.

Attributes​

  • name: the name of the operation.
  • type: the kind of data manipulation, such as BatchDelete or Create.
    • See the Type Reference for all available types. You may even define your own types!
  • parameterGroups: the input of the operation.
  • resultType: a ValueType describing the result of a successful operation.
  • errorCodes: additional error codes the operation can return.

Example​

For example, the operation addBooking on the Booking element is of type "Create" and has the following input parameters:

  • startBooking: fieldParameter that refers to the fieldFieldA property of a DataElement expanded to a database column and user interface input element. startBooking on Booking
  • selectedCar: associationParameter that refers to the Car element
<!-- components/carRental/model/dataElements/Booking/dataOperations/addBooking.xml -->
<dataOperation>
<type>Create</type>
<name>AddBooking</name>
<parameterGroups>
<parameterGroup>
<parameters>
<parameter type="operations::TargetParameter" xsi:type="targetParameter">
<name>target</name>
</parameter>
<parameter type="operations::FieldParameter" xsi:type="fieldParameter">
<name>startBooking</name>
<field>carRental::Booking::startBooking</field>
</parameter>
<parameter type="operations::AssociationParameter" xsi:type="associationParameter">
<name>selectedCar</name>
<multiple>false</multiple>
<dataElement>carRental::Car</dataElement>
</parameter>
</parameters>
</parameterGroup>
</parameterGroups>
</dataOperation>

Model​

ParameterGroup​

Each data operationData Operation (DataOperation). A type-safe action (e.g., Create, Update, Custom) executed on DataElement instances to modify data or trigger business logic. contains at least one ParameterGroup without a name, called the root. This group describes the parameter object or input of the operation. The extra layerLayerLogical separation of functionality within a single system/application, focused on code organization. of ParameterGroup may look redundant at first, but serves a purpose when defining nested structures.

Parameter​

A Parameter is any input fieldFieldA property of a DataElement expanded to a database column and user interface input element. that is used by the operation. Its type can be a new input value, an existing fieldFieldA property of a DataElement expanded to a database column and user interface input element. of the selected data elementData Element (DataElement). A fundamental data concept or entity within an application's domain, acting as an anthropomorphic translation of a real-life object or concept. or even references to other data elementsData Element (DataElement). A fundamental data concept or entity within an application's domain, acting as an anthropomorphic translation of a real-life object or concept.. See the Type Reference for all parameter types.

returnType and errorCodes​

A data operationData Operation (DataOperation). A type-safe action (e.g., Create, Update, Custom) executed on DataElement instances to modify data or trigger business logic. may additionally define a returnType (ValueType) and errorCodes. The return type may provide some extra info when the operation is successful, for example a count on a BatchDeleteOperation. Some error codes are provided by default and additional codes can be defined in the applicationApplicationThe overarching model container grouping all components, domain logic, and configurations for an enterprise solution.. See error handling for more info.

Angular View integration​

The majority of the model is an extension of DataElement except for the Angular View integration which has its own model to represent Actions and Forms.