Action Template Service Layer
This service manages action templates in the CommTool system. Action templates
define the structure and behavior of actions that can be executed by bots.
Key concepts:
- Action Templates: Reusable templates that define action structure and UI
- Organizations: Templates belong to specific organizations
- Bots: Can be linked to action templates to execute actions
- Multi-tenancy: Each organization has isolated templates
Database structure:
- ObjectBase: Main table storing templates with Type='actionT'
- Links: Junction table linking bots to action templates
- Source:
Members
(static, constant) createBotLink
Create a link between a bot and an action template
This function establishes the relationship that allows a bot to execute
actions based on a specific action template. The relationship is stored
in the Links table and enables the bot discovery system.
- Source:
(static, constant) createOrUpdateActionTemplate
Create or update an action template
This is the core function for managing action templates. It handles both
creation of new templates and updates to existing ones. The function
processes template data, applies organization-specific rendering, and
manages internationalization support.
- Source:
(static, constant) deleteActionTemplate
Delete an action template and all associated data
This function performs a cascading delete of an action template, removing
all related data to maintain database integrity. It's a comprehensive
cleanup operation that affects multiple tables.
- Source:
(static, constant) getActionTemplate
Get a single action template by UID
Retrieves a specific action template with its complete data structure.
Used for template editing, viewing details, and bot execution contexts.
- Source:
(static, constant) getActionTemplatesForBot
Get all action templates associated with a specific bot
Retrieves action templates that are linked to a bot through the Links table.
This enables bots to discover which action templates they can execute.
Includes organization information for multi-tenant context.
- Source:
(static, constant) getActionTemplatesForOrg
Get all action templates for a specific organization
Retrieves action templates that belong to an organization. These templates
define the structure and behavior of actions that can be created within
the organization's context.
- Source:
(static, constant) getOrganizationsByUIDs
Get organizations by their UIDs
Utility function to retrieve organization details for multiple organizations.
Used for batch operations and providing organization context in templates.
- Source:
(static, constant) restartActionTemplate
Restart an action template
This function sends a restart signal to the bots that defined
the specified action template. It's used to update call the onStartup function
of the bot part without requiring a full bot restart.
- Source: