processinstance

package
v0.0.35 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("process instance not found")
View Source
var (
	ErrUnknownStateFilter = errors.New("is unknown (valid: all, active, canceled, completed)")
)

Functions

This section is empty.

Types

type API

type API interface {
	camunda.Base
	GetProcessInstanceByKey(ctx context.Context, key int64) (ProcessInstance, error)
	SearchForProcessInstances(ctx context.Context, filter SearchFilterOpts, size int32) (ProcessInstances, error)
	CancelProcessInstance(ctx context.Context, key int64) (CancelResponse, error)
	GetDirectChildrenOfProcessInstance(ctx context.Context, key int64) (ProcessInstances, error)
	FilterProcessInstanceWithOrphanParent(ctx context.Context, items []ProcessInstance) ([]ProcessInstance, error)
	DeleteProcessInstance(ctx context.Context, key int64) (ChangeStatus, error)
	DeleteProcessInstanceWithCancel(ctx context.Context, key int64) (ChangeStatus, error)
	WaitForProcessInstanceState(ctx context.Context, key int64, desiredState State) error
}

type CancelResponse

type CancelResponse struct {
	StatusCode int
	Status     string
}

type ChangeStatus

type ChangeStatus struct {
	Deleted int64
	Message string
}

func (ChangeStatus) String added in v0.0.34

func (c ChangeStatus) String() string

type ProcessInstance

type ProcessInstance struct {
	BpmnProcessId             string `json:"bpmnProcessId,omitempty"`
	EndDate                   string `json:"endDate,omitempty"`
	Incident                  bool   `json:"incident,omitempty"`
	Key                       int64  `json:"key,omitempty"`
	ParentFlowNodeInstanceKey int64  `json:"parentFlowNodeInstanceKey,omitempty"`
	ParentKey                 int64  `json:"parentKey,omitempty"`
	ParentProcessInstanceKey  int64  `json:"parentProcessInstanceKey,omitempty"`
	ProcessDefinitionKey      int64  `json:"processDefinitionKey,omitempty"`
	ProcessVersion            int32  `json:"processVersion,omitempty"`
	ProcessVersionTag         string `json:"processVersionTag,omitempty"`
	StartDate                 string `json:"startDate,omitempty"`
	State                     State  `json:"state,omitempty"`
	TenantId                  string `json:"tenantId,omitempty"`
}

type ProcessInstanceState

type ProcessInstanceState string

ProcessInstanceState defines model for ProcessInstance.State.

type ProcessInstances

type ProcessInstances struct {
	Total int32             `json:"total,omitempty"`
	Items []ProcessInstance `json:"items,omitempty"`
}

func (ProcessInstances) FilterByHavingIncidents

func (r ProcessInstances) FilterByHavingIncidents(has bool) ProcessInstances

func (ProcessInstances) FilterChildrenOnly

func (r ProcessInstances) FilterChildrenOnly() ProcessInstances

func (ProcessInstances) FilterParentsOnly

func (r ProcessInstances) FilterParentsOnly() ProcessInstances

type SearchFilterOpts

type SearchFilterOpts struct {
	Key               int64
	BpmnProcessId     string
	ProcessVersion    int32
	ProcessVersionTag string
	State             State
	ParentKey         int64
}

type State

type State string

State is the process-instance state filter.

const (
	StateAll       State = "all"
	StateActive    State = "active"
	StateCompleted State = "completed"
	StateCanceled  State = "canceled"
)

func ParseState

func ParseState(in string) (State, error)

ParseState parses a string (case-insensitive) into a State.

func (State) EqualsIgnoreCase added in v0.0.32

func (s State) EqualsIgnoreCase(other State) bool

func (State) String

func (s State) String() string

type Walker

type Walker interface {
	Ancestry(ctx context.Context, startKey int64) (rootKey int64, path []int64, chain map[int64]ProcessInstance, err error)
	Descendants(ctx context.Context, rootKey int64) (desc []int64, edges map[int64][]int64, chain map[int64]ProcessInstance, err error)
	Family(ctx context.Context, startKey int64) (fam []int64, edges map[int64][]int64, chain map[int64]ProcessInstance, err error)
}

func AsWalker

func AsWalker(api API) (Walker, bool)

Jump to

Keyboard shortcuts

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