Enum Class PerspectiveScriptSurface

java.lang.Object
java.lang.Enum<PerspectiveScriptSurface>
com.inductiveautomation.perspective.designer.ai.PerspectiveScriptSurface
All Implemented Interfaces:
Serializable, Comparable<PerspectiveScriptSurface>, Constable

public enum PerspectiveScriptSurface extends Enum<PerspectiveScriptSurface>

A Perspective scripting surface whose Jython body an AI assist can be mounted on, and the key its framing is looked up by through PerspectiveScriptGrounding.callerContextFor(PerspectiveScriptSurface) or, for the surfaces whose framing reads live form state, that surface's own variant.

Each constant stands for fixed, code-verified facts about that body — its signature, what it receives, what it must return, and the traps particular to it — so passing one constant selects a whole coherent framing rather than assembling one from loose strings at each call site.

The constants cover component-scoped scripts only. Session and page event scripts are not surfaces here, and neither are script actions or script transforms; see the package documentation.

Every one of these surfaces edits an ExtensionFunctionPanel, whose first line is a locked def the host owns. That is why they share a mounting path: the agent must be told to emit a body only, and PlatformAgentFactory.extensionFunctionAgent(ExtensionFunctionDescriptor) is what says so.

  • Nested Class Summary

    Nested classes/interfaces inherited from class Enum

    Enum.EnumDesc<E>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    A user-named custom method on a component, reached as an attribute of that component from any other Perspective script — self.getSibling('Button1').myMethod(arg).
    A component-type-declared extension function — the set differs per component type, and the signature and prose come from the type's own descriptor rather than from anything the user typed.
    onMessageReceived(self, payload), run when a message whose type code matches this handler's arrives at the component through one of the listen scopes it subscribes to.
    valueChanged(self, previousValue, currentValue, origin, missedEvents), run in the Gateway each time the property it is attached to changes.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the enum constant of this class with the specified name.
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • CUSTOM_METHOD

      public static final PerspectiveScriptSurface CUSTOM_METHOD
      A user-named custom method on a component, reached as an attribute of that component from any other Perspective script — self.getSibling('Button1').myMethod(arg). Its name and parameter list are edited live alongside the body.
    • MESSAGE_HANDLER

      public static final PerspectiveScriptSurface MESSAGE_HANDLER
      onMessageReceived(self, payload), run when a message whose type code matches this handler's arrives at the component through one of the listen scopes it subscribes to. Returns nothing.
    • EXTENSION_FUNCTION

      public static final PerspectiveScriptSurface EXTENSION_FUNCTION
      A component-type-declared extension function — the set differs per component type, and the signature and prose come from the type's own descriptor rather than from anything the user typed.
    • PROPERTY_CHANGE_SCRIPT

      public static final PerspectiveScriptSurface PROPERTY_CHANGE_SCRIPT
      valueChanged(self, previousValue, currentValue, origin, missedEvents), run in the Gateway each time the property it is attached to changes.
  • Method Details

    • values

      public static PerspectiveScriptSurface[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static PerspectiveScriptSurface valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null