Interface WfRunVariable


  • public interface WfRunVariable
    A WfRunVariable is a handle on a Variable in a WfSpec.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      WfRunVariable jsonPath​(java.lang.String path)
      Valid only for output of the JSON_OBJ or JSON_ARR types.
      WfRunVariable withIndex​(@NonNull io.littlehorse.sdk.common.proto.IndexType indexType)
      Enables the storage of variables with a Non-null IndexType.
      WfRunVariable withJsonIndex​(@NonNull java.lang.String jsonPath, @NonNull io.littlehorse.sdk.common.proto.IndexType indexType)
      Enables the storage of specific attributes inside a Json Variable.
    • Method Detail

      • jsonPath

        WfRunVariable jsonPath​(java.lang.String path)
        Valid only for output of the JSON_OBJ or JSON_ARR types. Returns a new NodeOutput handle which points to Json element referred to by the json path.

        Can only be called once--you can't call node.jsonPath().jsonPath().

        Parameters:
        path - is the json path to evaluate.
        Returns:
        a NodeOutput.
      • withIndex

        WfRunVariable withIndex​(@NonNull
                                @NonNull io.littlehorse.sdk.common.proto.IndexType indexType)
        Enables the storage of variables with a Non-null IndexType. For enhanced efficiency, it offers two types of indexing: Remote Index and Local Index. Remote: This type of indexing is recommended for variables with low cardinality, which means they have relatively few distinct values. For example, storing userId. Local: Local Index is designed for variables with high cardinality.
        Parameters:
        indexType - Defines Local or Remote Index
        Returns:
        same WfRunVariable instance
      • withJsonIndex

        WfRunVariable withJsonIndex​(@NonNull
                                    @NonNull java.lang.String jsonPath,
                                    @NonNull
                                    @NonNull io.littlehorse.sdk.common.proto.IndexType indexType)
        Enables the storage of specific attributes inside a Json Variable. For enhanced efficiency, it offers two types of indexing: Remote Index and Local Index. Remote: This type of indexing is recommended for variables with low cardinality, which means they have relatively few distinct values. For example, storing userId. Local: Local Index is designed for variables with high cardinality.
        Parameters:
        indexType - Defines Local or Remote Index
        jsonPath - Json Attribute path starting with $. e.g: $.userId
        Returns:
        same WfRunVariable instance
        Throws:
        io.littlehorse.sdk.common.exception.LHMisconfigurationException - if jsonPath doesn't start with $. or adding a jsonIndex to a non-json variable