Skip to main content

Object Definition Commands Reference

Overview

Object Definition Commands manage dynamic form templates that can be attached to business entities (Loans, Customers, Accounts, Transactions). These templates define structured data schemas with validation rules, conditional visibility, and client-side scripting capabilities.

What are Object Definitions?

Object Definitions are reusable form templates that define:

  • Schema Structure - Field definitions and data types
  • Validation Rules - Required fields, formats, constraints
  • Conditional Logic - When the form should appear
  • Client Scripts - Dynamic behavior and calculations
  • Entity Association - Which business entity types can use this template
  • Multiple Instances - Whether multiple forms can be created per entity

Common Use Cases

  • Loan Application Forms - Capture loan-specific data
  • KYC Documents - Customer verification information
  • Credit Assessment Forms - Credit scoring and risk analysis
  • Approval Checklists - Review and approval tracking
  • Custom Questionnaires - Dynamic data collection
  • Compliance Forms - Regulatory compliance data
  • Collateral Details - Asset and collateral information

Commands Reference

CreateObjectDefinitionCommand

Create a new Object Definition template.

File: CB.Administration.Api/Commands/BPM/ObjectDefinition/ObjectDefinitionCommands.cs

Request

{
"code": "loan_credit_assessment",
"name": "Loan Credit Assessment Form",
"entityType": 3,
"formId": 25,
"description": "Credit scoring and assessment template for loan applications",
"schemaJson": "{\"type\":\"object\",\"properties\":{\"creditScore\":{\"type\":\"number\",\"minimum\":300,\"maximum\":850},\"riskRating\":{\"type\":\"string\",\"enum\":[\"Low\",\"Medium\",\"High\"]}},\"required\":[\"creditScore\",\"riskRating\"]}",
"condition": "loan.amount > 10000",
"clientScript": "if (data.creditScore < 600) { showWarning('High Risk Customer'); }",
"allowsMultipleInstances": false,
"maxInstancesAllowed": null
}

Request Fields

FieldTypeRequiredDefaultDescription
codestringYes-Unique identifier code
namestringYes-Display name
entityTypeintYes-Entity type (see Entity Types Reference below)
formIdlongNonullAssociated form template ID
descriptionstringNonullDescription of purpose
schemaJsonstringNonullJSON Schema defining fields
conditionstringNonullJavaScript expression for conditional display
clientScriptstringNonullJavaScript code for dynamic behavior
allowsMultipleInstancesboolNofalseAllow multiple instances per entity
maxInstancesAllowedintNonullMaximum instances allowed

Response

Success:

{
"isSuccessful": true,
"message": "ObjectDefinition created successfully",
"data": {
"id": 45,
"code": "loan_credit_assessment",
"name": "Loan Credit Assessment Form",
"uniqueIdentifier": "obj_def_abc123xyz",
"entityType": 3,
"entityTypeDesc": "Loan",
"formId": 25,
"description": "Credit scoring and assessment template for loan applications",
"schemaJson": "...",
"condition": "loan.amount > 10000",
"clientScript": "...",
"allowsMultipleInstances": false,
"maxInstancesAllowed": null,
"version": 1,
"isActive": true,
"createdAt": "2026-01-19T10:30:00Z"
}
}

Error - Duplicate Code:

{
"isSuccessful": false,
"message": "ObjectDefinition with code 'loan_credit_assessment' already exists."
}

UpdateObjectDefinitionCommand

Update an existing Object Definition.

File: CB.Administration.Api/Commands/BPM/ObjectDefinition/ObjectDefinitionCommands.cs

Request

{
"id": 45,
"code": "loan_credit_assessment_v2",
"name": "Loan Credit Assessment Form (Enhanced)",
"description": "Enhanced credit scoring template with additional fields",
"schemaJson": "{\"type\":\"object\",\"properties\":{\"creditScore\":{\"type\":\"number\"},\"riskRating\":{\"type\":\"string\"},\"comments\":{\"type\":\"string\"}}}",
"condition": "loan.amount > 5000",
"clientScript": "if (data.creditScore < 600) { showWarning('High Risk'); highlightField('riskRating'); }",
"allowsMultipleInstances": true,
"maxInstancesAllowed": 3,
"isActive": true
}

Request Fields

FieldTypeRequiredDescription
idlongYesID of Object Definition to update
codestringNoUpdated unique code
namestringNoUpdated display name
formIdlongNoUpdated form template ID
descriptionstringNoUpdated description
schemaJsonstringNoUpdated JSON Schema
conditionstringNoUpdated conditional logic
clientScriptstringNoUpdated client script
allowsMultipleInstancesboolNoUpdated multiple instances flag
maxInstancesAllowedintNoUpdated maximum instances
isActiveboolNoUpdated active status

Response

Success:

{
"isSuccessful": true,
"message": "ObjectDefinition updated successfully",
"data": {
"id": 45,
"code": "loan_credit_assessment_v2",
"name": "Loan Credit Assessment Form (Enhanced)",
"version": 2,
"updatedAt": "2026-01-19T11:00:00Z"
}
}

DeleteObjectDefinitionCommand

Delete an Object Definition.

File: CB.Administration.Api/Commands/BPM/ObjectDefinition/ObjectDefinitionCommands.cs

Request

{
"id": 45,
"deleteInstances": false
}

Request Fields

FieldTypeRequiredDefaultDescription
idlongYes-ID of Object Definition to delete
deleteInstancesboolNofalseAlso delete all instances

Response

Success:

{
"isSuccessful": true,
"message": "ObjectDefinition deleted successfully"
}

Error - Has Active Instances:

{
"isSuccessful": false,
"message": "Cannot delete ObjectDefinition with active instances. Set deleteInstances=true to force delete."
}

GetObjectDefinitionByIdQuery

Retrieve a specific Object Definition by ID.

File: CB.Administration.Api/Commands/BPM/ObjectDefinition/ObjectDefinitionCommands.cs

Request

{
"id": 45
}

Response

Success:

{
"isSuccessful": true,
"message": "ObjectDefinition retrieved successfully",
"data": {
"id": 45,
"code": "loan_credit_assessment",
"name": "Loan Credit Assessment Form",
"uniqueIdentifier": "obj_def_abc123xyz",
"entityType": 3,
"entityTypeDesc": "Loan",
"formId": 25,
"description": "Credit scoring and assessment template",
"schemaJson": "{...}",
"condition": "loan.amount > 10000",
"clientScript": "if (data.creditScore < 600) { showWarning('High Risk'); }",
"allowsMultipleInstances": false,
"maxInstancesAllowed": null,
"version": 1,
"isActive": true,
"createdAt": "2026-01-19T10:30:00Z",
"updatedAt": "2026-01-19T11:00:00Z"
}
}

GetObjectDefinitionByCodeQuery

Retrieve a specific Object Definition by its unique code.

File: CB.Administration.Api/Commands/BPM/ObjectDefinition/ObjectDefinitionCommands.cs

Request

{
"code": "loan_credit_assessment"
}

Response

Same format as GetObjectDefinitionByIdQuery.


ListObjectDefinitionsQuery

Retrieve a filtered and paginated list of Object Definitions.

File: CB.Administration.Api/Commands/BPM/ObjectDefinition/ObjectDefinitionCommands.cs

Request

{
"entityType": 3,
"isActive": true,
"pageIndex": 0,
"pageSize": 20
}

Request Fields

FieldTypeRequiredDefaultDescription
entityTypeintNonullFilter by entity type
isActiveboolNonullFilter by active status
pageIndexintNo0Page index (0-based)
pageSizeintNo20Results per page

Response

Success:

{
"isSuccessful": true,
"message": "ObjectDefinitions retrieved successfully",
"data": {
"items": [
{
"id": 45,
"code": "loan_credit_assessment",
"name": "Loan Credit Assessment Form",
"entityType": 3,
"entityTypeDesc": "Loan",
"description": "Credit scoring template",
"allowsMultipleInstances": false,
"isActive": true,
"createdAt": "2026-01-19T10:30:00Z"
},
{
"id": 46,
"code": "loan_collateral_checklist",
"name": "Collateral Verification Checklist",
"entityType": 3,
"entityTypeDesc": "Loan",
"description": "Collateral verification template",
"allowsMultipleInstances": true,
"isActive": true,
"createdAt": "2026-01-19T09:15:00Z"
}
],
"totalCount": 42,
"pageIndex": 0,
"pageSize": 20,
"totalPages": 3
}
}

GetAvailableObjectDefinitionsForEntityQuery

Get Object Definitions available for a specific entity based on conditions.

File: CB.Administration.Api/Commands/BPM/ObjectDefinition/ObjectDefinitionCommands.cs

Request

{
"entityType": 3,
"entityId": 12345,
"entityContext": {
"amount": 1500000,
"currency": "NGN",
"loanType": "personal",
"status": "pending"
}
}

Request Fields

FieldTypeRequiredDescription
entityTypeintYesEntity type
entityIdlongYesEntity ID
entityContextobjectYesEntity data for condition evaluation

Response

Success:

{
"isSuccessful": true,
"message": "Available ObjectDefinitions retrieved successfully",
"data": [
{
"id": 45,
"code": "loan_credit_assessment",
"name": "Loan Credit Assessment Form",
"description": "Credit scoring template",
"conditionMet": true,
"condition": "loan.amount > 10000"
},
{
"id": 47,
"code": "high_value_loan_checklist",
"name": "High Value Loan Checklist",
"description": "Additional checks for high value loans",
"conditionMet": true,
"condition": "loan.amount > 1000000"
}
]
}

Entity Types

TypeValueDescriptionCommon Forms
Customer1Customer/Client entitiesKYC forms, Identity verification, Credit assessment
Account2Account entitiesAccount opening forms, Maintenance checklists
Loan3Loan applicationsCredit assessment, Collateral forms, Approval checklists
Transaction4Transaction dataTransaction verification, Audit forms

JSON Schema Format

Object Definitions use JSON Schema for field structure:

Simple Example

{
"type": "object",
"properties": {
"creditScore": {
"type": "number",
"minimum": 300,
"maximum": 850,
"description": "FICO credit score"
},
"riskRating": {
"type": "string",
"enum": ["Low", "Medium", "High", "Critical"],
"description": "Risk assessment rating"
},
"assessmentDate": {
"type": "string",
"format": "date",
"description": "Date of assessment"
}
},
"required": ["creditScore", "riskRating"]
}

Complex Example

{
"type": "object",
"properties": {
"personalInfo": {
"type": "object",
"properties": {
"firstName": {"type": "string", "minLength": 2},
"lastName": {"type": "string", "minLength": 2},
"dateOfBirth": {"type": "string", "format": "date"}
},
"required": ["firstName", "lastName"]
},
"employmentInfo": {
"type": "object",
"properties": {
"employer": {"type": "string"},
"position": {"type": "string"},
"monthlyIncome": {"type": "number", "minimum": 0}
}
},
"documents": {
"type": "array",
"items": {
"type": "object",
"properties": {
"documentType": {"type": "string"},
"documentNumber": {"type": "string"},
"expiryDate": {"type": "string", "format": "date"}
}
}
}
}
}

Supported Field Types

  • string - Text fields
  • number - Numeric values (decimal)
  • integer - Whole numbers
  • boolean - True/false
  • array - Lists of values
  • object - Nested structures
  • null - Nullable fields

Conditional Visibility

Object Definitions can be shown/hidden based on runtime conditions.

Examples

Show for High Value Loans:

{
"code": "high_value_loan_assessment",
"condition": "loan.amount > 1000000 && loan.currency === 'NGN'"
}

Show for Low Credit Score:

{
"code": "additional_guarantor_form",
"condition": "customer.creditScore < 600"
}

Complex Conditions:

{
"code": "corporate_loan_checklist",
"condition": "(loan.loanType === 'corporate' || loan.amount > 5000000) && loan.collateral !== null"
}

Evaluation Context

The entity object is available in conditions:

// For Loan entities
loan.amount
loan.currency
loan.loanType
loan.status
loan.customerId

// For Customer entities
customer.firstName
customer.creditScore
customer.kycStatus
customer.accountAge

// For Account entities
account.balance
account.accountType
account.status

// For Transaction entities
transaction.amount
transaction.transactionType
transaction.status

Client Scripts

Add dynamic behavior to forms with JavaScript.

Available Functions

// Field visibility
showField('fieldName')
hideField('fieldName')

// Field requirements
requireField('fieldName')
optionalField('fieldName')

// User feedback
showWarning('message')
showError('message')
showInfo('message')

// Field highlighting
highlightField('fieldName')
unhighlightField('fieldName')

// Data access
data.fieldName // Current form values

Examples

Dynamic Field Visibility:

if (data.loanType === 'mortgage') {
showField('propertyValue');
showField('propertyAddress');
requireField('propertyValue');
} else {
hideField('propertyValue');
hideField('propertyAddress');
}

Calculations:

// Calculate monthly payment
if (data.loanAmount && data.interestRate && data.loanTerm) {
var monthlyRate = data.interestRate / 12 / 100;
var numPayments = data.loanTerm * 12;
data.monthlyPayment = (data.loanAmount * monthlyRate * Math.pow(1 + monthlyRate, numPayments)) /
(Math.pow(1 + monthlyRate, numPayments) - 1);
}

Validation:

if (data.creditScore < 600) {
showWarning('Customer has low credit score - additional guarantor required');
requireField('guarantorDetails');
highlightField('guarantorDetails');
}

if (data.debtToIncomeRatio > 0.43) {
showError('Debt-to-income ratio exceeds maximum allowed (43%)');
requireField('additionalIncomeSource');
}

Multiple Instances

Allow multiple instances of the same definition per entity.

Configuration

{
"code": "loan_guarantor",
"name": "Loan Guarantor Information",
"allowsMultipleInstances": true,
"maxInstancesAllowed": 3
}

Use Cases

  • Multiple Guarantors - Up to 3 guarantors per loan
  • Multiple Collateral Items - Multiple assets as collateral
  • Multiple References - Several personal/professional references
  • Multiple Addresses - Multiple contact addresses

Entity Types Reference

The entityType field determines which business entity an Object Definition can be attached to. Use the integer value when creating or filtering definitions.

Core Banking Entities

ValueAliasDescriptionUse Cases
0noneNot AssociatedSystem-level or unattached forms
1entityGeneric EntityBasic entity type when no specific type needed
2contactContactCustomer contact information, KYC forms
3loanLoanLoan applications, credit assessments, collateral
4depositDepositAccount opening forms, deposit agreements
5insurancePolicyInsurance PolicyPolicy forms, coverage details
6insuranceClaimInsurance ClaimsClaim submission, assessment forms
11transactionTransactionTransaction approvals, audit trails

Channel Entities

ValueAliasDescriptionUse Cases
100customerRegistrationCustomerCustomer onboarding, registration forms
101loanRequestLoan RequestOnline loan applications, quote requests
102transferRequestTransfer RequestTransfer approvals, verification
103billsPaymentRequestBills Payment RequestPayment confirmations, receipts
104airtimeRechargeRequestAirtime Recharge RequestRecharge transactions
105dataRechargeRequestData Recharge RequestData bundle purchases

Operations Entities

ValueAliasDescriptionUse Cases
200reconciliationReconciliationReconciliation reports, variance forms
13tellerTeller TransactionTeller approval forms, transaction logs
14inwardTransactionInward TransactionIncoming transaction processing

System Entities

ValueAliasDescriptionUse Cases
15scheduledProcessScheduled ProcessAutomated process forms, scheduled tasks

Examples

Loan Credit Assessment:

{
"code": "loan_credit_assessment",
"name": "Loan Credit Assessment Form",
"entityType": 3, // Loan entity
"description": "Credit scoring and risk assessment for loan applications"
}

Customer KYC:

{
"code": "customer_kyc_verification",
"name": "Customer KYC Verification",
"entityType": 2, // Contact entity
"description": "Know Your Customer verification form"
}

Transfer Approval:

{
"code": "transfer_approval_checklist",
"name": "Transfer Approval Checklist",
"entityType": 102, // Transfer Request entity
"description": "Approval checklist for transfer requests"
}

Best Practices

1. Code Naming Convention

Use hierarchical, descriptive codes:

entity_category_purpose

Examples:

  • loan_kyc_identity_verification
  • customer_credit_score_card
  • account_compliance_audit_checklist

2. Schema Design

DO:

  • Use clear, descriptive field names
  • Add description to all fields
  • Set appropriate validation rules
  • Use enums for fixed value lists

DON'T:

  • Use abbreviations without context
  • Skip required field definitions
  • Create overly nested structures

3. Conditional Logic

DO:

  • Keep conditions simple and readable
  • Test conditions thoroughly
  • Document condition logic

DON'T:

  • Create complex nested conditions
  • Use conditions for business logic (use workflows instead)
  • Reference unavailable properties

4. Client Scripts

DO:

  • Keep scripts focused and modular
  • Handle errors gracefully
  • Test all code paths

DON'T:

  • Make API calls from client scripts
  • Modify system data directly
  • Create performance bottlenecks

Error Handling

Common Errors

Duplicate Code:

{
"isSuccessful": false,
"message": "ObjectDefinition with code 'loan_credit_assessment' already exists."
}

Invalid Entity Type:

{
"isSuccessful": false,
"message": "Invalid entity type: 99. See Entity Types Reference for valid values."
}

Invalid JSON Schema:

{
"isSuccessful": false,
"message": "Invalid JSON Schema: Expected 'properties' field"
}

Form Not Found:

{
"isSuccessful": false,
"message": "Form with ID 25 not found."
}

See Also


Last Updated: January 19, 2026
Version: 1.0