Service API Integration
The NS applicationNS Application (NSApplication). A pre-built software stack that provides common enterprise application functionality such as CRUD, search, authentication, and business process modeling out of the box. provides an industry-standard REST API interface designed for integration with external systemsSystemA set of interconnected components that work together to achieve a specific purpose or function.. It is generated by the jaxrs-service-api-expandersExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. bundle, also referred to as the service API or the rest-expandersExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact..
The jaxrs-service-api-expandersExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. bundle is a set of expandersExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. capable of generating a Jersey-based JAX-RS implementation of a REST API. Documentation is provided in the form of Swagger (OpenAPI) files that are automatically generated.
For the expansion resourcesExpansion Resource (ExpansionResource). A reusable resource bundle containing expanders and features that provide specific application capabilities, defined in the expansion settings and added to the classpath during expansion., the specifications the API follows, release notes and source repository, see Resource structure.
A tutorial on how to get started with the API expandersExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. can be found here:
What to expect
The service API expandersExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. can generate a full implementation for a REST API. These APIs will combine the REST protocol with several specifications and standard practices such as the HAL specification in JSON format. While by default there is extensive code generation, the developer still has to write some custom code to provide the needed logic for the REST API. This is due to the absence of a meta-model to represent the REST API at this time.
To ensure that we can provide a 100% generated API out of the box, we followed an approach similar to convention over configuration where we provide a solid default implementation for simple elements that will be sufficient in most cases. This is activated by using a uuid: String fieldFieldA property of a DataElement expanded to a database column and user interface input element. as functional key, placing the resource identifiers in the includeJaxrsConnector option rather than in the options for the endpoints and by using the options exposeRestField, isUnique and isRequired for fieldsFieldA property of a DataElement expanded to a database column and user interface input element. in a DataElement. This will couple the REST API to the data model, but this can be disabled on a per-fieldFieldA property of a DataElement expanded to a database column and user interface input element. basis by not making use of those fieldFieldA property of a DataElement expanded to a database column and user interface input element. options or for the entire DataElement by placing the resource identifiers in the options for the endpoints.
Automatic API provisioning
The Service API is available in your NS ApplicationNS Application (NSApplication). A pre-built software stack that provides common enterprise application functionality such as CRUD, search, authentication, and business process modeling out of the box. after adding the Service API expandersExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. as an expansion resourceExpansion Resource (ExpansionResource). A reusable resource bundle containing expanders and features that provide specific application capabilities, defined in the expansion settings and added to the classpath during expansion. to your applicationApplicationThe overarching model container grouping all components, domain logic, and configurations for an enterprise solution. project.
Then, new transmutations will become available to automatically provision default API implementations for an existing model. These can be executed through right-clicking the element model element in the µRadiant, where the transmutation will be listed in the menu, or through command-line using Maven.
ComponentThis transmutation will add a default REST API to an entire component. That means that it will add the default Component options such as enableJaxrs and then run the AddDefaultRestApi transmutation on every DataElement in that Component.
DataElementThis transmutation will enrich the model for a single DataElement will all of the model elements needed to fully expose the element through a default connector implementation with all fieldsFieldA property of a DataElement expanded to a database column and user interface input element. in the element being exposed one-to-one through the API.
Where possible, the transmutation takes into account the current state of the model for the DataElement and provisions it accordingly. For example, if you already set a functional key to a fieldFieldA property of a DataElement expanded to a database column and user interface input element. with a specific name, it will use that fieldFieldA property of a DataElement expanded to a database column and user interface input element. and key instead of adding the default externalId fieldFieldA property of a DataElement expanded to a database column and user interface input element..
The transmutation only applies changes if the option enableJaxrs is present on the Component of which the DataElement is part.
If your model violates some of the base requirements of the rest-expandersExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact., the transmutation will not run! This includes using multiple fieldsFieldA property of a DataElement expanded to a database column and user interface input element. or a non-string fieldFieldA property of a DataElement expanded to a database column and user interface input element. as the functional key.