Interface ApprovalFlow

All Superinterfaces:
BaseResource

public interface ApprovalFlow extends BaseResource
ApprovalFlow
Example to create an instance using the builder pattern

     ApprovalFlow approvalFlow = ApprovalFlow.builder()
             .id("{id}")
             .version(0.3)
             .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .order(orderBuilder -> orderBuilder)
             .businessUnit(businessUnitBuilder -> businessUnitBuilder)
             .plusRules(rulesBuilder -> rulesBuilder)
             .status(ApprovalFlowStatus.PENDING)
             .plusApprovals(approvalsBuilder -> approvalsBuilder)
             .plusEligibleApprovers(eligibleApproversBuilder -> eligibleApproversBuilder)
             .plusPendingApprovers(pendingApproversBuilder -> pendingApproversBuilder)
             .plusCurrentTierPendingApprovers(currentTierPendingApproversBuilder -> currentTierPendingApproversBuilder)
             .build()
 
  • Method Details

    • getId

      @NotNull @NotNull String getId()

      Unique identifier of the Approval Flow.

      Specified by:
      getId in interface BaseResource
      Returns:
      id
    • getVersion

      @NotNull @NotNull Long getVersion()

      Current version of the Approval Flow.

      Specified by:
      getVersion in interface BaseResource
      Returns:
      version
    • getCreatedAt

      @NotNull @NotNull ZonedDateTime getCreatedAt()

      Date and time (UTC) the Approval Flow was initially created.

      Specified by:
      getCreatedAt in interface BaseResource
      Returns:
      createdAt
    • getCreatedBy

      @Valid @Valid CreatedBy getCreatedBy()

      IDs and references that created the ApprovalFlow.

      Returns:
      createdBy
    • getLastModifiedAt

      @NotNull @NotNull ZonedDateTime getLastModifiedAt()

      Date and time (UTC) the Approval Flow was last updated.

      Specified by:
      getLastModifiedAt in interface BaseResource
      Returns:
      lastModifiedAt
    • getLastModifiedBy

      @Valid @Valid LastModifiedBy getLastModifiedBy()

      IDs and references that last modified the ApprovalFlow.

      Returns:
      lastModifiedBy
    • getOrder

      @NotNull @Valid @NotNull @Valid OrderReference getOrder()

      Order that needs to be approved.

      Returns:
      order
    • getBusinessUnit

      @NotNull @Valid @NotNull @Valid BusinessUnitKeyReference getBusinessUnit()

      Business Unit the Approval Flow belongs to.

      Returns:
      businessUnit
    • getRules

      @NotNull @Valid @NotNull @Valid List<ApprovalRule> getRules()

      Approval Rules that matched the Order.

      Returns:
      rules
    • getStatus

      @NotNull @NotNull ApprovalFlowStatus getStatus()

      Indicates whether the Approval Flow is under review, approved, or rejected.

      Returns:
      status
    • getRejection

      @Valid @Valid ApprovalFlowRejection getRejection()

      Present when the status of the Approval Flow is Rejected.

      Returns:
      rejection
    • getApprovals

      @NotNull @Valid @NotNull @Valid List<ApprovalFlowApproval> getApprovals()

      Existing approvals in the Approval Flow.

      Returns:
      approvals
    • getEligibleApprovers

      @NotNull @Valid @NotNull @Valid List<RuleApprover> getEligibleApprovers()

      Associate Roles that can approve according to the approver hierarchy tiers defined in rules. Associates are allowed to reject even after they have given approval, as long as the current approver hierarchy tier still contains their role.

      Returns:
      eligibleApprovers
    • getPendingApprovers

      @NotNull @Valid @NotNull @Valid List<RuleApprover> getPendingApprovers()

      Associate Roles required for approval based on the approver hierarchy tiers defined in rules across all remaining tiers.

      Returns:
      pendingApprovers
    • getCurrentTierPendingApprovers

      @NotNull @Valid @NotNull @Valid List<RuleApprover> getCurrentTierPendingApprovers()

      Associate Roles required for approval based on the approver hierarchy tiers defined in rules only for the currently active tier(s).

      Returns:
      currentTierPendingApprovers
    • getCustom

      @Valid @Valid CustomFields getCustom()

      Custom Fields on the Approval Flow.

      Returns:
      custom
    • setId

      void setId(String id)

      Unique identifier of the Approval Flow.

      Specified by:
      setId in interface BaseResource
      Parameters:
      id - value to be set
    • setVersion

      void setVersion(Long version)

      Current version of the Approval Flow.

      Specified by:
      setVersion in interface BaseResource
      Parameters:
      version - value to be set
    • setCreatedAt

      void setCreatedAt(ZonedDateTime createdAt)

      Date and time (UTC) the Approval Flow was initially created.

      Specified by:
      setCreatedAt in interface BaseResource
      Parameters:
      createdAt - value to be set
    • setCreatedBy

      void setCreatedBy(CreatedBy createdBy)

      IDs and references that created the ApprovalFlow.

      Parameters:
      createdBy - value to be set
    • setLastModifiedAt

      void setLastModifiedAt(ZonedDateTime lastModifiedAt)

      Date and time (UTC) the Approval Flow was last updated.

      Specified by:
      setLastModifiedAt in interface BaseResource
      Parameters:
      lastModifiedAt - value to be set
    • setLastModifiedBy

      void setLastModifiedBy(LastModifiedBy lastModifiedBy)

      IDs and references that last modified the ApprovalFlow.

      Parameters:
      lastModifiedBy - value to be set
    • setOrder

      void setOrder(OrderReference order)

      Order that needs to be approved.

      Parameters:
      order - value to be set
    • setBusinessUnit

      void setBusinessUnit(BusinessUnitKeyReference businessUnit)

      Business Unit the Approval Flow belongs to.

      Parameters:
      businessUnit - value to be set
    • setRules

      void setRules(ApprovalRule... rules)

      Approval Rules that matched the Order.

      Parameters:
      rules - values to be set
    • setRules

      void setRules(List<ApprovalRule> rules)

      Approval Rules that matched the Order.

      Parameters:
      rules - values to be set
    • setStatus

      void setStatus(ApprovalFlowStatus status)

      Indicates whether the Approval Flow is under review, approved, or rejected.

      Parameters:
      status - value to be set
    • setRejection

      void setRejection(ApprovalFlowRejection rejection)

      Present when the status of the Approval Flow is Rejected.

      Parameters:
      rejection - value to be set
    • setApprovals

      void setApprovals(ApprovalFlowApproval... approvals)

      Existing approvals in the Approval Flow.

      Parameters:
      approvals - values to be set
    • setApprovals

      void setApprovals(List<ApprovalFlowApproval> approvals)

      Existing approvals in the Approval Flow.

      Parameters:
      approvals - values to be set
    • setEligibleApprovers

      void setEligibleApprovers(RuleApprover... eligibleApprovers)

      Associate Roles that can approve according to the approver hierarchy tiers defined in rules. Associates are allowed to reject even after they have given approval, as long as the current approver hierarchy tier still contains their role.

      Parameters:
      eligibleApprovers - values to be set
    • setEligibleApprovers

      void setEligibleApprovers(List<RuleApprover> eligibleApprovers)

      Associate Roles that can approve according to the approver hierarchy tiers defined in rules. Associates are allowed to reject even after they have given approval, as long as the current approver hierarchy tier still contains their role.

      Parameters:
      eligibleApprovers - values to be set
    • setPendingApprovers

      void setPendingApprovers(RuleApprover... pendingApprovers)

      Associate Roles required for approval based on the approver hierarchy tiers defined in rules across all remaining tiers.

      Parameters:
      pendingApprovers - values to be set
    • setPendingApprovers

      void setPendingApprovers(List<RuleApprover> pendingApprovers)

      Associate Roles required for approval based on the approver hierarchy tiers defined in rules across all remaining tiers.

      Parameters:
      pendingApprovers - values to be set
    • setCurrentTierPendingApprovers

      void setCurrentTierPendingApprovers(RuleApprover... currentTierPendingApprovers)

      Associate Roles required for approval based on the approver hierarchy tiers defined in rules only for the currently active tier(s).

      Parameters:
      currentTierPendingApprovers - values to be set
    • setCurrentTierPendingApprovers

      void setCurrentTierPendingApprovers(List<RuleApprover> currentTierPendingApprovers)

      Associate Roles required for approval based on the approver hierarchy tiers defined in rules only for the currently active tier(s).

      Parameters:
      currentTierPendingApprovers - values to be set
    • setCustom

      void setCustom(CustomFields custom)

      Custom Fields on the Approval Flow.

      Parameters:
      custom - value to be set
    • of

      static ApprovalFlow of()
      factory method
      Returns:
      instance of ApprovalFlow
    • of

      static ApprovalFlow of(ApprovalFlow template)
      factory method to create a shallow copy ApprovalFlow
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      @Nullable static ApprovalFlow deepCopy(@Nullable ApprovalFlow template)
      factory method to create a deep copy of ApprovalFlow
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static ApprovalFlowBuilder builder()
      builder factory method for ApprovalFlow
      Returns:
      builder
    • builder

      static ApprovalFlowBuilder builder(ApprovalFlow template)
      create builder for ApprovalFlow instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withApprovalFlow

      default <T> T withApprovalFlow(Function<ApprovalFlow,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<ApprovalFlow> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference