Public apps and default connectors
How tenant apps, events, connectors, mappings, and task trees are provisioned from public templates
Overview
GIP separates catalog definitions (public apps, public events, default connectors, default connector–event mappings) from tenant data (apps, events, connectors, connector–event mappings, event tasks). Provisioning copies catalog rows into the enterprise scope and wires refPublicAppId / refPublicEventId so upgrades and drift can be reasoned about later.
The DIP UI flows (configure public app, create connector from default template) call into the App Connector Service (ACS) tasks described below.
Public catalog models
Public app (PublicAppModel)
Global template for an integration product: name, description, inboundEnabled, outboundEnabled, isEnabled, isDefault (seed for new enterprises), logoSrc, refId, and configureVia (how the console may configure the app).
Public event (PublicEventModel)
Events attached to a public app: eventCode, direction (inbound/outbound), publishConfig / listenerConfig (including optional Kafka topic and endpoint metadata), refDocPath, etc. There is no ssoEnterpriseId; events are cloned per tenant.
Default connector (DefaultConnectorModel)
A named pairing of public outbound and inbound app IDs (outboundAppId, inboundAppId), isEnabled. Used to know which connector lines to instantiate once both enterprise apps exist.
Default connector–event mapping (DefaultConnectorMappingModel)
For a given public app pair, maps public outbound and inbound event IDs, optional template, isEnabled, toggleAllowed, and embeds a full tasks array (subdocuments matching event task shape: name, type, parentId, config, etc.). This is the source for preconfigured task trees when mappings are cloned.
Configure a public app into the tenant (ConfigurePublicAppTask)
Triggered with a public app id and enterprise context (ConfigurePublicAppTask.handle).
- Idempotency: If an app already exists with the same
ssoEnterpriseIdandrefPublicAppId, ACS returns 400 — App is already configured for this enterprise. - App row: Creates
AppModelwith fields copied from the public app (name,description, flags,logoSrc,refId,refPublicAppId),accessType: private,isEnabled: true, and audit fields. - Events: Loads all
PublicEventrows for that public app and bulk inserts tenantEventsModelrows with the same codes, configs, andrefPublicEventIdpointing at the public event.
Result: appId plus eventsInserted count (zero if the public app had no events).
Default apps at enterprise onboarding (DefaultAppCreationTask)
Runs with { ssoEnterpriseId } (typically after enterprise creation).
- Finds all
PublicAppwithisDefault: true. - For each not already materialized for that enterprise, creates an app and clones all public events the same way as above (per-event
createin a loop).
Use this to understand why a fresh tenant may already see apps and events before anyone opens the DIP UI.
Default connectors and mappings (DefaultConnectorCreationTask)
Runs with { ssoEnterpriseId } after enterprise apps exist.
- Loads enabled
DefaultConnectorrows. - Resolves enterprise
outboundAppId/inboundAppIdby matchingrefPublicAppIdon tenant apps to the default connector’s public app ids. Skips if either side is missing. - Creates
ConnectorModelrows for pairs that do not already exist (same outbound/inbound for that enterprise). - For new connectors only, loads
DefaultConnectorMappingrows whose public(outboundAppId, inboundAppId)match, resolves enterprise events viarefPublicEventId, createsEventTaskdocuments from each embedded default task, then bulk insertsConnectorEventMappingwithtasksset to the new task ids.
So connectors, mappings, and task definitions can all appear without manual UI work when defaults are maintained in Mongo.
Configure a default connector from the UI (ConfigureDefaultConnectorTask)
User-driven flow: pick a default connector id and optional default connector–event mapping ids.
- Loads the
DefaultConnector; 404 if missing. ensureEnterpriseApps: Ensures both public apps exist as tenant apps. Missing sides are created viaConfigurePublicAppTask(countsappsAutoConfigured/eventsAutoConfigured).- Validates outbound/inbound apps: must be enabled, outbound/inbound flags set, and
AppConfigurationenabled when present. - Find or create the
ConnectorModelfor the enterprise and app pair. - Mapping selection: Union of
- Mandatory default mappings (
toggleAllowed: false) for that default connector, and - User-provided mapping ids (
dto.connectorEventMappingIds).
- Mandatory default mappings (
ensureEnterpriseEvents: Ensures every public event referenced by selected mappings exists as a tenant event (creates or links byeventCode+direction+ app).createConnectorEventMappings: For each selected default mapping not already present for this connector (same outbound/inbound event pair), createsConnectorEventMapping, thencloneDefaultTasks:- Walks embedded
defaultMapping.tasksin two passes: allocates new ObjectIds, remapsparentIdto new ids, setsconnectorEventMappingId,bulkInsertevent tasks, then updates the mapping’stasksarray with the inserted ids.
- Walks embedded
Mandatory-only mappings: If the user selects nothing but mandatory mappings exist, those are still applied. If there are no selected mappings at all, the API returns counts of zero and still reports connector id.
DIP UI alignment
- Apps list / create from public: Corresponds to configuring a public app and viewing tenant apps (
refPublicAppIdvisible in data model — see Data model reference). - Create connector wizard (select apps, map events): Aligns with manual connector + mapping creation; default connector path uses the same data shapes but seeds from
DefaultConnector*collections. - Configure default connector sidebars: Drive
ConfigureDefaultConnectorTaskwithconnectorIdand optional mapping id list.
Related
- Seeding and sync public events — loading
storage/seeders/apps.json/events.jsonviaPOST /acs/common/seed, thensync-public-events. - Task tree — how cloned
parentIdlinks form the executable tree. - Data model reference — field-level detail on apps, events, connectors, and mappings.