Problems
Overview
Module
- package:
org.eclipse.dirigible.sdk.platform - source: platform/Problems.java
Surfaces the platform's "problems" table — the source of truth for build, synchronization, and validation failures the IDE Problems perspective renders. Use this from custom synchronizers, validation jobs, or compile-time tooling to record entries that should reach the developer.
Each entry pins a location (project/file:line:column) plus a severity / category, so IDE navigation works without further wiring. updateStatus(Long, String) is the mechanism for marking a problem resolved without deleting it (preserving history for audits).
Key Features
- IDE-visible entries: Anything added here appears in the Problems perspective.
- Location-aware: Each entry carries
project/file:line:columnfor one-click navigation. - Status lifecycle: Mark entries resolved without losing the historical record.
- Bulk operations: Delete or update many entries by id, or wipe the table entirely.
Example Usage
import java.util.List;
import org.eclipse.dirigible.sdk.platform.Problems;
// Record a problem found by a custom validator:
Problems.add(
"demo/handlers/hello.ts", // location
"ERROR", // type / severity
"12", // line
"4", // column
"Identifier 'foo' is not defined", // cause
"Did you mean 'bar'?", // expected
"TYPESCRIPT", // category
"platform-ts", // module
"type-checker", // source
"demo-validator" // program
);
// Fetch all problems as a JSON string:
String all = Problems.fetchAll();
// Mark several resolved:
Problems.updateStatusMultiple(List.of(1L, 2L, 3L), "RESOLVED");Methods
add()
Inserts a new entry into the problems table.
javapublic static void add(String location, String type, String line, String column, String cause, String expected, String category, String module, String source, String program);
Parameter Type Description locationStringThe project/filelocation of the problem.typeStringThe severity / type (e.g. "ERROR","WARNING").lineStringThe line number within the file. columnStringThe column number within the file. causeStringA description of the problem. expectedStringA hint at what was expected (or how to resolve). categoryStringFree-form category (e.g. "TYPESCRIPT","BPM").moduleStringThe module that produced the entry. sourceStringThe component that detected the problem. programStringThe program / tool name. Returns
- Type:
void
fetchAll()
Returns every entry in the problems table as a serialized string.
javapublic static String fetchAll();Returns
- Type:
String- Description: A JSON serialization of all problems.
fetchBatch()
Returns a paginated batch of problems matching the given SQL WHERE-style condition.
javapublic static String fetchBatch(String condition, int limit);
Parameter Type Description conditionStringA SQL-style condition expression (without WHERE).limitintMaximum number of rows to return. Returns
- Type:
String- Description: A JSON serialization of the matching problems.
find()
Looks up a single problem by id.
javapublic static String find(Long id);
Parameter Type Description idLongThe problem id. Returns
- Type:
String- Description: A JSON serialization of the matching problem, or empty if none.
delete()
Removes a single problem by id.
javapublic static void delete(Long id);
Parameter Type Description idLongThe problem id. Returns
- Type:
void
deleteMultiple()
Removes several problems by id in one call.
javapublic static void deleteMultiple(List<Long> ids);
Parameter Type Description idsList<Long>The problem ids to remove. Returns
- Type:
void
deleteByStatus()
Removes every problem whose status matches the given value.
javapublic static void deleteByStatus(String status);
Parameter Type Description statusStringThe status value to match (e.g. "RESOLVED").Returns
- Type:
void
clear()
Removes every entry from the problems table.
javapublic static void clear();Returns
- Type:
void
updateStatus()
Sets the status of a single problem (e.g. to "RESOLVED") without deleting the row.
javapublic static void updateStatus(Long id, String status);
Parameter Type Description idLongThe problem id. statusStringThe new status value. Returns
- Type:
void
updateStatusMultiple()
Sets the status of many problems in one call.
javapublic static void updateStatusMultiple(List<Long> ids, String status);
Parameter Type Description idsList<Long>The problem ids. statusStringThe new status value to apply to all of them. Returns
- Type:
void