Class ApprovalFlowBuilder
- All Implemented Interfaces:
Builder<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()
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionExisting approvals in the Approval Flow.Associate Roles required for approval based on the approver hierarchy tiers defined inrules
only for the currently active tier(s).Associate Roles that can approve according to the approver hierarchy tiers defined inrules
.Associate Roles required for approval based on the approver hierarchy tiers defined inrules
across all remaining tiers.addRules
(Function<ApprovalRuleBuilder, ApprovalRule> builder) Approval Rules that matched the Order.approvals
(ApprovalFlowApproval... approvals) Existing approvals in the Approval Flow.approvals
(List<ApprovalFlowApproval> approvals) Existing approvals in the Approval Flow.build()
builds ApprovalFlow with checking for non-null required valuesbuilds ApprovalFlow without checking for non-null required valuesbusinessUnit
(BusinessUnitKeyReference businessUnit) Business Unit the Approval Flow belongs to.Business Unit the Approval Flow belongs to.createdAt
(ZonedDateTime createdAt) Date and time (UTC) the Approval Flow was initially created.IDs and references that created the ApprovalFlow.createdBy
(Function<CreatedByBuilder, CreatedByBuilder> builder) IDs and references that created the ApprovalFlow.currentTierPendingApprovers
(RuleApprover... currentTierPendingApprovers) Associate Roles required for approval based on the approver hierarchy tiers defined inrules
only for the currently active tier(s).currentTierPendingApprovers
(List<RuleApprover> currentTierPendingApprovers) Associate Roles required for approval based on the approver hierarchy tiers defined inrules
only for the currently active tier(s).custom
(CustomFields custom) Custom Fields on the Approval Flow.custom
(Function<CustomFieldsBuilder, CustomFieldsBuilder> builder) Custom Fields on the Approval Flow.eligibleApprovers
(RuleApprover... eligibleApprovers) Associate Roles that can approve according to the approver hierarchy tiers defined inrules
.eligibleApprovers
(List<RuleApprover> eligibleApprovers) Associate Roles that can approve according to the approver hierarchy tiers defined inrules
.Existing approvals in the Approval Flow.Business Unit the Approval Flow belongs to.Date and time (UTC) the Approval Flow was initially created.IDs and references that created the ApprovalFlow.Associate Roles required for approval based on the approver hierarchy tiers defined inrules
only for the currently active tier(s).Custom Fields on the Approval Flow.Associate Roles that can approve according to the approver hierarchy tiers defined inrules
.getId()
Unique identifier of the Approval Flow.Date and time (UTC) the Approval Flow was last updated.IDs and references that last modified the ApprovalFlow.getOrder()
Order that needs to be approved.Associate Roles required for approval based on the approver hierarchy tiers defined inrules
across all remaining tiers.Present when the status of the Approval Flow isRejected
.getRules()
Approval Rules that matched the Order.Indicates whether the Approval Flow is under review, approved, or rejected.Current version of the Approval Flow.Unique identifier of the Approval Flow.lastModifiedAt
(ZonedDateTime lastModifiedAt) Date and time (UTC) the Approval Flow was last updated.lastModifiedBy
(LastModifiedBy lastModifiedBy) IDs and references that last modified the ApprovalFlow.IDs and references that last modified the ApprovalFlow.static ApprovalFlowBuilder
of()
factory method for an instance of ApprovalFlowBuilderstatic ApprovalFlowBuilder
of
(ApprovalFlow template) create builder for ApprovalFlow instanceorder
(OrderReference order) Order that needs to be approved.Order that needs to be approved.pendingApprovers
(RuleApprover... pendingApprovers) Associate Roles required for approval based on the approver hierarchy tiers defined inrules
across all remaining tiers.pendingApprovers
(List<RuleApprover> pendingApprovers) Associate Roles required for approval based on the approver hierarchy tiers defined inrules
across all remaining tiers.plusApprovals
(ApprovalFlowApproval... approvals) Existing approvals in the Approval Flow.Existing approvals in the Approval Flow.plusCurrentTierPendingApprovers
(RuleApprover... currentTierPendingApprovers) Associate Roles required for approval based on the approver hierarchy tiers defined inrules
only for the currently active tier(s).Associate Roles required for approval based on the approver hierarchy tiers defined inrules
only for the currently active tier(s).plusEligibleApprovers
(RuleApprover... eligibleApprovers) Associate Roles that can approve according to the approver hierarchy tiers defined inrules
.Associate Roles that can approve according to the approver hierarchy tiers defined inrules
.plusPendingApprovers
(RuleApprover... pendingApprovers) Associate Roles required for approval based on the approver hierarchy tiers defined inrules
across all remaining tiers.Associate Roles required for approval based on the approver hierarchy tiers defined inrules
across all remaining tiers.plusRules
(ApprovalRule... rules) Approval Rules that matched the Order.Approval Rules that matched the Order.rejection
(ApprovalFlowRejection rejection) Present when the status of the Approval Flow isRejected
.Present when the status of the Approval Flow isRejected
.rules
(ApprovalRule... rules) Approval Rules that matched the Order.rules
(List<ApprovalRule> rules) Approval Rules that matched the Order.Existing approvals in the Approval Flow.Associate Roles required for approval based on the approver hierarchy tiers defined inrules
only for the currently active tier(s).Associate Roles that can approve according to the approver hierarchy tiers defined inrules
.Associate Roles required for approval based on the approver hierarchy tiers defined inrules
across all remaining tiers.setRules
(Function<ApprovalRuleBuilder, ApprovalRule> builder) Approval Rules that matched the Order.status
(ApprovalFlowStatus status) Indicates whether the Approval Flow is under review, approved, or rejected.Current version of the Approval Flow.Existing approvals in the Approval Flow.Business Unit the Approval Flow belongs to.withCreatedBy
(Function<CreatedByBuilder, CreatedBy> builder) IDs and references that created the ApprovalFlow.Associate Roles required for approval based on the approver hierarchy tiers defined inrules
only for the currently active tier(s).withCustom
(Function<CustomFieldsBuilder, CustomFields> builder) Custom Fields on the Approval Flow.Associate Roles that can approve according to the approver hierarchy tiers defined inrules
.IDs and references that last modified the ApprovalFlow.withOrder
(Function<OrderReferenceBuilder, OrderReference> builder) Order that needs to be approved.Associate Roles required for approval based on the approver hierarchy tiers defined inrules
across all remaining tiers.Present when the status of the Approval Flow isRejected
.Approval Rules that matched the Order.
-
Constructor Details
-
ApprovalFlowBuilder
public ApprovalFlowBuilder()
-
-
Method Details
-
id
Unique identifier of the Approval Flow.
- Parameters:
id
- value to be set- Returns:
- Builder
-
version
Current version of the Approval Flow.
- Parameters:
version
- value to be set- Returns:
- Builder
-
createdAt
Date and time (UTC) the Approval Flow was initially created.
- Parameters:
createdAt
- value to be set- Returns:
- Builder
-
lastModifiedAt
Date and time (UTC) the Approval Flow was last updated.
- Parameters:
lastModifiedAt
- value to be set- Returns:
- Builder
-
createdBy
IDs and references that created the ApprovalFlow.
- Parameters:
builder
- function to build the createdBy value- Returns:
- Builder
-
withCreatedBy
IDs and references that created the ApprovalFlow.
- Parameters:
builder
- function to build the createdBy value- Returns:
- Builder
-
createdBy
IDs and references that created the ApprovalFlow.
- Parameters:
createdBy
- value to be set- Returns:
- Builder
-
lastModifiedBy
public ApprovalFlowBuilder lastModifiedBy(Function<LastModifiedByBuilder, LastModifiedByBuilder> builder) IDs and references that last modified the ApprovalFlow.
- Parameters:
builder
- function to build the lastModifiedBy value- Returns:
- Builder
-
withLastModifiedBy
public ApprovalFlowBuilder withLastModifiedBy(Function<LastModifiedByBuilder, LastModifiedBy> builder) IDs and references that last modified the ApprovalFlow.
- Parameters:
builder
- function to build the lastModifiedBy value- Returns:
- Builder
-
lastModifiedBy
IDs and references that last modified the ApprovalFlow.
- Parameters:
lastModifiedBy
- value to be set- Returns:
- Builder
-
order
Order that needs to be approved.
- Parameters:
builder
- function to build the order value- Returns:
- Builder
-
withOrder
Order that needs to be approved.
- Parameters:
builder
- function to build the order value- Returns:
- Builder
-
order
Order that needs to be approved.
- Parameters:
order
- value to be set- Returns:
- Builder
-
businessUnit
public ApprovalFlowBuilder businessUnit(Function<BusinessUnitKeyReferenceBuilder, BusinessUnitKeyReferenceBuilder> builder) Business Unit the Approval Flow belongs to.
- Parameters:
builder
- function to build the businessUnit value- Returns:
- Builder
-
withBusinessUnit
public ApprovalFlowBuilder withBusinessUnit(Function<BusinessUnitKeyReferenceBuilder, BusinessUnitKeyReference> builder) Business Unit the Approval Flow belongs to.
- Parameters:
builder
- function to build the businessUnit value- Returns:
- Builder
-
businessUnit
Business Unit the Approval Flow belongs to.
- Parameters:
businessUnit
- value to be set- Returns:
- Builder
-
rules
Approval Rules that matched the Order.
- Parameters:
rules
- value to be set- Returns:
- Builder
-
rules
Approval Rules that matched the Order.
- Parameters:
rules
- value to be set- Returns:
- Builder
-
plusRules
Approval Rules that matched the Order.
- Parameters:
rules
- value to be set- Returns:
- Builder
-
plusRules
Approval Rules that matched the Order.
- Parameters:
builder
- function to build the rules value- Returns:
- Builder
-
withRules
Approval Rules that matched the Order.
- Parameters:
builder
- function to build the rules value- Returns:
- Builder
-
addRules
Approval Rules that matched the Order.
- Parameters:
builder
- function to build the rules value- Returns:
- Builder
-
setRules
Approval Rules that matched the Order.
- Parameters:
builder
- function to build the rules value- Returns:
- Builder
-
status
Indicates whether the Approval Flow is under review, approved, or rejected.
- Parameters:
status
- value to be set- Returns:
- Builder
-
rejection
public ApprovalFlowBuilder rejection(Function<ApprovalFlowRejectionBuilder, ApprovalFlowRejectionBuilder> builder) Present when the status of the Approval Flow is
Rejected
.- Parameters:
builder
- function to build the rejection value- Returns:
- Builder
-
withRejection
public ApprovalFlowBuilder withRejection(Function<ApprovalFlowRejectionBuilder, ApprovalFlowRejection> builder) Present when the status of the Approval Flow is
Rejected
.- Parameters:
builder
- function to build the rejection value- Returns:
- Builder
-
rejection
Present when the status of the Approval Flow is
Rejected
.- Parameters:
rejection
- value to be set- Returns:
- Builder
-
approvals
Existing approvals in the Approval Flow.
- Parameters:
approvals
- value to be set- Returns:
- Builder
-
approvals
Existing approvals in the Approval Flow.
- Parameters:
approvals
- value to be set- Returns:
- Builder
-
plusApprovals
Existing approvals in the Approval Flow.
- Parameters:
approvals
- value to be set- Returns:
- Builder
-
plusApprovals
public ApprovalFlowBuilder plusApprovals(Function<ApprovalFlowApprovalBuilder, ApprovalFlowApprovalBuilder> builder) Existing approvals in the Approval Flow.
- Parameters:
builder
- function to build the approvals value- Returns:
- Builder
-
withApprovals
public ApprovalFlowBuilder withApprovals(Function<ApprovalFlowApprovalBuilder, ApprovalFlowApprovalBuilder> builder) Existing approvals in the Approval Flow.
- Parameters:
builder
- function to build the approvals value- Returns:
- Builder
-
addApprovals
public ApprovalFlowBuilder addApprovals(Function<ApprovalFlowApprovalBuilder, ApprovalFlowApproval> builder) Existing approvals in the Approval Flow.
- Parameters:
builder
- function to build the approvals value- Returns:
- Builder
-
setApprovals
public ApprovalFlowBuilder setApprovals(Function<ApprovalFlowApprovalBuilder, ApprovalFlowApproval> builder) Existing approvals in the Approval Flow.
- Parameters:
builder
- function to build the approvals value- Returns:
- Builder
-
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
- value to be set- Returns:
- Builder
-
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
- value to be set- Returns:
- Builder
-
plusEligibleApprovers
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
- value to be set- Returns:
- Builder
-
plusEligibleApprovers
public ApprovalFlowBuilder plusEligibleApprovers(Function<RuleApproverBuilder, RuleApproverBuilder> builder) 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:
builder
- function to build the eligibleApprovers value- Returns:
- Builder
-
withEligibleApprovers
public ApprovalFlowBuilder withEligibleApprovers(Function<RuleApproverBuilder, RuleApproverBuilder> builder) 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:
builder
- function to build the eligibleApprovers value- Returns:
- Builder
-
addEligibleApprovers
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:
builder
- function to build the eligibleApprovers value- Returns:
- Builder
-
setEligibleApprovers
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:
builder
- function to build the eligibleApprovers value- Returns:
- Builder
-
pendingApprovers
Associate Roles required for approval based on the approver hierarchy tiers defined in
rules
across all remaining tiers.- Parameters:
pendingApprovers
- value to be set- Returns:
- Builder
-
pendingApprovers
Associate Roles required for approval based on the approver hierarchy tiers defined in
rules
across all remaining tiers.- Parameters:
pendingApprovers
- value to be set- Returns:
- Builder
-
plusPendingApprovers
Associate Roles required for approval based on the approver hierarchy tiers defined in
rules
across all remaining tiers.- Parameters:
pendingApprovers
- value to be set- Returns:
- Builder
-
plusPendingApprovers
public ApprovalFlowBuilder plusPendingApprovers(Function<RuleApproverBuilder, RuleApproverBuilder> builder) Associate Roles required for approval based on the approver hierarchy tiers defined in
rules
across all remaining tiers.- Parameters:
builder
- function to build the pendingApprovers value- Returns:
- Builder
-
withPendingApprovers
public ApprovalFlowBuilder withPendingApprovers(Function<RuleApproverBuilder, RuleApproverBuilder> builder) Associate Roles required for approval based on the approver hierarchy tiers defined in
rules
across all remaining tiers.- Parameters:
builder
- function to build the pendingApprovers value- Returns:
- Builder
-
addPendingApprovers
Associate Roles required for approval based on the approver hierarchy tiers defined in
rules
across all remaining tiers.- Parameters:
builder
- function to build the pendingApprovers value- Returns:
- Builder
-
setPendingApprovers
Associate Roles required for approval based on the approver hierarchy tiers defined in
rules
across all remaining tiers.- Parameters:
builder
- function to build the pendingApprovers value- Returns:
- Builder
-
currentTierPendingApprovers
Associate Roles required for approval based on the approver hierarchy tiers defined in
rules
only for the currently active tier(s).- Parameters:
currentTierPendingApprovers
- value to be set- Returns:
- Builder
-
currentTierPendingApprovers
public ApprovalFlowBuilder currentTierPendingApprovers(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
- value to be set- Returns:
- Builder
-
plusCurrentTierPendingApprovers
public ApprovalFlowBuilder plusCurrentTierPendingApprovers(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
- value to be set- Returns:
- Builder
-
plusCurrentTierPendingApprovers
public ApprovalFlowBuilder plusCurrentTierPendingApprovers(Function<RuleApproverBuilder, RuleApproverBuilder> builder) Associate Roles required for approval based on the approver hierarchy tiers defined in
rules
only for the currently active tier(s).- Parameters:
builder
- function to build the currentTierPendingApprovers value- Returns:
- Builder
-
withCurrentTierPendingApprovers
public ApprovalFlowBuilder withCurrentTierPendingApprovers(Function<RuleApproverBuilder, RuleApproverBuilder> builder) Associate Roles required for approval based on the approver hierarchy tiers defined in
rules
only for the currently active tier(s).- Parameters:
builder
- function to build the currentTierPendingApprovers value- Returns:
- Builder
-
addCurrentTierPendingApprovers
public ApprovalFlowBuilder addCurrentTierPendingApprovers(Function<RuleApproverBuilder, RuleApprover> builder) Associate Roles required for approval based on the approver hierarchy tiers defined in
rules
only for the currently active tier(s).- Parameters:
builder
- function to build the currentTierPendingApprovers value- Returns:
- Builder
-
setCurrentTierPendingApprovers
public ApprovalFlowBuilder setCurrentTierPendingApprovers(Function<RuleApproverBuilder, RuleApprover> builder) Associate Roles required for approval based on the approver hierarchy tiers defined in
rules
only for the currently active tier(s).- Parameters:
builder
- function to build the currentTierPendingApprovers value- Returns:
- Builder
-
custom
Custom Fields on the Approval Flow.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
withCustom
Custom Fields on the Approval Flow.
- Parameters:
builder
- function to build the custom value- Returns:
- Builder
-
custom
Custom Fields on the Approval Flow.
- Parameters:
custom
- value to be set- Returns:
- Builder
-
getId
Unique identifier of the Approval Flow.
- Returns:
- id
-
getVersion
Current version of the Approval Flow.
- Returns:
- version
-
getCreatedAt
Date and time (UTC) the Approval Flow was initially created.
- Returns:
- createdAt
-
getLastModifiedAt
Date and time (UTC) the Approval Flow was last updated.
- Returns:
- lastModifiedAt
-
getCreatedBy
IDs and references that created the ApprovalFlow.
- Returns:
- createdBy
-
getLastModifiedBy
IDs and references that last modified the ApprovalFlow.
- Returns:
- lastModifiedBy
-
getOrder
Order that needs to be approved.
- Returns:
- order
-
getBusinessUnit
Business Unit the Approval Flow belongs to.
- Returns:
- businessUnit
-
getRules
Approval Rules that matched the Order.
- Returns:
- rules
-
getStatus
Indicates whether the Approval Flow is under review, approved, or rejected.
- Returns:
- status
-
getRejection
Present when the status of the Approval Flow is
Rejected
.- Returns:
- rejection
-
getApprovals
Existing approvals in the Approval Flow.
- Returns:
- approvals
-
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
Associate Roles required for approval based on the approver hierarchy tiers defined in
rules
across all remaining tiers.- Returns:
- pendingApprovers
-
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
Custom Fields on the Approval Flow.
- Returns:
- custom
-
build
builds ApprovalFlow with checking for non-null required values- Specified by:
build
in interfaceBuilder<ApprovalFlow>
- Returns:
- ApprovalFlow
-
buildUnchecked
builds ApprovalFlow without checking for non-null required values- Returns:
- ApprovalFlow
-
of
factory method for an instance of ApprovalFlowBuilder- Returns:
- builder
-
of
create builder for ApprovalFlow instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-