Freedom UI List Page: "Item process schema "" not found" Error When Running Business Process via Custom Handler with Explicit Parameters
Hi Creatio Community,
We're encountering a puzzling issue on a Freedom UI List Page (specifically, our Invoices_ListPage
) when trying to run a business process (IWVoid_API_POST
) using a custom JavaScript handler. The goal is to test the business process by explicitly passing a hardcoded InvoiceId
, as requested for a specific testing scenario where the button is not on the individual record's form page.
Our Setup:
-
The Button (Menu Item on List Page's ActionButton):
We've added a crt.MenuItem to the ActionButton on our Invoices_ListPage. This menu item is intended for testing and is configured to trigger a custom handler:
JSON
// In viewConfigDiff of Invoices_ListPage.js { "operation": "insert", "name": "TargetVoidButton", // "values": { "type": "crt.MenuItem", "caption": "Test Void BP (Hardcoded ID)", "icon": "debug-icon", "visible": true, "clicked": { "request": "crt.HandleButtonClickRequest", "params": { "buttonName": "RunTargetVoidProcessHandler" } } }, "parentName": "ActionButton", "propertyName": "menuItems", "index": 3 }
-
The Handler (in handlers array of Invoices_ListPage.js):
This handler is designed to run the IWVoid_API_POST process with a specific, hardcoded InvoiceId.
JavaScript
// In handlers array of Invoices_ListPage.js { request: "crt.HandleButtonClickRequest", handler: async (request, next) => { if (request.buttonName === "RunTargetVoidProcessHandler") { console.log("RunTargetVoidProcessHandler triggered."); Terrasoft.showInformation("Test: Running process with hardcoded ID. Check console."); const processName = "IWVoid_API_POST"; const hardcodedInvoiceIdForTest = "3c2b6d9f-4c1e-4364-99f2-53956562b606"; const parameterNameInProcess = "InvoiceId"; console.log(`Test: Attempting to run BP '<span class="math-inline">\{processName\}' with EXPLICIT HARDCODED ID '</span>{hardcodedInvoiceIdForTest}' for parameter '${parameterNameInProcess}'.`); try { const response = await request.$context.executeRequest({ type: "crt.RunBusinessProcessRequest", params: { processName: processName, processParameters: { [parameterNameInProcess]: hardcodedInvoiceIdForTest }, saveAtProcessStart: false, showNotification: true } }); console.log("Test: BP execution request completed. Response:", response); if (response && response.success === true && response.processId && response.processId !== '00000000-0000-0000-0000-000000000000') { const successMsg = `Test: BP '${processName}' (ID: ${response.processId}) initiated. Check Process Log.`; console.log(successMsg); request.$context.showInformationDialog?.(successMsg); } else { let errorMsg = `Test: Failed to start BP '${processName}'.`; let serverDetails = (response && response.errorInfo && response.errorInfo.message) ? response.errorInfo.message : "Details unavailable or process not found (zero ID / success:false)."; errorMsg += ` ${serverDetails}`; console.error(errorMsg, "Full response:", response); request.$context.showErrorDialog?.(errorMsg); } } catch (error) { console.error(`Test: Exception for BP '${processName}':`, error); let exceptionMsg = (error instanceof Error && error.message) ? error.message : "Client-side exception."; if (error.errorInfo && error.errorInfo.message) { exceptionMsg = error.errorInfo.message; } request.$context.showErrorDialog?.(`Test: Error triggering BP: ${exceptionMsg}`); } return; } return next?.handle(request); } }
The Problem:
When we click the "Test Void BP (Hardcoded ID)" menu item, the handler triggers, and the client-side logs show the crt.RunBusinessProcessRequest is being prepared correctly with processName: "IWVoid_API_POST" and the hardcoded InvoiceId.
However, the server responds with:
{ processId: '00000000-0000-0000-0000-000000000000', processStatus: 0, resultParameterValues: null, executionData: null, success: false, errorInfo: { errorCode: "ItemNotFoundException", message: "Item process schema \"\" not found.", // Note the empty quotes for schema name stackTrace: null } }
The key error is <strong>Item process schema "" not found.</strong>
What We've Tried:
- Confirmed the schematic name (Code) of our business process is indeed
IWVoid_API_POST
. - Confirmed the input parameter in the BP designed to take the ID is named
InvoiceId
. - Repeatedly saved, compiled, and published the
IWVoid_API_POST
business process and ensured it's marked as "Active." - Checked the package containing the process for any errors and recompiled the package.
- Performed thorough browser cache clearing and hard refreshes (Ctrl+F5).
- We also have another menu item on the same list page ("VoidInvoice") that uses a declarative
crt.RunBusinessProcessRequest
withprocessRunType: "ForTheSelectedRecords"
andparameterMappings: { "InvoiceId": "Id" }
. When a record is selected and this menu item is clicked, it successfully starts the<strong>IWVoid_API_POST</strong>
process (verified in Creatio Process Log with a non-zero instance ID). This makes the current error even more puzzling.
Our Questions for the Community:
- Why would the
ProcessEngineService
reportItem process schema "" not found
(with empty quotes for the schema name) when theprocessName: "IWVoid_API_POST"
is explicitly and correctly provided in theparams
ofcrt.RunBusinessProcessRequest
from our custom handler? - Is there any known difference in how process names are resolved or how schemas are looked up by the server when
crt.RunBusinessProcessRequest
is invoked programmatically from a handler withprocessParameters
explicitly set (using a hardcoded ID), versus when it's invoked declaratively withprocessRunType: "ForTheSelectedRecords"
orprocessRunType: "ForTheSelectedPage"
? - Are there any deeper caching mechanisms (server-side, metadata) or specific registration steps for business process schemas that we might be missing, which could lead to this behavior only for the explicit parameter call?
- Has anyone encountered a similar situation where a process is findable/runnable via one SDK invocation method (declarative, context-based) but not another (programmatic handler, explicit parameters) from the same Freedom UI page type?
We are unable to access detailed server-side application logs for this specific environment at the moment, which is hampering deeper diagnosis from our end.
Any insights, suggestions, or similar experiences would be greatly appreciated!
Thank you!
Like
Hi Andrew,
The behavior you described where the system responds with Item process schema "" not found despite providing the correct process name can occur when certain required parameters are missing during the execution of a business process from a handler. Specifically, when using crt.RunBusinessProcessRequest from a crt.HandleButtonClickRequest handler, the backend expects additional context that is typically provided automatically during declarative invocations.
To ensure that the process schema is correctly identified and executed, it is important to explicitly include the processRunType, the recordIdProcessParameterName. These parameters provide the necessary linkage between the UI context and the process runtime.
Below is an example of a working implementation where a business process is successfully launched from a button on a Freedom UI page. The button configuration and handler explicitly define all required fields:
Button configuration:
{
"operation": "insert",
"name": "Button_7y0uys4",
"values": {
"layoutConfig": {
"column": 1,
"row": 2,
"colSpan": 1,
"rowSpan": 1
},
"type": "crt.Button",
"caption": "#ResourceString(Button_7y0uys4_caption)#",
"color": "outline",
"disabled": false,
"size": "large",
"iconPosition": "only-text",
"visible": true,
"clicked": {
"request": "crt.HandleButtonClickRequest",
"params": {
"buttonName": "RunTestProcess",
"processName": "UsrTestProcessInvoiceAdded",
"processRunType": "ForTheSelectedPage",
"recordIdProcessParameterName": "InvoiceId"
}
}
},
"parentName": "SideAreaProfileContainer",
"propertyName": "items",
"index": 1
}
Handler logic:
{
request: "crt.HandleButtonClickRequest",
handler: async (request, next) => {
if (request.buttonName === "RunTestProcess") {
const handlerChain = sdk.HandlerChainService.instance;
const result = await handlerChain.process({
type: "crt.RunBusinessProcessRequest",
processName: "UsrTestProcessInvoiceAdded",
processRunType: "ForTheSelectedPage",
recordIdProcessParameterName: "InvoiceId",
$context: request.$context
});
if (result.success) {
console.log("The process was successfully executed!");
} else {
console.log("Exception: " + (result.errorInfo?.message || "Unknown issue"));
}
return;
}
return next?.handle(request);
}
}
Answers to your questions:
1. Why would the ProcessEngineService report Item process schema "" not found (with empty quotes for the schema name) when the processName: "IWVoid_API_POST" is explicitly and correctly provided in the params of crt.RunBusinessProcessRequest from our custom handler?
- This usually happens if processRunType, recordIdProcessParameterName are not passed when triggering the process from a handler. These parameters are essential for correctly resolving the process schema in the runtime context.
2. Is there any known difference in how process names are resolved or how schemas are looked up by the server when crt.RunBusinessProcessRequest is invoked programmatically from a handler with processParameters explicitly set (using a hardcoded ID), versus when it's invoked declaratively with processRunType: "ForTheSelectedRecords" or processRunType: "ForTheSelectedPage"?
- Yes. In declarative calls, Creatio automatically adds all required metadata. In programmatic calls (handlers), this metadata must be passed manually, especially processRunType and recordIdProcessParameterName.
3. Are there any deeper caching mechanisms (server-side, metadata) or specific registration steps for business process schemas that we might be missing, which could lead to this behavior only for the explicit parameter call?
- In general, no special registration is required if the process is active and compiled. However, if the process was recently created or modified, reload the page and make sure that the changes in the process were saved.
4. Has anyone encountered a similar situation where a process is findable/runnable via one SDK invocation method (declarative, context-based) but not another (programmatic handler, explicit parameters) from the same Freedom UI page type?
- Yes, this can happen if the required context parameters are not included in the handler call. Declarative calls handle this automatically, whereas in handlers you must explicitly set them.