public final class RuleSetRunner
extends com.sodius.mdw.internal.core.operations.InternalRuleSetRunner
Operation
, which might be decomposed into sub operations, within a ruleset context.
This class is not intended to be subclassed by clients.
Constructor and Description |
---|
RuleSetRunner(EvaluationContext context)
Creates a new instance of
RuleSetRunner for the specified evaluation context. |
Modifier and Type | Method and Description |
---|---|
void |
logError(OperationStatus status)
Logs information if the execution of an
Operation failed or produced warnings. |
void |
run(Operation operation)
Requests the execution of the specified operation.
|
void |
writeStatus(OperationStatus status,
String filename)
Writes the specified operation status tree into a file.
|
void |
writeStatus(OperationStatus status,
String filename,
StatusWriter writer)
Writes the specified operation status tree into a file, using the specified status writer.
|
public RuleSetRunner(EvaluationContext context)
RuleSetRunner
for the specified evaluation context.context
- the ruleset evaluation context.public void run(Operation operation)
If an error occurs during the operation execution, the error is recorded in the operation status. Meaning this run()
call can
never fail.
When the operation execution is completed, a log can be generated by a call to writeStatus()
to have a complete execution trace.
run
in class com.sodius.mdw.internal.core.operations.InternalRuleSetRunner
operation
- the operation to execute.writeStatus(OperationStatus, String)
public void writeStatus(OperationStatus status, String filename)
The specified filename must be a relative path (e.g. log.html
). The filename extension must be either .html
or
.xml
.
The generated file is then accessible from the evaluation result.
writeStatus
in class com.sodius.mdw.internal.core.operations.InternalRuleSetRunner
status
- the operation status to log.filename
- the relative path of the log file to generate (e.g. log.html
).EvaluationResult.getReport()
public void writeStatus(OperationStatus status, String filename, StatusWriter writer)
The specified filename must be a relative path (e.g. log.html
).
The generated file is then accessible from the evaluation result.
writeStatus
in class com.sodius.mdw.internal.core.operations.InternalRuleSetRunner
status
- the operation status to log.filename
- the relative path of the log file to generate (e.g. log.html
).writer
- the status writer used to log the information.EvaluationResult.getReport()
public void logError(OperationStatus status)
Operation
failed or produced warnings.
This method goes down recursively in the specified status tree. If at least an error or a warning is found, a log is printed out using
EvaluationContext.getLogger()
to notify the end user the execution hasn't terminated as expected.
If problems are found and the operation status has been previously logged using writeStatus()
, and additional message is logged to
invite the end user to consult the generated log.
logError
in class com.sodius.mdw.internal.core.operations.InternalRuleSetRunner
status
- the operation status.writeStatus(OperationStatus, String)