Skip to content

Problems

Overview

Module

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:column for 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

java
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.

java
public static void add(String location, String type, String line, String column, String cause, String expected, String category, String module, String source, String program);
ParameterTypeDescription
locationStringThe project/file location 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.

java
public 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.

java
public static String fetchBatch(String condition, int limit);
ParameterTypeDescription
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.

java
public static String find(Long id);
ParameterTypeDescription
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.

java
public static void delete(Long id);
ParameterTypeDescription
idLongThe problem id.

Returns

  • Type: void

deleteMultiple()

Removes several problems by id in one call.

java
public static void deleteMultiple(List<Long> ids);
ParameterTypeDescription
idsList<Long>The problem ids to remove.

Returns

  • Type: void

deleteByStatus()

Removes every problem whose status matches the given value.

java
public static void deleteByStatus(String status);
ParameterTypeDescription
statusStringThe status value to match (e.g. "RESOLVED").

Returns

  • Type: void

clear()

Removes every entry from the problems table.

java
public static void clear();

Returns

  • Type: void

updateStatus()

Sets the status of a single problem (e.g. to "RESOLVED") without deleting the row.

java
public static void updateStatus(Long id, String status);
ParameterTypeDescription
idLongThe problem id.
statusStringThe new status value.

Returns

  • Type: void

updateStatusMultiple()

Sets the status of many problems in one call.

java
public static void updateStatusMultiple(List<Long> ids, String status);
ParameterTypeDescription
idsList<Long>The problem ids.
statusStringThe new status value to apply to all of them.

Returns

  • Type: void

Released under the EPL-2.0 License.