Class RuleSetRunner

    • Constructor Detail

      • RuleSetRunner

        public RuleSetRunner​(EvaluationContext context)
        Creates a new instance of RuleSetRunner for the specified evaluation context.
        Parameters:
        context - the ruleset evaluation context.
    • Method Detail

      • run

        public void run​(Operation operation)
        Requests the execution of the specified 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.

        Overrides:
        run in class com.sodius.mdw.internal.core.operations.InternalRuleSetRunner
        Parameters:
        operation - the operation to execute.
        See Also:
        writeStatus(OperationStatus, String)
      • writeStatus

        public void writeStatus​(OperationStatus status,
                                String filename)
        Writes the specified operation status tree into a file.

        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.

        Overrides:
        writeStatus in class com.sodius.mdw.internal.core.operations.InternalRuleSetRunner
        Parameters:
        status - the operation status to log.
        filename - the relative path of the log file to generate (e.g. log.html).
        See Also:
        EvaluationResult.getReport()
      • writeStatus

        public void writeStatus​(OperationStatus status,
                                String filename,
                                StatusWriter writer)
        Writes the specified operation status tree into a file, using the specified status writer.

        The specified filename must be a relative path (e.g. log.html).

        The generated file is then accessible from the evaluation result.

        Overrides:
        writeStatus in class com.sodius.mdw.internal.core.operations.InternalRuleSetRunner
        Parameters:
        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.
        See Also:
        EvaluationResult.getReport()
      • logError

        public void logError​(OperationStatus status)
        Logs information if the execution of an 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.

        Overrides:
        logError in class com.sodius.mdw.internal.core.operations.InternalRuleSetRunner
        Parameters:
        status - the operation status.
        See Also:
        writeStatus(OperationStatus, String)