Accelerator MariaDB Global Party System API - Implementation Template
home
This API implementation template is a shared component of MuleSoft Accelerators, which accelerate the implementation of essential integration use cases.
The solution includes pre-built APIs, connectors, and integration templates that help unlock business-critical data from external systems and guide you in adopting best practices synthesized from thousands of customer implementations. Use these assets as is or extend them to meet your company’s unique needs.
Overview
This integration template implements the Accelerator Global Party System API specification. This is a System API for a Global Data Service to manage parties and party roles. A scaled down version of Global Data has been implemented using MariaDB. This API follows the Cloud Information Model (CIM), which is also used for the MariaDB schema.
The parties resource has endpoints to search Parties (such as Individuals), associate ContactPoints to a Party, associate external IDs of other Systems to a Party, and also relate a Party with another Party. A party can be of type Individual, Organization, or Household. The only types of ContactPoints that can be associated at this time are ContactPointEmail, ContactPointAddress and ContactPointPhone. A party can be related with another party using a relation type, and can have one or more parties as part of the relation.
Getting started
The Getting Started with MuleSoft Accelerators guide provides general information on getting started with the accelerator components. This includes instructions on setting up your local workstation for configuring and deploying the applications. |
Once your workstation has been set up and the application template imported into Anypoint Studio, proceed with the Prerequisites section.
Prerequisites
This implementation template has the following dependencies:
- MariaDB configured with the required schema
Configure the MariaDB schema
These instructions assume that you have a MariaDB version 10.6.8 or later. There are DB Scripts located under ther src/test/resources/scripts
folder.
To initialize a new database, run the following scripts in order:
- create-customers-schema.sql
- create-reference-data.sql
- create-logging-scripts.sql (optional, for debugging)
- generate-sp-create-script (produces a script to create all stored procs)
- create-stored-procedures.sql
To upgrade a database from a prior release, run the following scripts in order:
- upgrade-customers-schema.sql
- drop-stored-procedures.sql
- generate-sp-create-script (produces a script to create all stored procs)
- create-stored-procedures.sql
To drop the tables and stored procedures, execute the scripts
drop-customers-schema.sql
anddrop-stored-procedures.sql
, respectively.To truncate data from the tables, use the
truncate-data.sql
script.
Deployment
Each Accelerator implementation template in Exchange includes Bash and Windows scripts for building and deploying the APIs to CloudHub. These scripts depend on repositories, global settings, deployment profiles, and associated properties configured in the Maven settings.xml
file. In particular, make sure the common properties for your environment have been provided in the CloudHub-DEV
profile (e.g., Anypoint Platform client ID and secret).
For additional details, please refer to the Application Deployment section of the Getting Started Guide.
Preparation
This application demonstrates how to deploy multiple copies of the same asset in the different Organizations, where each is connected to different back-end system. In this case, each deployment can connect to a separate Global Data DB.
To begin with, ensure the Maven profile CloudHub-DEV
has been properly configured in your settings.xml
file. Now configure at least one additional profile, which contains the DB connection details (e.g.,Cloudhub-Shared
). In the deployment script, ensure both profiles are included in the ENV_PROFILE
environment variable, with the shared profile appearing second. For example:
ENV_PROFILE=CloudHub-DEV,CloudHub-Shared
Required property overrides
Many templates can also be run from Anypoint Studio without having to customize the Run/Debug profiles. However, some templates make use of hidden deployment properties to protect sensitive information (e.g., passwords and secret keys). These properties must be supplied to the runtime by updating the configuration profile and adding them as VM arguments. At a minimum, the following properties must be customized to reflect the target deployment environment.
Property Name | Description |
---|---|
api.autodiscoveryID | Required if using API Manager to secure this API |
global.database.host | Global Data DB hostname |
global.database.name | Global Data DB Database name |
global.database.username | Global Data DB username |
global.database.password | GGlobal Data DB password |
Implementation notes
- The current implementation does not support relating households to other parties.
Additional resources
- The Data mappings tab describes how the request and response data structures are mapped between the API interface and the Global Data DB.
- Refer to the Accelerators documentation home for more information about the MuleSoft Accelerators.