org.licas.autonomic.script

## Class AutoInvoke

- java.lang.Object
- - org.licas.autonomic.script.AutoInvoke

-     public class AutoInvoke
      extends java.lang.Object

  This performs all of the necessary operations to invoke a script method and process the result.
  Author:
    Kieran Greer

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AutoInvoke(AutoEngineInfo thisAutoInfo, java.util.ArrayList thisParamList, ObjectsMap thisObjectsMap, Service thisService)` Create a new instance of AutoInvoke and set the method variables and objects.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `AutoOut` | `invokeMethod()` Invoke the method in the `autoInfo` object, making variable replacements first.
    `protected boolean` | `isLicasCall(java.lang.Object evaluator)` Return true if the evaluator object indicates a licas service that should be invoked.
    `protected boolean` | `isWsCall(java.lang.Object evaluator)` Return true if the evaluator object indicates a web service that should be invoked.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AutoInvoke

          public AutoInvoke(AutoEngineInfo thisAutoInfo,
                            java.util.ArrayList thisParamList,
                            ObjectsMap thisObjectsMap,
                            Service thisService)

      Create a new instance of AutoInvoke and set the method variables and objects.
      Parameters:
        `thisAutoInfo` - the process script elements parsed into their actual objects and definitions.
        `thisParamList` - an external set of `KeyValue` objects that can replace named or tagged fields in the method parameter lists. If empty or no match, then nothing gets changed.
        `thisObjectsMap` - mapping of variable names to instances. This method can ad more variables, but should be for the method invocation only, so immediately cloned.
        `thisService` - the service to execute on.

  - ### Method Detail

    - #### invokeMethod

          public AutoOut invokeMethod()
                               throws LicasException,
                                      java.lang.Exception

      Invoke the method in the `autoInfo` object, making variable replacements first. From that object, the `evaluator` is used to execute the `method`. The evaluation can be compared to the `function`. The `input` can be used to replace a tagged `Const`.`QUERY` parameter and so should be an XML element. If the reply is OK, the autoInfo `effOutput` is returned as the next set of actions.
      Returns:
        the result of the evaluation. This is the `effector list` of the input parameter if the evaluation is true, or an empty list if it is false. Evaluating to true can include matching exactly to an XML description, or just have any result, for example, by using a `checkReply` method.
      Throws:
        `LicasException` - for a licas-specific mapping problem.
        `java.lang.Exception` - any error.

    - #### isLicasCall

          protected boolean isLicasCall(java.lang.Object evaluator)

      Return true if the evaluator object indicates a licas service that should be invoked.
      Parameters:
        `evaluator` - the evaluator object.
      Returns:
        true if it indicates a licas service to perform the evaluation.

    - #### isWsCall

          protected boolean isWsCall(java.lang.Object evaluator)

      Return true if the evaluator object indicates a web service that should be invoked.
      Parameters:
        `evaluator` - the evaluator object.
      Returns:
        true if it indicates a web service to perform the evaluation.