bpmn

package
v0.10.2-patch-1 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TargetNamespace = "http://bpmn.io/schema/bpmn"
	BpmnModel       = "http://www.omg.org/spec/BPMN/20100524/MODEL"
	BpmnDI          = "http://www.omg.org/spec/BPMN/20100524/DI"
	BpmnDC          = "http://www.omg.org/spec/DD/20100524/DC"
	BpmnSpecDI      = "http://www.omg.org/spec/DD/20100524/DI"
	XSI             = "http://www.w3.org/2001/XMLSchema-instance"
	Zeebe           = "http://camunda.org/schema/zeebe/1.0"
)

Variables

This section is empty.

Functions

func Deserialize

func Deserialize(start *etree.Element) (any, error)

func IsEndEvent

func IsEndEvent(elem Element) bool

func IsGateway

func IsGateway(elem Element) bool

func IsStartEvent

func IsStartEvent(elem Element) bool

func Serialize

func Serialize(element any, start *etree.Element) error

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

Builder builds Definitions structure

func NewBuilder

func NewBuilder(name string) *Builder

func (*Builder) AppendElem

func (b *Builder) AppendElem(elem Element) *Builder

func (*Builder) End

func (b *Builder) End() *Builder

func (*Builder) Id

func (b *Builder) Id(id string) *Builder

func (*Builder) Out

func (b *Builder) Out() (*Definitions, error)

func (*Builder) SetProperty

func (b *Builder) SetProperty(key, value string) *Builder

func (*Builder) Start

func (b *Builder) Start() *Builder

type ConditionExpression

type ConditionExpression struct {
	Type  string
	Value string
}

type DataAssociation

type DataAssociation struct {
	Id     string
	Source string
	Target string
}

type DataObject

type DataObject struct {
	Id               string
	Name             string
	ExtensiveElement *ExtensionElement
}

func (*DataObject) GetExtension

func (o *DataObject) GetExtension() *ExtensionElement

func (*DataObject) GetID

func (o *DataObject) GetID() string

func (*DataObject) GetIncoming

func (o *DataObject) GetIncoming() []string

func (*DataObject) GetName

func (o *DataObject) GetName() string

func (*DataObject) GetOutgoing

func (o *DataObject) GetOutgoing() []string

func (*DataObject) GetShape

func (o *DataObject) GetShape() Shape

func (*DataObject) SetExtension

func (o *DataObject) SetExtension(elem *ExtensionElement)

func (*DataObject) SetID

func (o *DataObject) SetID(id string)

func (*DataObject) SetIncoming

func (o *DataObject) SetIncoming(incoming []string)

func (*DataObject) SetName

func (o *DataObject) SetName(name string)

func (*DataObject) SetOutgoing

func (o *DataObject) SetOutgoing(outgoing []string)

type DataReference

type DataReference struct {
	Id  string
	Ref string
}

type DataStore

type DataStore struct {
	Id               string
	Name             string
	ExtensionElement *ExtensionElement
}

func (*DataStore) GetExtension

func (s *DataStore) GetExtension() *ExtensionElement

func (*DataStore) GetID

func (s *DataStore) GetID() string

func (*DataStore) GetIncoming

func (s *DataStore) GetIncoming() []string

func (*DataStore) GetName

func (s *DataStore) GetName() string

func (*DataStore) GetOutgoing

func (s *DataStore) GetOutgoing() []string

func (*DataStore) GetShape

func (s *DataStore) GetShape() Shape

func (*DataStore) SetExtension

func (s *DataStore) SetExtension(elem *ExtensionElement)

func (*DataStore) SetID

func (s *DataStore) SetID(id string)

func (*DataStore) SetIncoming

func (s *DataStore) SetIncoming(incoming []string)

func (*DataStore) SetName

func (s *DataStore) SetName(name string)

func (*DataStore) SetOutgoing

func (s *DataStore) SetOutgoing(outgoing []string)

type Definitions

type Definitions struct {
	Bpmn            string
	BpmnDI          string
	DC              string
	DI              string
	XSI             string
	Zeebe           string
	TargetNamespace string
	Id              string

	Diagram *Diagram
	// contains filtered or unexported fields
}

func FromXML

func FromXML(text string) (*Definitions, error)

func NewDefinitions

func NewDefinitions() *Definitions

func (*Definitions) AutoLayout

func (d *Definitions) AutoLayout() *Definitions

func (*Definitions) DefaultProcess

func (d *Definitions) DefaultProcess() (*Process, error)

func (*Definitions) NewProcess

func (d *Definitions) NewProcess(p *Process) *Definitions

func (*Definitions) WriteToBytes

func (d *Definitions) WriteToBytes() ([]byte, error)

func (*Definitions) WriteToFile

func (d *Definitions) WriteToFile(path string) error

type Deserializer

type Deserializer interface {
	Deserialize(start *etree.Element) (any, error)
}

type Diagram

type Diagram struct {
	Id     string
	Planes []*DiagramPlane
}

type DiagramBounds

type DiagramBounds struct {
	X      int64
	Y      int64
	Width  int64
	Height int64
}

type DiagramEdge

type DiagramEdge struct {
	Id        string
	Element   string
	Waypoints []*DiagramWaypoint
	Label     *DiagramLabel
}

type DiagramLabel

type DiagramLabel struct {
	Bounds *DiagramBounds
}

type DiagramPlane

type DiagramPlane struct {
	Id      string
	Element string
	Shapes  []*DiagramShape
	Edges   []*DiagramEdge
}

type DiagramShape

type DiagramShape struct {
	Id      string
	Element string
	Label   *DiagramLabel
	Bounds  *DiagramBounds
}

type DiagramWaypoint

type DiagramWaypoint struct {
	X int64
	Y int64
}

type Element

type Element interface {
	GetShape() Shape
	GetID() string
	SetID(id string)
	GetName() string
	SetName(name string)
	GetIncoming() []string
	SetIncoming(incoming []string)
	GetOutgoing() []string
	SetOutgoing(outgoing []string)
	GetExtension() *ExtensionElement
	SetExtension(elem *ExtensionElement)
}

type EndEvent

type EndEvent struct {
	// contains filtered or unexported fields
}

func (*EndEvent) GetExtension

func (e *EndEvent) GetExtension() *ExtensionElement

func (*EndEvent) GetID

func (e *EndEvent) GetID() string

func (*EndEvent) GetIncoming

func (e *EndEvent) GetIncoming() []string

func (*EndEvent) GetName

func (e *EndEvent) GetName() string

func (*EndEvent) GetOutgoing

func (e *EndEvent) GetOutgoing() []string

func (*EndEvent) GetShape

func (e *EndEvent) GetShape() Shape

func (*EndEvent) SetExtension

func (e *EndEvent) SetExtension(elem *ExtensionElement)

func (*EndEvent) SetID

func (e *EndEvent) SetID(id string)

func (*EndEvent) SetIncoming

func (e *EndEvent) SetIncoming(incoming []string)

func (*EndEvent) SetName

func (e *EndEvent) SetName(name string)

func (*EndEvent) SetOutgoing

func (e *EndEvent) SetOutgoing(outgoing []string)

type ExclusiveGateway

type ExclusiveGateway struct {
	Gateway
}

func (*ExclusiveGateway) GetShape

func (g *ExclusiveGateway) GetShape() Shape

type ExtensionElement

type ExtensionElement struct {
	Properties     *Properties
	Headers        *TaskHeaders
	TaskDefinition *TaskDefinition
	IOMapping      *IOMapping
}

type Gateway

type Gateway struct {
	Id               string
	Name             string
	Incoming         []string
	Outgoing         []string
	ExtensionElement *ExtensionElement
}

func (*Gateway) GetExtension

func (g *Gateway) GetExtension() *ExtensionElement

func (*Gateway) GetID

func (g *Gateway) GetID() string

func (*Gateway) GetIncoming

func (g *Gateway) GetIncoming() []string

func (*Gateway) GetName

func (g *Gateway) GetName() string

func (*Gateway) GetOutgoing

func (g *Gateway) GetOutgoing() []string

func (*Gateway) GetShape

func (g *Gateway) GetShape() Shape

func (*Gateway) SetExtension

func (g *Gateway) SetExtension(elem *ExtensionElement)

func (*Gateway) SetID

func (g *Gateway) SetID(id string)

func (*Gateway) SetIncoming

func (g *Gateway) SetIncoming(incoming []string)

func (*Gateway) SetName

func (g *Gateway) SetName(name string)

func (*Gateway) SetOutgoing

func (g *Gateway) SetOutgoing(outgoing []string)

type HeaderItem

type HeaderItem struct {
	Key   string
	Value string
}

type IOMapping

type IOMapping struct {
	Input  []*Mapping
	Output []*Mapping
}

type InclusiveGateway

type InclusiveGateway struct {
	Gateway
}

func (*InclusiveGateway) GetShape

func (g *InclusiveGateway) GetShape() Shape

type Mapping

type Mapping struct {
	Source string
	Target string
}

type ParallelGateway

type ParallelGateway struct {
	Gateway
}

func (*ParallelGateway) GetShape

func (g *ParallelGateway) GetShape() Shape

type Process

type Process struct {
	Id         string
	Name       string
	Executable bool

	ExtensionElement *ExtensionElement
	Elements         *btree.Map[string, Element]
	ObjectReferences *btree.Map[string, *DataReference]
	StoreReferences  *btree.Map[string, *DataReference]
	// contains filtered or unexported fields
}

func NewProcess

func NewProcess(name string) *Process

func (*Process) AfterInsertElem

func (p *Process) AfterInsertElem(src string, dst Element, cond *ConditionExpression) *Process

AfterInsertElem inserts a new element to Process after the specified Element

func (*Process) AppendElem

func (p *Process) AppendElem(elem Element) *Process

func (*Process) BeforeInsertElem

func (p *Process) BeforeInsertElem(dst string, src Element, cond *ConditionExpression) *Process

BeforeInsertElem inserts a new element to Process before the specified Element

func (*Process) Draw

func (p *Process) Draw() *DiagramPlane

func (*Process) GetExtension

func (p *Process) GetExtension() *ExtensionElement

func (*Process) GetID

func (p *Process) GetID() string

func (*Process) GetIncoming

func (p *Process) GetIncoming() []string

func (*Process) GetName

func (p *Process) GetName() string

func (*Process) GetOutgoing

func (p *Process) GetOutgoing() []string

func (*Process) GetShape

func (p *Process) GetShape() Shape
func (p *Process) Link(src, dst string, cond *ConditionExpression) *Process

func (*Process) SetExtension

func (p *Process) SetExtension(elem *ExtensionElement)

func (*Process) SetID

func (p *Process) SetID(id string)

func (*Process) SetIncoming

func (p *Process) SetIncoming(incoming []string)

func (*Process) SetName

func (p *Process) SetName(name string)

func (*Process) SetOutgoing

func (p *Process) SetOutgoing(outgoing []string)

type Properties

type Properties struct {
	Items []*Property
}

type Property

type Property struct {
	Name  string
	Value string
}

type SequenceFlow

type SequenceFlow struct {
	Id               string
	Name             string
	SourceRef        string
	TargetRef        string
	Condition        *ConditionExpression
	ExtensionElement *ExtensionElement
}

func (*SequenceFlow) GetExtension

func (f *SequenceFlow) GetExtension() *ExtensionElement

func (*SequenceFlow) GetID

func (f *SequenceFlow) GetID() string

func (*SequenceFlow) GetIncoming

func (f *SequenceFlow) GetIncoming() []string

func (*SequenceFlow) GetName

func (f *SequenceFlow) GetName() string

func (*SequenceFlow) GetOutgoing

func (f *SequenceFlow) GetOutgoing() []string

func (*SequenceFlow) GetShape

func (f *SequenceFlow) GetShape() Shape

func (*SequenceFlow) SetExtension

func (f *SequenceFlow) SetExtension(elem *ExtensionElement)

func (*SequenceFlow) SetID

func (f *SequenceFlow) SetID(id string)

func (*SequenceFlow) SetIncoming

func (f *SequenceFlow) SetIncoming(incoming []string)

func (*SequenceFlow) SetName

func (f *SequenceFlow) SetName(name string)

func (*SequenceFlow) SetOutgoing

func (f *SequenceFlow) SetOutgoing(outgoing []string)

type Serializer

type Serializer interface {
	Serialize(element any, start *etree.Element) error
}

type ServiceTask

type ServiceTask struct {
	Task
}

func NewServiceTask

func NewServiceTask(name, typ string) *ServiceTask

func (*ServiceTask) GetShape

func (t *ServiceTask) GetShape() Shape

func (*ServiceTask) SetHeader

func (t *ServiceTask) SetHeader(key, value string)

func (*ServiceTask) SetProperty

func (t *ServiceTask) SetProperty(name, value string)

type Shape

type Shape int32
const (
	ProcessShape Shape = iota + 1
	CollaborationShape
	SubProcessShape
	FlowShape
	EventShape
	StartEventShape
	EndEventShape
	TaskShape
	ServiceTaskShape
	UserTaskShape
	GatewayShape
	ExclusiveGatewayShape
	InclusiveGatewayShape
	ParallelGatewayShape
	DataObjectShape
	DataStoreShape
)

func (Shape) Size

func (s Shape) Size() (int32, int32)

type StartEvent

type StartEvent struct {
	// contains filtered or unexported fields
}

func (*StartEvent) GetExtension

func (e *StartEvent) GetExtension() *ExtensionElement

func (*StartEvent) GetID

func (e *StartEvent) GetID() string

func (*StartEvent) GetIncoming

func (e *StartEvent) GetIncoming() []string

func (*StartEvent) GetName

func (e *StartEvent) GetName() string

func (*StartEvent) GetOutgoing

func (e *StartEvent) GetOutgoing() []string

func (*StartEvent) GetShape

func (e *StartEvent) GetShape() Shape

func (*StartEvent) SetExtension

func (e *StartEvent) SetExtension(elem *ExtensionElement)

func (*StartEvent) SetID

func (e *StartEvent) SetID(id string)

func (*StartEvent) SetIncoming

func (e *StartEvent) SetIncoming(incoming []string)

func (*StartEvent) SetName

func (e *StartEvent) SetName(name string)

func (*StartEvent) SetOutgoing

func (e *StartEvent) SetOutgoing(outgoing []string)

type Task

type Task struct {
	Id                    string
	Name                  string
	Incoming              string
	Outgoing              string
	Extension             *ExtensionElement
	Properties            []*TaskProperty
	DataInputAssociation  []*DataAssociation
	DataOutputAssociation []*DataAssociation
}

func (*Task) GetExtension

func (t *Task) GetExtension() *ExtensionElement

func (*Task) GetID

func (t *Task) GetID() string

func (*Task) GetIncoming

func (t *Task) GetIncoming() []string

func (*Task) GetName

func (t *Task) GetName() string

func (*Task) GetOutgoing

func (t *Task) GetOutgoing() []string

func (*Task) GetShape

func (t *Task) GetShape() Shape

func (*Task) SetExtension

func (t *Task) SetExtension(elem *ExtensionElement)

func (*Task) SetID

func (t *Task) SetID(id string)

func (*Task) SetIncoming

func (t *Task) SetIncoming(incoming []string)

func (*Task) SetName

func (t *Task) SetName(name string)

func (*Task) SetOutgoing

func (t *Task) SetOutgoing(outgoing []string)

type TaskDefinition

type TaskDefinition struct {
	Type    string
	Retries string
}

type TaskHeaders

type TaskHeaders struct {
	Items []*HeaderItem
}

type TaskProperty

type TaskProperty struct {
	Id   string
	Name string
}

type UserTask

type UserTask struct {
	Task
}

func (*UserTask) GetShape

func (t *UserTask) GetShape() Shape

Jump to

Keyboard shortcuts

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