diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/assembler/DuplicateProcess.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/assembler/DuplicateProcess.java index c0888e7d76c..ea1334743e9 100644 --- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/assembler/DuplicateProcess.java +++ b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/assembler/DuplicateProcess.java @@ -28,16 +28,8 @@ public class DuplicateProcess extends ConfigurableSeverityResult { public static final String KEY = "duplicateProcess"; private static final int[] line = new int[0]; - private String processId; - public DuplicateProcess(Process process, KnowledgeBuilderConfiguration config) { - super(process.getResource(), config); - processId = process.getId(); - } - - @Override - public String getMessage() { - return "Process with same id already exists: " + processId; + super(process.getResource(), config, "Process with same id already exists: " + process.getId()); } @Override diff --git a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/ProcessLoadError.java b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/ProcessLoadError.java index b0d95e97728..c7a2b9340db 100644 --- a/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/ProcessLoadError.java +++ b/jbpm/jbpm-flow-builder/src/main/java/org/jbpm/compiler/ProcessLoadError.java @@ -25,22 +25,18 @@ * This is used for reporting errors with loading a ruleflow. */ public class ProcessLoadError extends DroolsError { - - private String message; - private Exception exception; private static final int[] lines = new int[0]; public ProcessLoadError(Resource resource, String message, Exception nested) { - super(resource); - this.message = message; - this.exception = nested; + super(resource, getSpecificMessage(message, nested)); } + @Override public int[] getLines() { return this.lines; } - public String getMessage() { + private static String getSpecificMessage(String message, Exception exception) { if (exception != null) { return message + " : Exception " + exception.getClass() + " : " + exception.getMessage(); } else { diff --git a/kogito-codegen-modules/kogito-codegen-rules/src/main/java/org/kie/kogito/codegen/rules/QueryGenerator.java b/kogito-codegen-modules/kogito-codegen-rules/src/main/java/org/kie/kogito/codegen/rules/QueryGenerator.java index d0e98d00c14..8057df88934 100644 --- a/kogito-codegen-modules/kogito-codegen-rules/src/main/java/org/kie/kogito/codegen/rules/QueryGenerator.java +++ b/kogito-codegen-modules/kogito-codegen-rules/src/main/java/org/kie/kogito/codegen/rules/QueryGenerator.java @@ -212,14 +212,10 @@ public static class NoBindingQuery extends DroolsError { private final QueryModel query; public NoBindingQuery(QueryModel query) { + super("Query " + query.getName() + " has no bound variable. At least one binding is required to determine the value returned by this query"); this.query = query; } - @Override - public String getMessage() { - return "Query " + query.getName() + " has no bound variable. At least one binding is required to determine the value returned by this query"; - } - @Override public int[] getLines() { return ERROR_LINES;