Mapping Set(s) for Object Services
The Mapping Set(s) feature is supported in Object Services from Fabric V9SP6 GA onwards. The Mapping Set(s) feature allows app developers to create multiple mapping sets for a set of objects created in the Data Model of Object Services for your app and connect each mapping set to different back ends. This is available only for Integration & Orchestration services route.
NOTE: From V9SP7, Locked Object Services for endpoint type as Integration & Orchestration support the Mapping Sets feature.
For more information, refer to How to Extend an Object Service of a Locked Fabric App.
Infinity today ships their application with all services pointed to back ends. Along with the application, other integration templates are shared, containing the mappings for the Infinity Data Model(s) to different supported back ends. The Infinity Implementation teams for each customer apply the integration templates for their required back ends onto the base infinity application to proceed.
This results in issues and manual effort on the side of both Infinity and the Implementation teams. These assets also need to be maintained apart from the Infinity app, complicating the delivery.
Using the Mappings Set(s) feature, you can create multiple mapping sets for each object service. You can map each mapping set to a different back end. All mapping sets consume the same data model. You can switch between different mappings and choose the suitable one per your business requirements from within Fabric console.
For example, you can add multiple sets of mappings for each object service, and you can define different mapping sets for users to create a transact mapping set and a Symitar mapping set. You can now connect each mapping set to other back ends.
This feature allows Infinity to develop one product with various connectors and configurations for different back ends while keeping the end users' work to a minimum.
For more information on Fabric Object Services, refer to Object Services.
Creating a Data Model
- Create an object service in your app using Fabric Console V9SP6 or later.
- Click the Data Model tab, create your objects and fields, and save the data model.
The following is a sample data model for the EventManager app.For more information on how to create objects and fields, refer to Configuring a Data Model.
NOTE: By default, the Mapping Set is created for the objects you created in the Data Model.
Creating Mapping Set(s)
By default, the Mapping Set is created for the objects you created in the Data Model. A mapping is a set of objects created in the data model. You can create multiple mapping sets if required. The data model will be maintained across all mapping sets in the object service.
- Click the Mapping tab.
The All Mapping Set(s) list displays all the mapping sets. By default, the Mapping Set is created for the objects you created in the Data Model.
The default mapping set is created based on your data model for the first time. The default mapping set is active by default.
NOTE: Verbs will not be auto-created in a new mapping set. Also, verbs in a mapping set do not relate to other mapping sets.
For more information on how to add verbs to objects and mapping between object verbs for the data model and back-end object fields, refer to Mapping Operations to Back-end Methods. - While the All Mapping Set(s) is selected, click Add Mapping Set.
- Enter the name and description for the new Mapping Set.
- Click SAVE. The new mapping set is created.
NOTE: The same Data model will be maintained across all new mapping sets.
NOTE: Mapping sets can have different sets of verbs.
You can map the verbs in a new mapping set to different back-end fields as required.
You can set the new mapping set as Active for publishing the app. For more details, refer to Publishing an Object Service Configured Multiple Mapping Set(s).
Managing Mapping Set(s)
To manage existing mapping sets, click the cog wheel button, and you can perform the following actions on a mapping set:
- Edit: It helps you to edit the name of a mapping set.
- Set as Active: It helps you to set a non-active mapping set as Active. When you choose to set a different mapping set active, this will deactivate the previously selected mapping set. Every object service must have at least one mapping set. When only one mapping set is available, the same mapping set is set to active by default.
-
Delete: It helps you to delete a mapping set. You cannot delete a mapping set that is active, as one mapping set must be active and operational at all times. Suppose you want to delete an active mapping set. In that case, you must first choose another available mapping set as active and then delete the mapping set.
NOTE: It is mandatory to have one mapping set. Still, it is not compulsory to have any verbs under it. This aligns the behavior with the present behavior of Console.
How the Interaction Between Data Models and Mapping Sets
-
After you create an object service, you must create a data model. The first mapping set is created by default based on the data model.
-
And the default mapping is present and set as Active.
-
By default, a mapping set does not contain verb mappings to back ends. You must create verb mappings for each mapping set.
-
You can create multiple mapping sets, as required.
-
All mapping sets contain the latest collection of objects and fields available in the data model.
-
All mapping sets are updated when you delete or modify the data model in the service.
Publishing an Object Service Configured Multiple Mapping Set(s)
A mapping set that is set to active is published to run-time when you publish your app. Other mapping sets are a design-time construct and do not include in the app publishing.
- You can set only one mapping set as active in your object service at any point.
- An active mapping set is considered for publishing an app, which includes the active mapping set, verb mapping for operations, and visual/XML mapper.
- Setting a new mapping set as active will deactivate the previously selected mapping set.
Backward Compatibility for Object Service Configured with Multiple Mapping Set(s)
Object Services created with multiple mapping sets are backward compatible with Fabric Console V9SP5 or lower versions and vice-versa.
- Object Services created using Fabric V9SP6 or later
For example, the MappingSet_1 is the default mapping in your app developed using the Fabric V9SP5 or lower. When you import the app into Fabric V9SP6 or later, the MappingSet_1 is imported into the object service, and the same is active in the Mapping Set(s) in the Mapping tab of your service, which includes all Request and Response mapping and Visual/XML mapping.
- Object Services created using Fabric V9SP5 or lower
For example, the MappingSet_1 is active in your Fabric app developed using the Fabric V9SP6. When you import the app into Fabric V9SP5, the MappingSet_1 is imported into the object service, and the exact mapping is available in the Mapping tab of your service, which includes all Request and Response mapping and Visual/XML mapping.