java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.stepfunctions.JsonPath
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:39.914Z") @Stability(Stable) public class JsonPath extends software.amazon.jsii.JsiiObject
Extract a field from the State Machine data or context that gets passed around between states.

Example:

 Function fn;
 LambdaInvoke.Builder.create(this, "Invoke Handler")
         .lambdaFunction(fn)
         .resultSelector(Map.of(
                 "lambdaOutput", JsonPath.stringAt("$.Payload"),
                 "invokeRequestId", JsonPath.stringAt("$.SdkResponseMetadata.RequestId"),
                 "staticValue", Map.of(
                         "foo", "bar"),
                 "stateName", JsonPath.stringAt("$.State.Name")))
         .build();
 

See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

    software.amazon.jsii.JsiiObject.InitializationMode
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Special string value to discard state input, output or result.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    JsonPath(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    JsonPath(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    array(@NotNull String... values)
    Make an intrinsic States.Array expression.
    static String
    format(String formatString, @NotNull String... values)
    Make an intrinsic States.Format expression.
    static String
    Use the entire context data structure.
    static String
    Use the entire data structure.
    static String
    Return the Task Token field.
    static Boolean
    Determines if the indicated string is an encoded JSON path.
    static String
    Make an intrinsic States.JsonToString expression.
    static List<String>
    listAt(String path)
    Instead of using a literal string list, get the value from a JSON path.
    static Number
    Instead of using a literal number, get the value from a JSON path.
    Reference a complete (complex) object in a JSON path location.
    static String
    Instead of using a literal string, get the value from a JSON path.
    stringToJson(String jsonString)
    Make an intrinsic States.StringToJson expression.

    Methods inherited from class software.amazon.jsii.JsiiObject

    jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Field Details

    • DISCARD

      @Stability(Stable) public static final String DISCARD
      Special string value to discard state input, output or result.
  • Constructor Details

    • JsonPath

      protected JsonPath(software.amazon.jsii.JsiiObjectRef objRef)
    • JsonPath

      protected JsonPath(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
  • Method Details

    • array

      @Stability(Stable) @NotNull public static String array(@NotNull @NotNull String... values)
      Make an intrinsic States.Array expression.

      Combine any number of string literals or JsonPath expressions into an array.

      Use this function if the value of an array element directly has to come from a JSON Path expression (either the State object or the Context object).

      If the array contains object literals whose values come from a JSON path expression, you do not need to use this function.

      Parameters:
      values - This parameter is required.
      See Also:
    • format

      @Stability(Stable) @NotNull public static String format(@NotNull String formatString, @NotNull @NotNull String... values)
      Make an intrinsic States.Format expression.

      This can be used to embed JSON Path variables inside a format string.

      For example:

       JsonPath.format("Hello, my name is {}.", JsonPath.stringAt("$.name"));
       

      Parameters:
      formatString - This parameter is required.
      values - This parameter is required.
      See Also:
    • isEncodedJsonPath

      @Stability(Stable) @NotNull public static Boolean isEncodedJsonPath(@NotNull String value)
      Determines if the indicated string is an encoded JSON path.

      Parameters:
      value - string to be evaluated. This parameter is required.
    • jsonToString

      @Stability(Stable) @NotNull public static String jsonToString(@NotNull Object value)
      Make an intrinsic States.JsonToString expression.

      During the execution of the Step Functions state machine, encode the given object into a JSON string.

      For example:

       JsonPath.jsonToString(JsonPath.objectAt("$.someObject"));
       

      Parameters:
      value - This parameter is required.
      See Also:
    • listAt

      @Stability(Stable) @NotNull public static List<String> listAt(@NotNull String path)
      Instead of using a literal string list, get the value from a JSON path.

      Parameters:
      path - This parameter is required.
    • numberAt

      @Stability(Stable) @NotNull public static Number numberAt(@NotNull String path)
      Instead of using a literal number, get the value from a JSON path.

      Parameters:
      path - This parameter is required.
    • objectAt

      @Stability(Stable) @NotNull public static IResolvable objectAt(@NotNull String path)
      Reference a complete (complex) object in a JSON path location.

      Parameters:
      path - This parameter is required.
    • stringAt

      @Stability(Stable) @NotNull public static String stringAt(@NotNull String path)
      Instead of using a literal string, get the value from a JSON path.

      Parameters:
      path - This parameter is required.
    • stringToJson

      @Stability(Stable) @NotNull public static IResolvable stringToJson(@NotNull String jsonString)
      Make an intrinsic States.StringToJson expression.

      During the execution of the Step Functions state machine, parse the given argument as JSON into its object form.

      For example:

       JsonPath.stringToJson(JsonPath.stringAt("$.someJsonBody"));
       

      Parameters:
      jsonString - This parameter is required.
      See Also:
    • getEntireContext

      @Stability(Stable) @NotNull public static String getEntireContext()
      Use the entire context data structure.

      Will be an object at invocation time, but is represented in the CDK application as a string.

    • getEntirePayload

      @Stability(Stable) @NotNull public static String getEntirePayload()
      Use the entire data structure.

      Will be an object at invocation time, but is represented in the CDK application as a string.

    • getTaskToken

      @Stability(Stable) @NotNull public static String getTaskToken()
      Return the Task Token field.

      External actions will need this token to report step completion back to StepFunctions using the SendTaskSuccess or SendTaskFailure calls.