DataOperations
An expressive model for changing your DataElements. It lifts some constraints previously imposed by DataCommands while providing a better foundation for customizations.
Some of the goals are (in no specific order):
- Type-safe and extendable model: Each DataOperation has a type which highlights its purpose.
- Flexible: Allows definition of a wide range of input structures including nesting.
- Correctness: Define result states explicitly for improved error handling and traceability.
- Encapsulation: Strong interface with selective customization to avoid undesired coupling.
- Tooling: The available type information helps to develop tooling for specific use-cases.
- Data Modification: DataOperations make changes to your data. Basic return values are possible, but DataOperations are not a replacement for Finders/QuerySearch.
You can get started over here, or fist have a glimpse at the example below to see what is possible.
<!-- components/home/model/dataElements/Contact/dataOperations/register.xml -->
<dataOperation type="operations::CreateOperation">
<name>register</name> <!-- working name will be 'RegisterContact' -->
<parameterGroups>
<parameterGroup>
<parameters>
<parameter type="operations::ValueFieldParameter">
<name>name</name>
<field>home::Contact::name</field>
</parameter>
<parameter type="operations::TypedParameter">
<name>saveToFavorites</name>
<type>Boolean</type>
</parameter>
<parameter type="operations::AssociationParameter">
<name>worksAt</name>
<field>home::Contact::company</field>
</parameter>
<parameter type="operations::GroupParameter">
<name>addresses</name>
<targetGroup>home::Contact::register::address</targetGroup>
</parameter>
</parameters>
</parameterGroup>
<parameterGroup>
<parameters>
<parameter type="operations::TypedParameter">
<name>street</name>
<field>String</field>
</parameter>
<parameter type="operations::TypedParameter">
<name>country</name>
<field>String</field>
</parameter>
</parameters>
</parameterGroup>
</parameterGroups>
</dataOperation>