Package io.littlehorse.sdk.wfsdk
Interface WfRunVariable
-
public interface WfRunVariableA WfRunVariable is a handle on a Variable in a WfSpec.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description WfRunVariablejsonPath(java.lang.String path)Valid only for output of the JSON_OBJ or JSON_ARR types.WfRunVariablewithIndex(@NonNull io.littlehorse.sdk.common.proto.IndexType indexType)Enables the storage of variables with a Non-nullIndexType.WfRunVariablewithJsonIndex(@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-nullIndexType. 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
WfRunVariableinstance
-
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 IndexjsonPath- Json Attribute path starting with $. e.g: $.userId- Returns:
- same
WfRunVariableinstance - Throws:
io.littlehorse.sdk.common.exception.LHMisconfigurationException- if jsonPath doesn't start with $. or adding a jsonIndex to a non-json variable
-
-