API Creator is designed to complement automation with provisions for extending:
- SQL access - Your SQL operations are normally automated, but you can override these defaults to address more complex cases.
- Request - in addition to extending logic at the table level (above), you can also control processing at the more coarse request level.
Architected to be Open, Extensible
Recall that API Creator is, underneath, a war file. It runs within the JVM as shown below and can be installed in a standard war container.
Any authorized client or server can call in to API Creator, via REST. In addition to typical web/mobile apps, this might include cron jobs, App Servers built with familiar frameworks, other systems in your organization, partners, ESB systems, etc.
There are some key tenants that make the logic open and extensible:
- external services, via REST, SOAP, etc.
created from your schema, providing persistence-enabled row
objects for accessing attributes and related data.
Formula and Validation Logic
expressions. In the most common case, these are simple expression such as
row.price * row.quantity
Logic Event Rule Type
Table Event Handlers are invoked with the current / old rows and the current verb on POST, PUT and DELETE operations. They can operate on this row, the results of which is subjected to Reactive Logic. Here is a good example.
Resource Row EventResource Row Events are fired as rows are retrieved. You can inject new attributes or remove attributes or even make REST calls and append results.
You can define Custom Endpoint
for your own custom HTTP Handler to build services perhaps unrelated to your database objects.
Request Events provide an entry point before logic is invoked, and Response Events can be used after all processing has been completed on any Request. For example:
- Request/Response reformatting: the B2B sample provides a good example of a request event, where the in-coming request reformatted prior to logic processing. Response Events can perform similar functions on the outgoing response.
- Auditing: you might use Request Events to log requests
The extension capabilities draw upon the following underlying services.
The system initializes important Context Variables
you'll need for your code to operate, including:
- LogicContext - services for creating, reading, updating and deleting rows.
Provides information about key logic state, including verb, nest level; please see the api documentation
You also have access to System Logic
services such as allocate, copy, etc.
You can also include your own libraries (upload) by selecting the 'Your Libraries tab and the 'Create New Library' button.
Re-usable Rule Types
You can add new Rule Types to the core rules (Formula, Sum, Count, Validation and so forth). You can define the parameters they accept, which are then used by the Logic Designer to utilize an extended rule. Extended Rule Types are designed to enable you to detect logic patterns, and implement re-usable solutions to these. The InsertIntoFrom
rules utilize this underlying technology, and so are good illustrations of the power of this technique.
Resources with a Type of Custom SQL
enable you to supply your own SQL for update-able objects. Your SQL must return the columns modeled by the Resource.
You can define Resources with a Type of Free SQL
. This enables you to supply your own SQL, without restriction.
Request Meta Data
You can use Services
to Insert @metadata action tags
to link child rows to parent rows, without
the requirement for the client to supply autonum identifiers (which they may not know). Related services enable you to designate that request rows can result in either an update of an existing row, or (if not present, the insertion of a new row. See the B2B Example here
Observe that the Admin data used by Live Creator API is accessed via an API. So, in addition to creating APIs via the browser, you can drive it with RESTful calls. The Admin API
is described here.