builder

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2022 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsBPMN

func IsBPMN(input string) bool

func IsDir

func IsDir(input string) bool

Types

type Element

type Element struct {
	Id            string
	Name          string
	BpmnType      string
	XMLElement    any
	NextStateCode string
}

func NewElement

func NewElement(elementType string, src any) *Element

type IDName

type IDName interface {
	GetId() string
	GetName() string
}

type Incoming

type Incoming interface {
	GetIncoming() []string
}

type Outgoing

type Outgoing interface {
	GetOutgoing() []string
}

type OutputDefProcessCode

type OutputDefProcessCode struct {
	InputFile  string // Input BPMN file path including file name
	OutputFile string // Output go code path including file name
	Defs       *XMLBPMNDefinitions
	OutputCode *ProcessCode // Output code
}

type Process

type Process struct {
	Id         string
	Name       string
	StartEvent *Element
	Elements   []*Element
	UserTasks  []*Element

	GoPackage           string
	GoStartVariableName string
	GoStartVariableType string
	// contains filtered or unexported fields
}

type ProcessCode

type ProcessCode struct {
	Process *Process
	Code    *string
}

type ProcessGenerator

type ProcessGenerator struct {
	Input                   string                                                                                         // Input BPMN file or path to process BPMN files
	Output                  string                                                                                         // Output BPMN file or path for generated code
	OutputFileNameGenerator func(inputFile string, process *XMLBPMNProcess, input, output string, isOutputDir bool) string // Generates the output file path/name for a given input file, and the input/output args.
	OutputGen               map[string]*OutputDefProcessCode                                                               // Stores output definitions and code given input file path and name
}

ProcessGenerator manages creating go code for a process

func NewProcessGenerator

func NewProcessGenerator(input, output string) *ProcessGenerator

func (*ProcessGenerator) GenerateAndWriteCodeFromBPMN

func (p *ProcessGenerator) GenerateAndWriteCodeFromBPMN() error

type Script

type Script interface {
	GetScript() string
}

type XMLBPMNDefinitions

type XMLBPMNDefinitions struct {
	XMLName xml.Name       `xml:"definitions"`
	Process XMLBPMNProcess `xml:"process"`
}

type XMLBPMNProcess

type XMLBPMNProcess struct {
	XMLIDName
	XMLName             xml.Name              `xml:"process"`
	StartEvents         []XMLBPMNStartEvent   `xml:"startEvent"`
	ExclusiveGateways   []XMLExclusiveGateway `xml:"exclusiveGateway"`
	ParallelGateways    []XMLParallelGateway  `xml:"parallelGateway"`
	SequenceFlows       []XMLSequenceFlow     `xml:"sequenceFlow"`
	UserTasks           []XMLUserTask         `xml:"userTask"`
	EndEvents           []XMLEndEvent         `xml:"endEvent"`
	ScriptTasks         []XMLScriptTask       `xml:"scriptTask"`
	GoPackage           string                `xml:"package,attr"`
	GoStartVariableName string                `xml:"startVariableName,attr"`
	GoStartVariableType string                `xml:"startVariableType,attr"`
}

type XMLBPMNStartEvent

type XMLBPMNStartEvent struct {
	XMLName xml.Name `xml:"startEvent"`
	XMLIDName
	XMLOutgoingElements
	TimerEventDefinition XMLTimerEventDefinition `xml:"timerEventDefinition"`
}

type XMLConditionExpression

type XMLConditionExpression struct {
	XMLName             xml.Name `xml:"conditionExpression"`
	Type                string   `xml:"type,attr"`
	ConditionExpression string   `xml:"conditionExpression"`
}

type XMLEndEvent

type XMLEndEvent struct {
	XMLIDName
	XMLIncomingElements
	XMLName xml.Name `xml:"endEvent"`
}

type XMLExclusiveGateway

type XMLExclusiveGateway struct {
	XMLIDName
	XMLIncomingElements
	XMLOutgoingElements
	XMLName xml.Name `xml:"exclusiveGateway"`
	Default string   `xml:"default,attr"`
}

type XMLIDName

type XMLIDName struct {
	Id   string `xml:"id,attr"`
	Name string `xml:"name,attr"`
}

func (*XMLIDName) GetId

func (x *XMLIDName) GetId() string

func (*XMLIDName) GetName

func (x *XMLIDName) GetName() string

type XMLIncomingElements

type XMLIncomingElements struct {
	Incoming []string `xml:"incoming"`
}

func (*XMLIncomingElements) GetIncoming

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

type XMLOutgoingElements

type XMLOutgoingElements struct {
	Outgoing []string `xml:"outgoing"`
}

func (*XMLOutgoingElements) GetOutgoing

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

type XMLParallelGateway

type XMLParallelGateway struct {
	XMLIDName
	XMLIncomingElements
	XMLOutgoingElements
	XMLName xml.Name `xml:"parallelGateway"`
}

type XMLScript

type XMLScript struct {
	Script string `xml:"script"`
}

func (*XMLScript) GetScript

func (s *XMLScript) GetScript() string

type XMLScriptTask

type XMLScriptTask struct {
	XMLIDName
	XMLIncomingElements
	XMLOutgoingElements
	XMLScript
	XMLName xml.Name `xml:"scriptTask"`
}

type XMLSequenceFlow

type XMLSequenceFlow struct {
	XMLIDName
	XMLConditionExpression
	XMLName   xml.Name `xml:"sequenceFlow"`
	SourceRef string   `xml:"sourceRef,attr"`
	TargetRef string   `xml:"targetRef,attr"`
}

func (*XMLSequenceFlow) GetOutgoing

func (x *XMLSequenceFlow) GetOutgoing() []string

type XMLTimeCycle

type XMLTimeCycle struct {
	XMLName       xml.Name `xml:"timeCycle"`
	Type          string   `xml:"type,attr"`
	TimeCycle     string   `xml:"timeCycle"`
	ISO8601       streamlet.ISO8601DateTime
	DurationMicro int64
}

type XMLTimerEventDefinition

type XMLTimerEventDefinition struct {
	XMLName xml.Name `xml:"timerEventDefinition"`
	XMLTimeCycle
}

type XMLUserTask

type XMLUserTask struct {
	XMLIDName
	XMLIncomingElements
	XMLOutgoingElements
	XMLName    xml.Name `xml:"userTask"`
	GoDataType string   `xml:"dataType,attr"`
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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