Documentation
¶
Overview ¶
Package bpmn wraps the QuantumBPM BPMN engine endpoints. The Client is project-scoped and exposes resources, instances, messaging, user tasks, and process discovery as method groups on a single struct.
Index ¶
- type Client
- func (c *Client) CancelInstance(ctx context.Context, workflowID string) error
- func (c *Client) CompleteUserTask(ctx context.Context, executionKey string, vars variables.Vars) error
- func (c *Client) CreateResource(ctx context.Context, name, xml string) (*ResourceDetail, error)
- func (c *Client) DeleteResource(ctx context.Context, resourceID openapi_types.UUID) error
- func (c *Client) DeployResource(ctx context.Context, resourceID openapi_types.UUID) error
- func (c *Client) GetInstance(ctx context.Context, workflowID string) (*InstanceState, error)
- func (c *Client) GetInstanceChildren(ctx context.Context, workflowID string) (*InstanceChildren, error)
- func (c *Client) GetInstanceVariables(ctx context.Context, workflowID string) (variables.Vars, error)
- func (c *Client) GetResource(ctx context.Context, resourceID openapi_types.UUID) (*ResourceDetail, error)
- func (c *Client) GetUserTask(ctx context.Context, executionKey string) (*UserTask, error)
- func (c *Client) ListInstances(ctx context.Context, opts ...InstanceListOption) (*InstanceListPage, error)
- func (c *Client) ListLatestResources(ctx context.Context, opts ...PageOption) (*ResourceSummaryListPage, error)
- func (c *Client) ListProcessVersions(ctx context.Context, processID string, opts ...ProcessListOption) (*ProcessVersionPage, error)
- func (c *Client) ListProcesses(ctx context.Context, opts ...ProcessListOption) (*ProcessSummaryPage, error)
- func (c *Client) ListResourceVersions(ctx context.Context, definitionsID string, opts ...PageOption) (*ResourceListPage, error)
- func (c *Client) ListResources(ctx context.Context, opts ...PageOption) (*ResourceListPage, error)
- func (c *Client) ListUserTasks(ctx context.Context, opts ...UserTaskListOption) (*UserTaskListPage, error)
- func (c *Client) ListUserTasksForCaller(ctx context.Context, opts ...PageOption) (*UserTaskListPage, error)
- func (c *Client) ProjectID() openapi_types.UUID
- func (c *Client) PublishMessage(ctx context.Context, name string, vars variables.Vars, opts ...MessageOption) error
- func (c *Client) PublishSignal(ctx context.Context, name string, vars variables.Vars, opts ...SignalOption) error
- func (c *Client) Raw() *generated.ClientWithResponses
- func (c *Client) ResolveIncident(ctx context.Context, workflowID, incidentID string, vars variables.Vars) error
- func (c *Client) StartInstance(ctx context.Context, processDefinitionID openapi_types.UUID, ...) (string, error)
- func (c *Client) StartTestInstance(ctx context.Context, resourceID openapi_types.UUID, processID *string, ...) (string, error)
- func (c *Client) ThrowUserTaskError(ctx context.Context, executionKey, errorCode string, vars variables.Vars) error
- func (c *Client) UpdateInstanceVariables(ctx context.Context, workflowID string, vars variables.Vars) error
- func (c *Client) UpdateResource(ctx context.Context, resourceID openapi_types.UUID, name, xml string) (*ResourceDetail, error)
- func (c *Client) UpdateUserTaskAssignment(ctx context.Context, executionKey string, body UpdateAssignmentBody) (*UserTask, error)
- func (c *Client) ValidateXML(ctx context.Context, xml string) (*ValidateResponse, error)
- type CorrelationKeys
- type Incident
- type Instance
- type InstanceChildren
- type InstanceListOption
- type InstanceListPage
- type InstanceState
- type MessageOption
- type PageOption
- type ProcessListOption
- type ProcessSummary
- type ProcessSummaryPage
- type ProcessVersion
- type ProcessVersionPage
- type Resource
- type ResourceDetail
- type ResourceListPage
- type ResourceSummary
- type ResourceSummaryListPage
- type SignalOption
- type StartInstanceOption
- type UpdateAssignmentBody
- type UserTask
- type UserTaskListOption
- func WithUserTaskAssignee(user string) UserTaskListOption
- func WithUserTaskBusinessID(id string) UserTaskListOption
- func WithUserTaskCandidateGroup(group string) UserTaskListOption
- func WithUserTaskCandidateUser(user string) UserTaskListOption
- func WithUserTaskPage(p int) UserTaskListOption
- func WithUserTaskPageSize(s int) UserTaskListOption
- func WithUserTaskStatus(status string) UserTaskListOption
- func WithUserTaskWorkflowID(id string) UserTaskListOption
- type UserTaskListPage
- type ValidateResponse
- type ValidationIssue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps the BPMN engine endpoints for a single project.
func New ¶
func New(api *generated.ClientWithResponses, projectID openapi_types.UUID) *Client
New constructs a BPMN client bound to projectID.
func (*Client) CancelInstance ¶
CancelInstance terminates a running instance.
func (*Client) CompleteUserTask ¶
func (c *Client) CompleteUserTask(ctx context.Context, executionKey string, vars variables.Vars) error
CompleteUserTask finalizes a user task with the supplied variables.
func (*Client) CreateResource ¶
CreateResource stores a new BPMN resource (XML draft) in the project. The resource is not deployed until DeployResource is called.
func (*Client) DeleteResource ¶
DeleteResource removes a draft resource by its platform UUID.
func (*Client) DeployResource ¶
DeployResource promotes a stored draft resource to a deployed process definition. Subsequent StartInstance calls reference the resulting definition.
func (*Client) GetInstance ¶
GetInstance returns the full runtime state of an instance.
func (*Client) GetInstanceChildren ¶
func (c *Client) GetInstanceChildren(ctx context.Context, workflowID string) (*InstanceChildren, error)
GetInstanceChildren returns child instances spawned via CallActivity.
func (*Client) GetInstanceVariables ¶
func (c *Client) GetInstanceVariables(ctx context.Context, workflowID string) (variables.Vars, error)
GetInstanceVariables returns the current variables of a running instance.
func (*Client) GetResource ¶
func (c *Client) GetResource(ctx context.Context, resourceID openapi_types.UUID) (*ResourceDetail, error)
GetResource returns the full resource record (including XML) by UUID.
func (*Client) GetUserTask ¶
GetUserTask returns a single user task by execution key.
func (*Client) ListInstances ¶
func (c *Client) ListInstances(ctx context.Context, opts ...InstanceListOption) (*InstanceListPage, error)
ListInstances returns a page of process instances in the project.
func (*Client) ListLatestResources ¶
func (c *Client) ListLatestResources(ctx context.Context, opts ...PageOption) (*ResourceSummaryListPage, error)
ListLatestResources returns one row per definitions ID, showing the latest stored version.
func (*Client) ListProcessVersions ¶
func (c *Client) ListProcessVersions(ctx context.Context, processID string, opts ...ProcessListOption) (*ProcessVersionPage, error)
ListProcessVersions returns every deployed version of a process id.
func (*Client) ListProcesses ¶
func (c *Client) ListProcesses(ctx context.Context, opts ...ProcessListOption) (*ProcessSummaryPage, error)
ListProcesses returns a page of process summaries (one per process id).
func (*Client) ListResourceVersions ¶
func (c *Client) ListResourceVersions(ctx context.Context, definitionsID string, opts ...PageOption) (*ResourceListPage, error)
ListResourceVersions returns every stored version for a given definitions ID.
func (*Client) ListResources ¶
func (c *Client) ListResources(ctx context.Context, opts ...PageOption) (*ResourceListPage, error)
ListResources returns a page of all resource versions in the project.
func (*Client) ListUserTasks ¶
func (c *Client) ListUserTasks(ctx context.Context, opts ...UserTaskListOption) (*UserTaskListPage, error)
ListUserTasks returns a page of user tasks in the project.
func (*Client) ListUserTasksForCaller ¶
func (c *Client) ListUserTasksForCaller(ctx context.Context, opts ...PageOption) (*UserTaskListPage, error)
ListUserTasksForCaller returns the caller's user tasks (those they may claim or have already claimed).
func (*Client) ProjectID ¶
func (c *Client) ProjectID() openapi_types.UUID
ProjectID returns the project the client is bound to.
func (*Client) PublishMessage ¶
func (c *Client) PublishMessage(ctx context.Context, name string, vars variables.Vars, opts ...MessageOption) error
PublishMessage delivers a BPMN message to matching subscriptions.
func (*Client) PublishSignal ¶
func (c *Client) PublishSignal(ctx context.Context, name string, vars variables.Vars, opts ...SignalOption) error
PublishSignal broadcasts a BPMN signal to all matching subscribers.
func (*Client) Raw ¶
func (c *Client) Raw() *generated.ClientWithResponses
Raw exposes the generated client for endpoints not covered by the wrapper (migrate, modify, ad-hoc, batch-complete, etc.). Project ID for those endpoints is reachable via Client.ProjectID.
func (*Client) ResolveIncident ¶
func (c *Client) ResolveIncident(ctx context.Context, workflowID, incidentID string, vars variables.Vars) error
ResolveIncident clears the named incident on the instance, optionally merging in supplementary variables.
func (*Client) StartInstance ¶
func (c *Client) StartInstance(ctx context.Context, processDefinitionID openapi_types.UUID, vars variables.Vars, opts ...StartInstanceOption) (string, error)
StartInstance launches a new BPMN process instance from a deployed definition, returning the workflow ID assigned to it.
func (*Client) StartTestInstance ¶
func (c *Client) StartTestInstance(ctx context.Context, resourceID openapi_types.UUID, processID *string, vars variables.Vars, opts ...StartInstanceOption) (string, error)
StartTestInstance starts a non-deployed instance against a draft resource for testing.
func (*Client) ThrowUserTaskError ¶
func (c *Client) ThrowUserTaskError(ctx context.Context, executionKey, errorCode string, vars variables.Vars) error
ThrowUserTaskError fails a user task with a BPMN error code, optionally passing supplementary variables.
func (*Client) UpdateInstanceVariables ¶
func (c *Client) UpdateInstanceVariables(ctx context.Context, workflowID string, vars variables.Vars) error
UpdateInstanceVariables merges the supplied variables into the instance scope.
func (*Client) UpdateResource ¶
func (c *Client) UpdateResource(ctx context.Context, resourceID openapi_types.UUID, name, xml string) (*ResourceDetail, error)
UpdateResource replaces an existing draft resource with new name and XML.
func (*Client) UpdateUserTaskAssignment ¶
func (c *Client) UpdateUserTaskAssignment(ctx context.Context, executionKey string, body UpdateAssignmentBody) (*UserTask, error)
UpdateUserTaskAssignment reassigns or modifies the candidate set for a CREATED user task. Pass the full body - fields are replaced atomically.
func (*Client) ValidateXML ¶
ValidateXML lints a BPMN XML document, returning per-element issues without storing or deploying anything.
type CorrelationKeys ¶
type CorrelationKeys = generated.CorrelationKeys
Re-exported response and entity types so callers don't need to depend on the generated package directly.
type Incident ¶
type Incident = generated.BpmnIncident
Re-exported response and entity types so callers don't need to depend on the generated package directly.
type Instance ¶
type Instance = generated.BpmnInstance
Re-exported response and entity types so callers don't need to depend on the generated package directly.
type InstanceChildren ¶
type InstanceChildren = generated.BpmnInstanceChildrenResponse
Re-exported response and entity types so callers don't need to depend on the generated package directly.
type InstanceListOption ¶
type InstanceListOption func(*instanceListOpts)
InstanceListOption tunes a list-instances query.
func WithInstanceBusinessID ¶ added in v1.0.0
func WithInstanceBusinessID(id string) InstanceListOption
WithInstanceBusinessID filters listings to a single caller-supplied correlation key (the value passed to StartInstance via WithStartBusinessID).
func WithInstanceDefinitionID ¶
func WithInstanceDefinitionID(id openapi_types.UUID) InstanceListOption
WithInstanceDefinitionID filters listings to a specific deployed definition.
func WithInstancePage ¶
func WithInstancePage(p int) InstanceListOption
WithInstancePage sets the 1-indexed page number.
func WithInstancePageSize ¶
func WithInstancePageSize(s int) InstanceListOption
WithInstancePageSize sets the page size.
func WithInstanceStatus ¶
func WithInstanceStatus(status string) InstanceListOption
WithInstanceStatus filters listings to a specific lifecycle status.
type InstanceListPage ¶
type InstanceListPage = generated.BpmnInstancePaginatedResponse
Re-exported response and entity types so callers don't need to depend on the generated package directly.
type InstanceState ¶
type InstanceState = generated.BpmnInstanceState
Re-exported response and entity types so callers don't need to depend on the generated package directly.
type MessageOption ¶
type MessageOption func(*messageOpts)
MessageOption tunes a published message.
func WithCorrelationKeys ¶
func WithCorrelationKeys(keys CorrelationKeys) MessageOption
WithCorrelationKeys narrows delivery to subscriptions whose stored correlation values match the supplied keys. Without it, a message broadcasts to subscriptions that have no correlation requirement.
func WithMessageTTL ¶
func WithMessageTTL(ttl string) MessageOption
WithMessageTTL sets the buffered message lifetime. Accepts ISO 8601 duration, Go duration, or RFC 3339 timestamp.
type PageOption ¶
type PageOption func(*pageOpts)
PageOption configures pagination for list endpoints.
type ProcessListOption ¶
type ProcessListOption func(*processListOpts)
ProcessListOption tunes a list-processes query.
func WithProcessCreatedAfter ¶
func WithProcessCreatedAfter(t time.Time) ProcessListOption
WithProcessCreatedAfter bounds the totalCount aggregate to instances created at or after the supplied timestamp.
func WithProcessPage ¶
func WithProcessPage(p int) ProcessListOption
WithProcessPage sets the 1-indexed page number.
func WithProcessPageSize ¶
func WithProcessPageSize(s int) ProcessListOption
WithProcessPageSize sets the page size.
func WithProcessSearch ¶
func WithProcessSearch(q string) ProcessListOption
WithProcessSearch filters by case-insensitive substring match on process id or name.
type ProcessSummary ¶
type ProcessSummary = generated.BpmnProcessSummary
Re-exported response and entity types so callers don't need to depend on the generated package directly.
type ProcessSummaryPage ¶
type ProcessSummaryPage = generated.BpmnProcessSummaryPaginatedResponse
Re-exported response and entity types so callers don't need to depend on the generated package directly.
type ProcessVersion ¶
type ProcessVersion = generated.BpmnProcessVersion
Re-exported response and entity types so callers don't need to depend on the generated package directly.
type ProcessVersionPage ¶
type ProcessVersionPage = generated.BpmnProcessVersionPaginatedResponse
Re-exported response and entity types so callers don't need to depend on the generated package directly.
type Resource ¶
type Resource = generated.BpmnResource
Re-exported response and entity types so callers don't need to depend on the generated package directly.
type ResourceDetail ¶
type ResourceDetail = generated.BpmnResourceDetail
Re-exported response and entity types so callers don't need to depend on the generated package directly.
type ResourceListPage ¶
type ResourceListPage = generated.BpmnResourcePaginatedResponse
Re-exported response and entity types so callers don't need to depend on the generated package directly.
type ResourceSummary ¶
type ResourceSummary = generated.BpmnResourceSummary
Re-exported response and entity types so callers don't need to depend on the generated package directly.
type ResourceSummaryListPage ¶
type ResourceSummaryListPage = generated.BpmnResourceSummaryPaginatedResponse
Re-exported response and entity types so callers don't need to depend on the generated package directly.
type SignalOption ¶
type SignalOption func(*signalOpts)
SignalOption tunes a published signal.
func WithSignalTTL ¶
func WithSignalTTL(ttl string) SignalOption
WithSignalTTL sets the buffered signal lifetime.
type StartInstanceOption ¶ added in v1.0.0
type StartInstanceOption func(*startInstanceOpts)
StartInstanceOption tunes a StartInstance / StartTestInstance call.
func WithStartBusinessID ¶ added in v1.0.0
func WithStartBusinessID(id string) StartInstanceOption
WithStartBusinessID stamps the new instance with a caller-supplied correlation key (order number, ticket ID, etc.). Inherited by every child instance, external job, user task, and DMN execution emitted by it.
type UpdateAssignmentBody ¶
type UpdateAssignmentBody = generated.UpdateUserTaskAssignmentRequest
Re-exported response and entity types so callers don't need to depend on the generated package directly.
type UserTask ¶
Re-exported response and entity types so callers don't need to depend on the generated package directly.
type UserTaskListOption ¶
type UserTaskListOption func(*userTaskListOpts)
UserTaskListOption tunes a list-user-tasks query.
func WithUserTaskAssignee ¶
func WithUserTaskAssignee(user string) UserTaskListOption
WithUserTaskAssignee filters tasks by current assignee.
func WithUserTaskBusinessID ¶ added in v1.0.0
func WithUserTaskBusinessID(id string) UserTaskListOption
WithUserTaskBusinessID filters tasks by the originating instance's caller-supplied correlation key.
func WithUserTaskCandidateGroup ¶
func WithUserTaskCandidateGroup(group string) UserTaskListOption
WithUserTaskCandidateGroup filters tasks where group is in candidateGroups.
func WithUserTaskCandidateUser ¶
func WithUserTaskCandidateUser(user string) UserTaskListOption
WithUserTaskCandidateUser filters tasks where user is in candidateUsers.
func WithUserTaskPage ¶
func WithUserTaskPage(p int) UserTaskListOption
WithUserTaskPage sets the 1-indexed page number.
func WithUserTaskPageSize ¶
func WithUserTaskPageSize(s int) UserTaskListOption
WithUserTaskPageSize sets the page size.
func WithUserTaskStatus ¶
func WithUserTaskStatus(status string) UserTaskListOption
WithUserTaskStatus filters tasks by lifecycle status.
func WithUserTaskWorkflowID ¶
func WithUserTaskWorkflowID(id string) UserTaskListOption
WithUserTaskWorkflowID filters tasks by originating instance.
type UserTaskListPage ¶
type UserTaskListPage = generated.BpmnUserTaskPaginatedResponse
Re-exported response and entity types so callers don't need to depend on the generated package directly.
type ValidateResponse ¶
type ValidateResponse = generated.BpmnValidateResponse
Re-exported response and entity types so callers don't need to depend on the generated package directly.
type ValidationIssue ¶
type ValidationIssue = generated.BpmnValidationIssue
Re-exported response and entity types so callers don't need to depend on the generated package directly.