Protocols

The following protocols are available globally.

  • Protocol representing a collector. Inherits from Sendable, Collector, Validator.

    • property id: The collector id.
    • function anyPayload: The payload of the collector as Any
    • function initialize: Initializes the collector with the given value.
    See more

    Declaration

    Swift

    public protocol AnyFieldCollector : Collector, Validator
  • Protocol representing a Collector. It is a generic protocol that defines the structure for creating different types of collectors. It inherits from the Action protocol and conforms to Identifiable and Sendable protocols.

    See more

    Declaration

    Swift

    public protocol Collector<T> : Action, Identifiable

    Parameters

    T

    The type of the payload that the collector will handle.

    id

    A unique identifier for the collector.

    payload()

    Returns the payload of type T. When payload returns nil, the field will not be posted to server.

  • A protocol for types that need access to the DaVinci workflow instance. Conforming types can receive the DaVinci instance to perform workflow-related actions such as advancing the flow, accessing shared context, or building requests.

    Typical conformers are collectors that must send follow-up requests or need to read data from the current workflow context.

    See more

    Declaration

    Swift

    public protocol DaVinciAware
  • A protocol describing a self-submittable collector or control.

    Types conforming to Submittable can provide their own event type to be used when constructing the payload for a “continue” or equivalent submission.

    See more

    Declaration

    Swift

    public protocol Submittable
  • A protocol for validating objects. This protocol defines a method to validate an object and return an array of validation errors. The validate method should be implemented by conforming types to perform the validation logic.

    See more

    Declaration

    Swift

    public protocol Validator