java.lang.Object
com.dassault_systemes.modeler.kerml.model.Payloads

@OpenApiAll public class Payloads extends Object
Utility class to work with payloads in Flow
  • Constructor Details

    • Payloads

      public Payloads()
  • Method Details

    • getPayloadFeaturesForBinary

      public static Payloads.Features getPayloadFeaturesForBinary(Type relationship)
      Returns payload features for a binary relationship (exactly two ends). Payloads are grouped into source→target and target→source directions.
      Parameters:
      relationship - the relationship whose payloads are requested
      Returns:
      a Features object containing directional payload lists
    • getPayloadFeatures

      public static Payloads.Features getPayloadFeatures(Type relationship, Feature end)
      Returns payload features for a relationship relative to a specific end. Payloads are grouped into source→target and target→source directions.
      Parameters:
      relationship - the relationship whose payloads are requested
      end - the end feature used as reference
      Returns:
      a Features object containing directional payload lists
    • isPayload

      public static boolean isPayload(Feature feature)
      Checks whether the given feature is a payload feature.
      Parameters:
      feature - the feature to check
      Returns:
      true if the feature is a payload
    • getPayload

      @CheckForNull public static Feature getPayload(Type type)
      Returns the payload feature of the given type, if any.
      Parameters:
      type - the type to inspect
      Returns:
      the payload feature, or null if none exists
    • getPayload

      @CheckForNull public static Feature getPayload(PayloadsParams params)
      Resolves the payload feature for the flow-like type described by the given parameters.

      This method performs a multi‑step lookup:

      1. If the type is a Flow, its explicitly declared payload feature is returned.
      2. Otherwise, the method attempts to locate an owned feature whose type matches the standard library payload type (or a redefinition of it).
      3. If no owned payload is found, inherited features are searched, subject to standard library filtering rules.
      4. If create is enabled in the parameters, a new payload feature is created, optionally redefining an inherited payload.

      This method supports advanced scenarios such as:

      • distinguishing between owned and inherited payloads,
      • respecting standard library boundaries,
      • creating redefining payload features when needed, and
      • handling both PayloadFeature instances and typed features.

      If no payload can be resolved and creation is not requested, this method returns null.

      Parameters:
      params - configuration describing how payload lookup and creation should behave
      Returns:
      the resolved or newly created payload feature, or null if none exists