Class WorkflowConsensus
Consensus mechanism for publishing workflows to shared catalogs. Implements a simple approval voting protocol: a workflow version must receive the required number of approvals before it can be published.
public sealed class WorkflowConsensus
- Inheritance
-
WorkflowConsensus
- Inherited Members
Constructors
WorkflowConsensus(int)
Creates a new consensus instance.
public WorkflowConsensus(int requiredApprovals = 1)
Parameters
requiredApprovalsintMinimum number of distinct approvals needed to publish. Defaults to 1 (single-user mode).
Properties
ProposalCount
Number of active proposals.
public int ProposalCount { get; }
Property Value
Methods
Approve(string, string, string)
Approves a pending proposal. Each user can only approve once.
public bool Approve(string workflowName, string version, string approver)
Parameters
Returns
GetProposal(string, string)
Gets the current proposal for a workflow version.
public PublishProposal? GetProposal(string workflowName, string version)
Parameters
Returns
ListProposals(ProposalStatus?)
Lists all proposals with an optional status filter.
public IReadOnlyList<PublishProposal> ListProposals(ProposalStatus? status = null)
Parameters
statusProposalStatus?
Returns
Propose(string, string, string)
Creates a proposal to publish a workflow version.
public PublishProposal Propose(string workflowName, string version, string proposer)
Parameters
Returns
Reject(string, string, string, string)
Rejects a pending proposal with a reason.
public bool Reject(string workflowName, string version, string rejector, string reason)
Parameters
Returns
RemoveProposal(string, string)
Removes a resolved (approved/rejected) proposal.
public bool RemoveProposal(string workflowName, string version)