Integrate Data and Systems

You can build rich, custom integrations that are not limited to mapping data between systems, but can include customized logic that address your business requirements and data persistence, using .
lac52
You can build rich, custom integrations that are not limited to mapping data between systems, but can include customized logic that address your business requirements and data persistence, using 
CA Live API Creator
.
Your API can interact with data in a single database or in multiple databases. You can also integrate 
CA Live API Creator
 with systems.
In this article:
 
 
Integrate Multiple Databases
Use the following process to integrate multiple databases as part of your API:
Connect your API to Multiple Databases
You can connect your API to multiple databases by adding connections to the databases or you can combine resources, build rules between databases, and then access these resources.
Each database commits separately. One database might succeed while the other fails.
For more information about how to add a connection to a database, see Database Connectivity.
Add Relationships Between the Databases
Foreign keys in your database schema can define relationships (physical relationships) or you can add virtual relationships using API Creator. When you connect your API to a database, 
CA Live API Creator
 generates physical relationships for each foreign key it discovers. For databases that do not define foreign keys, you can add virtual relationships between tables in different databases and database types using API Creator.
 
CA Live API Creator
 uses physical and virtual relationships in the resource definition, in rules, in Data Explorer, and in code completion.
For more information about how to add a relationship, see Manage Relationships.
Build Rules and Define Resources Between the Databases
After you have integrated multiple databases as part of your API, build rules between them. You can also join data from multiple database connections by defining resources between the database connections.
For more information:
  • About the building rules between databases, see Rule Types.
  • About how to define resources that combine data from different databases, see Manage Subresources.
Integrate with Systems
You can integrate 
CA Live API Creator
 with systems using APIs (by way of resources and custom endpoints), timers, or listeners that you create for messaging. The data exchanges and synchronization in your integration is real time. Integrating using 
CA Live API Creator
 simplifies the management, securing, and implementation. The integrated solution becomes more modularized and less fragile, providing more flexibility to adapt to business-process changes from both ends of the integrated systems.
Integrate using APIs
You can integrate 
CA Live API Creator
 with systems using APIs by defining resources that join data from multiple database connections. Use resources for incoming and outgoing requests. They provide declarative services for name mapping and nested objects.
For more information about how to define resources between databases, see Define Table-Based Resource Types
Integrate using Resources as Transformation Definitions
The following high-level process describes how to integrate using resources as transformation definitions:
  1. Define a resource to receive incoming data from external systems.
  2. Define resources explicitly in API Creator that transform the incoming request (de-aliasing and projection). For example, de-aliasing the resource attribute CustomerId to AccountNumber.
    If required, define request event handlers for JSON reformatting, such as inserting metadata action tags.
  3. Define rules with business logic and JavaScript logic.
    Your rules can enable systems integration by sending webhooks to related outbound systems.
For more information about viewing a code example that uses a resource as a transformation definition (for example, in an event rule), see JavaScript Code Examples.
Integrate using Resources as Webhooks
The following high-level process describes how to integrate data from different systems by providing webhooks using resources:
  1. In API Creator, create a resource where the name and attribute mapping matches the expected webhook definition.
  2. In the external system, register the resource as the handler for the posts in the external system.
  3. In API Creator, define rules with business logic and JavaScript logic.
 
CA Live API Creator
 receives the webhook posts and processes them.
Integrate using Nested Resources
The following high-level process describes how to integrate a set of related data using a nested resource. For example:
  1. Define multi-level table-based resource (for example, Order Header and Line Items from one database and Shipment Details as the third-level resource from another database).
  2. If you have complex data, create a Free SQL resource defined as a SQL select query with complex joins, grouping, and conditions.
For more information about how to define resources and subresources, including the data source types, see Manage Subresources.
Integrate using Resources that Call External REST Services
You can create resources based on other data source types, such as external or cloud-based REST services. For example, you can create a JavaScript resource that invokes external REST services by calling the 
SysUtility.getResource()
 method. This resource can process the response and integrate with your existing systems.
For more information about how to use this method, see The SysUtility Object.
Integrate using Timers
In situations where you want to integrate systems using a polling mechanism with predefined frequencies, you can create timers.
The following high-level process describes how to integrate systems using timers that monitors data changes by polling a system periodically:
  1. Create a timer that runs on a predefined schedule and monitors data changes in the database.
  2. In the timer code, you can do the following:
    1. Check some condition by calling external web services.
    2. Define business logic (a rule) that posts data to a system or sends data that 
      CA Live API Creator
       receives from an external web service as a message to another platform.
This process is part of the 
Data monitoring
 use case. For more information about this use case and the other systems integration use cases that apply to 
CA Live API Creator
, see API Creator Overview.
For more information about how to use timers, see Creating Timers.
Integrate using Listeners
In microservices architectures where autonomous operations are adopted, integrating systems by way of listeners is often the preferred route. If a service is unavailable, then the other service can operate.
The following high-level process describes how to integrate using listeners:
  1. Inbound messaging integration:
     Create a listener that subscribes to the messages for a given topic from another system in your API. Process the incoming message that the listener receives and perform an update to the destination system. Your listener code can POST/PUT to an endpoint within your API.
  2. Outbound messaging integration:
     Within your defined business logic (for example, in an event rule), when a condition is met, publish a message to a queue.
This process is part of the 
Publish and subscribe to messages
 use case. For more information about this use case and the other systems integration use cases that apply to 
CA Live API Creator
, see API Creator Overview.
For more information about how integrate systems using listeners, see Creating Listeners.