Skip to main content

BPM Lookup API Reference

Overview​

The BPM Lookup endpoints provide lightweight, fast access to commands and process definitions for use in dropdowns, autocomplete fields, and quick reference lookups.


Endpoints​

1. Get All Commands Lookup​

Endpoint: GET /api/bpm/commands/lookup

Authorization: Required (Bearer token)

Description: Retrieves a lightweight list of all commands and command chains with only essential fields. Used for dropdowns, autocomplete, and quick reference.

Response​

{
"isSuccess": true,
"message": "Retrieved 150 commands for lookup",
"data": [
{
"id": 1,
"name": "CreateLoanApplication",
"description": "Creates a new loan application in the system",
"uniqueIdentifier": "a1b2c3d4-e5f6-7890-ab12-34567890cdef",
"category": "Loan",
"commandType": "Chain"
},
{
"id": 2,
"name": "SendNotification",
"description": "Sends SMS/Email notification to customer",
"uniqueIdentifier": "f4e3d2c1-b0a9-8765-4321-fedcba987654",
"category": "Notification",
"commandType": "Native"
}
]
}

Response Fields​

FieldTypeDescription
idnumberDatabase ID of the command
namestringDisplay name of the command
descriptionstringBrief description of what the command does
uniqueIdentifierstringImmutable GUID for reliable lookups
categorystringCategory/grouping (e.g., "Loan", "Deposit", "Customer")
commandTypestringType of command (e.g., "Native", "Chain", "Script")

Example Usage​

cURL:

curl -X GET "https://your-api.com/api/bpm/commands/lookup" \
-H "Authorization: Bearer YOUR_TOKEN_HERE"

JavaScript (Fetch):

const response = await fetch('/api/bpm/commands/lookup', {
method: 'GET',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
}
});

const result = await response.json();
const commands = result.data;

// Use in dropdown
const dropdown = commands.map(cmd => ({
value: cmd.id,
label: cmd.name,
description: cmd.description
}));

C# (.NET):

var httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", token);

var response = await httpClient.GetAsync("/api/bpm/commands/lookup");
var result = await response.Content.ReadAsAsync<ClientCommandResult>();
var commands = result.Data as List<CommandLookupDto>;

2. Get All Process Definitions Lookup​

Command-engine name: GetAllProcessDefinitionsLookupCommand

Endpoint: GET /api/bpm/processes/lookup

Authorization: Required (Bearer token)

Description: Retrieves a lightweight list of all BPMN process definitions with only essential fields. Used for dropdowns, autocomplete, and quick reference.

The same lookup is available through the BankLingo command engine:

{
"cmd": "GetAllProcessDefinitionsLookupCommand",
"data": {}
}

The command accepts no input parameters. It returns all non-deleted definitions ordered by name and cached per tenant. For the complete command contract, workflow-entity example, cache behavior, and comparison with the paginated list query, see GetAllProcessDefinitionsLookupCommand.

Response​

{
"isSuccess": true,
"message": "Retrieved 75 process definitions for lookup",
"data": [
{
"id": 1,
"name": "Loan Approval Workflow",
"description": "End-to-end loan approval process with credit checks",
"uniqueIdentifier": "b2c3d4e5-f6a7-8901-bc23-456789abcdef",
"category": "Loan Processing",
"processType": "Manual",
"triggerEventType": "OnLoanCreation",
"entityType": "Loan",
"version": "2.1.0"
},
{
"id": 2,
"name": "Customer Onboarding",
"description": "KYC verification and account setup workflow",
"uniqueIdentifier": "c3d4e5f6-a7b8-9012-cd34-567890bcdef1",
"category": "Customer Management",
"processType": "Automated",
"triggerEventType": "OnCustomerCreation",
"entityType": "Contact",
"version": "1.5.2"
},
{
"id": 3,
"name": "Daily Reconciliation Job",
"description": "Automated reconciliation of transactions",
"uniqueIdentifier": "d4e5f6a7-b8c9-0123-de45-6789abcdef12",
"category": "Reconciliation",
"processType": "Scheduled",
"triggerEventType": "OnReconciliationJobStart",
"entityType": null,
"version": "3.0.0"
}
]
}

Response Fields​

FieldTypeDescription
idnumberDatabase ID of the process definition
namestringDisplay name of the process
descriptionstringBrief description of what the process does
uniqueIdentifierstringImmutable GUID for reliable lookups
categorystringCategory/grouping (e.g., "Loan Approval", "Customer Onboarding")
processTypestringType of process (e.g., "Manual", "Automated", "Scheduled")
triggerEventTypestringEvent that triggers this process (e.g., "OnLoanCreation", "None")
entityTypestringEntity type associated with process (e.g., "Loan", "Deposit", "Contact") - can be null
versionstringVersion of the process definition

Example Usage​

cURL:

curl -X GET "https://your-api.com/api/bpm/processes/lookup" \
-H "Authorization: Bearer YOUR_TOKEN_HERE"

JavaScript (Fetch):

const response = await fetch('/api/bpm/processes/lookup', {
method: 'GET',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
}
});

const result = await response.json();
const processes = result.data;

// Use in dropdown with filtering
const loanProcesses = processes.filter(p => p.entityType === 'Loan');

const dropdown = loanProcesses.map(proc => ({
value: proc.id,
label: proc.name,
badge: proc.processType,
description: proc.description
}));

C# (.NET):

var httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", token);

var response = await httpClient.GetAsync("/api/bpm/processes/lookup");
var result = await response.Content.ReadAsAsync<ClientCommandResult>();
var processes = result.Data as List<ProcessDefinitionLookupDto>;

// Filter by category
var loanProcesses = processes
.Where(p => p.Category == "Loan Processing")
.ToList();

Common Use Cases​

1. Populate Command Dropdown in Admin UI​

// Fetch and populate dropdown
async function loadCommandDropdown() {
const response = await fetch('/api/bpm/commands/lookup', {
headers: { 'Authorization': `Bearer ${getToken()}` }
});

const result = await response.json();
const select = document.getElementById('commandSelect');

result.data.forEach(cmd => {
const option = new Option(
`${cmd.name} - ${cmd.category}`,
cmd.id
);
option.title = cmd.description;
select.add(option);
});
}

2. Autocomplete Search for Commands​

async function searchCommands(query) {
const response = await fetch('/api/bpm/commands/lookup', {
headers: { 'Authorization': `Bearer ${getToken()}` }
});

const result = await response.json();

return result.data
.filter(cmd =>
cmd.name.toLowerCase().includes(query.toLowerCase()) ||
cmd.description.toLowerCase().includes(query.toLowerCase())
)
.slice(0, 10); // Limit to top 10 results
}

3. Build Process Definition Catalog​

async function buildProcessCatalog() {
const response = await fetch('/api/bpm/processes/lookup', {
headers: { 'Authorization': `Bearer ${getToken()}` }
});

const result = await response.json();

// Group by category
const catalog = result.data.reduce((acc, proc) => {
if (!acc[proc.category]) {
acc[proc.category] = [];
}
acc[proc.category].push(proc);
return acc;
}, {});

return catalog;
}

4. Filter Processes by Entity Type (C#)​

public async Task<List<ProcessDefinitionLookupDto>> GetProcessesForEntity(string entityType)
{
var httpClient = new HttpClient();
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", _token);

var response = await httpClient.GetAsync("/api/bpm/processes/lookup");
var result = await response.Content.ReadAsAsync<ClientCommandResult>();
var allProcesses = result.Data as List<ProcessDefinitionLookupDto>;

return allProcesses
.Where(p => p.EntityType == entityType)
.OrderBy(p => p.Name)
.ToList();
}

Performance Notes​

  • Caching: Both endpoints return cached data for optimal performance
  • Response Size: Lightweight - only essential fields returned
  • Use Case: Perfect for:
    • Admin UI dropdowns
    • Autocomplete fields
    • Quick reference lookups
    • Process selection dialogs
    • Command chain builders

Error Responses​

401 Unauthorized​

{
"isSuccess": false,
"message": "Unauthorized access"
}

500 Internal Server Error​

{
"isSuccess": false,
"message": "Error retrieving commands lookup: Database connection failed"
}

See Also​