Interface IEvaluationEngine


  • public interface IEvaluationEngine
    Evaluation engine performs asynchronous evaluation or modification of expressions or variables in a specified stack frame of 1C:Enterprise Runtime debug target. IEvaluationEngine sends requests to 1C:Enterprise debug server and asynchronously reports result to provided evaluation listeners.

    Evaluation results are represented as tree in 1C:Enterprise Runtime debug model. 1C:Enterprise Runtime debug server stores entire expression evaluation result by evaluation request and returns its parts by properly constructed BslValuePath. Each evaluation has some unique UUID and client may access to a child value nodes by the this UUID and child BslValuePath.

    1C:Enterprise Runtime debug server may perform multiple evaluations with single evaluation request faster than multiple evaluation requests with single evaluations in each. So debug server client may contstruct a single IEvaluationChain with multiple requests and send it as single evaluation request.

    Example of usage:

     // define evaluating expression
     BslValuePath path = new BslValuePath("new SpreadsheetDocument()");
    
     // generate random UUID to have access to child evaluation nodes later (if we want)
     UUID expressionUuid = UUID.randomUUID();
    
     // evaluate expression as context value - value with properties
     IEvaluationRequest request = new EvaluationRequest(stackFrame, expressionUuid, path, ViewInterface.CONTEXT,
         result -> {
             // this code will be performed asynchronously
             if (result.isSuccess())
             {
                 showResult(result.getResult());
             }
             else
             {
                 showError(result.getErrorMessage());
             }
         });
    
     // send evaluation request
     evaliationEngine.evaluateExpression(request);
     
    See Also:
    BslValuePath, IEvaluationRequest, IEvaluationChain, IEvaluationResult, IEvaluationListener
    Restriction:
    This interface is not intended to be extended by clients.
    Restriction:
    This interface is not intended to be implemented by clients.
    • Method Detail

      • evaluateExpression

        void evaluateExpression​(IEvaluationRequest request)
                         throws org.eclipse.debug.core.DebugException
        Asynchronously evaluates the given evaluation request. Request contains information about the BSL value path, the stack frame and the expression UUID. 1C:Enterprise Runtime stores entire expression evaluation and client can access to a child value nodes by the same UUID.

        Method will send a request to 1C:Enterprise Runtime and report result back to the given listener.

        Parameters:
        request - the evaluation request to perform, cannot be null
        Throws:
        org.eclipse.debug.core.DebugException - if evaluation fails
        IllegalStateException - if engine has been disposed
        See Also:
        IEvaluationRequest
      • evaluateExpressions

        void evaluateExpressions​(IEvaluationChain chain,
                                 DebugTargetId runtimeDebugTarget)
                          throws org.eclipse.debug.core.DebugException
        Asynchronously evaluates given evaluation chain. Chain requests contains information about the BSL value path, the stack frame and the expression UUID. 1C:Enterprise Runtime stores entire expression evaluation and client can access to a child value nodes by the same UUID.

        Method will send requests to 1C:Enterprise Runtime and report result back to chain result listeners.

        Parameters:
        chain - the evaluation requests chain to perform, cannot be null
        Throws:
        org.eclipse.debug.core.DebugException - if evaluation fails
        IllegalStateException - if engine has been disposed
        See Also:
        IEvaluationChain
      • evaluateVariables

        void evaluateVariables​(IBslStackFrame stackFrame,
                               IEvaluationListener evaluationListener)
                        throws org.eclipse.debug.core.DebugException
        Asynchronously evaluates the given stack frame local variables. Variables can be obtained as child nodes of the result evaluated expression.

        Method will send a request to 1C:Enterprise Runtime and report result back to the given listener.

        Parameters:
        stackFrame - the stack frame to evaluate local variables for, cannot be null
        evaluationListener - the listener to report result to, when expression will be evaluated, cannot be null
        Throws:
        org.eclipse.debug.core.DebugException - if evaluation fails
        IllegalStateException - if engine has been disposed
      • modifyExpression

        void modifyExpression​(IModificationRequest request)
                       throws org.eclipse.debug.core.DebugException
        Asynchronously evaluates the given expression by the given value path on the given stack frame with the given expression UUID. 1C:Enterprise Runtime stores entire expression evaluation and client can access to a child value nodes by the same UUID.

        Method will send a request to 1C:Enterprise Runtime and report result back to the given listener.

        Parameters:
        request - the modification request to perform, cannot be null
        Throws:
        org.eclipse.debug.core.DebugException - if changing value fails
        IllegalStateException - if engine has been disposed
        See Also:
        IModificationRequest
      • modifyExpression

        <T> void modifyExpression​(ITypedModificationRequest<T> request)
                           throws org.eclipse.debug.core.DebugException
        Asynchronously evaluates the given expression by the given value path on the given stack frame with the given expression UUID. 1C:Enterprise Runtime stores entire expression evaluation and client can access to a child value nodes by the same UUID.

        Method will send a request to 1C:Enterprise Runtime and report result back to the given listener.

        Parameters:
        request - the typed modification request to perform, cannot be null
        Throws:
        org.eclipse.debug.core.DebugException - if changing value fails
        IllegalStateException - if engine has been disposed
        See Also:
        ITypedModificationRequest
      • dispose

        void dispose()
        Disposes this evaluation engine. This causes the evaluation engine to cleanup any resources that it maintains. Clients should call this method, when they are finished performing evaluations with this engine.

        This engine must not be used to perform evaluations after it has been disposed, IllegalStateException will be thrown otherwise.