workflow

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AdditionalInfoMessageInsufficientApprovers is the message for the insufficient approvers warning
	AdditionalInfoMessageInsufficientApprovers = "The number of eligible approvers is currently" +
		" insufficient to meet the minimum approval criteria."
	// AdditionalInfoMessageEligibilityCheckError is the message when eligibility verification fails
	AdditionalInfoMessageEligibilityCheckError = "Unable to verify workflow eligibility. " +
		"The approval system may be temporarily unavailable. Please try again later or contact support."
	// AdditionalInfoMessageInitiatorIneligible is the message when initiator is no longer eligible to confirm
	AdditionalInfoMessageInitiatorIneligible = "The workflow initiator is no longer eligible to confirm this workflow."
)

Variables

View Source
var ErrExpiryGreaterThanMaximum = errors.New("expiry exceeds maximum")

Functions

func ApproverToAPI

ApproverToAPI converts a workflow approver model to an API workflow approver presentation.

func FromAPI

func FromAPI(
	ctx context.Context,
	apiWorkflow cmkapi.WorkflowBody,
	defaultExpiryPeriod, maxExpiryPeriod int,
) (*model.Workflow, error)

FromAPI converts an API workflow presentation to a workflow model.

func ToAPI

func ToAPI(
	ctx context.Context,
	w model.Workflow,
	eligibility *manager.WorkflowEligibility,
	eligibilityErr error,
	identityManager identitymanagement.IdentityManagement,
	opts ...ToAPIOpt,
) (*cmkapi.Workflow, error)

ToAPI converts a workflow model to an API workflow presentation. eligibility contains eligibility check results (insufficient approvers, initiator ineligible). eligibilityErr should be passed if there was an error checking approver eligibility.

Types

type ToAPIOpt added in v0.9.0

type ToAPIOpt func(*cmkapi.Workflow) error

ToAPIOpt is a functional option for customizing the ToAPI transformation.

func WithDetailed added in v0.9.0

func WithDetailed(
	ctx context.Context,
	approvers []*model.WorkflowApprover,
	idm identitymanagement.IdentityManagement,
	approverGroups []*model.Group,
	transitions []wfMechanism.Transition,
	approvalSummary *wfMechanism.ApprovalSummary,
) ToAPIOpt

WithDetailed enriches the workflow with detailed information (approvers, groups, transitions, summary).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL