parser

package
v0.0.0-...-78845b4 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2018 License: GPL-3.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const (
	EMPTY     = "unknown"
	XML_SPACE = "bpmn2"

	BPMNIO_TYPE_GATEWAY  = "gateway"
	BPMNIO_TYPE_EVENT    = "event"
	BPMNIO_TYPE_TASK     = "task"
	BPMNIO_TYPE_ACTIVITY = "activity"
	BPMNIO_TYPE_NONE     = ""

	BPMNIO_TAG_ROOT                    = XML_SPACE + ":definitions"
	BPMNIO_TAG_COLABORATION            = XML_SPACE + ":collaboration"
	BPMNIO_TAG_PROCESS                 = XML_SPACE + ":process"
	BPMNIO_TAG_SUB_PROCESS             = XML_SPACE + ":subProcess"
	BPMNIO_TAG_START_EVENT             = XML_SPACE + ":startEvent"
	BPMNIO_TAG_END_EVENT               = XML_SPACE + ":endEvent"
	BPMNIO_TAG_OUTGOING                = XML_SPACE + ":outgoing"
	BPMNIO_TAG_INCOMING                = XML_SPACE + ":incoming"
	BPMNIO_TAG_SEQUENCE_FLOW           = XML_SPACE + ":sequenceFlow"
	BPMNIO_TAG_MESSAGE_FLOW            = XML_SPACE + ":messageFlow"
	BPMNIO_TAG_TASK                    = XML_SPACE + ":task"
	BPMNIO_TAG_LANE_SET                = XML_SPACE + ":laneSet"
	BPMNIO_TAG_LANE                    = XML_SPACE + ":lane"
	BPMNIO_TAG_FLOW_NODE_REF           = XML_SPACE + ":flowNodeRef"
	BPMNIO_TAG_EVENT_BASED_GATEWAY     = XML_SPACE + ":eventBasedGateway"
	BPMNIO_TAG_EVENT_EXCLUSIVE_GATEWAY = XML_SPACE + ":exclusiveGateway"
	BPMNIO_TAG_EVENT_PARALLEL_GATEWAY  = XML_SPACE + ":parallelGateway"
	BPMNIO_TAG_EVENT_COMPLEX_GATWAY    = XML_SPACE + ":complexGateway"
	BPMNIO_TAG_DATA_INPUT_ASSOCIATION  = XML_SPACE + ":dataInputAssociation"
	BPMNIO_TAG_DATA_OUTPUT_ASSOCIATION = XML_SPACE + ":dataOutputAssociation"
	BPMNIO_TAG_DATA_OBJECT_REFERENCE   = XML_SPACE + ":dataObjectReference"

	BPMNIO_ATTR_ID         = "id"
	BPMNIO_ATTR_SOURCE_REF = "sourceRef"
	BPMNIO_ATTR_TARGET_REF = "targetRef"
	BPMNIO_ATTR_NAME       = "name"

	BPMNIO_ATTR_CVDI_NEURON = "cvdi:neuron"
	BPMNIO_ATTR_CVDI_ACTION = "cvdi:action"
)
View Source
const (
	PROVIDER_BPMNIO_DIAGRAM = "bpmn.io"
	PROVIDER_GOJS_DIAGRAM   = "gojs"
	PROVIDER_DRAWIO_DIAGRAM = "draw.io"
)

Constantes en donde se definen los proveedores de parseo

Variables

This section is empty.

Functions

This section is empty.

Types

type Diagram

type Diagram interface {
	GetGateways() []Gateway
	GetEvents() []Event
	GetTasks() []Task
	GetLanes() []Lane
	GetPools() []Pool

	LoadDiagramByPath(string) error
	LoadDiagramByBuffer([]byte) error
	LoadDiagramByString(string) error
}

func NewProviderParser

func NewProviderParser(provider string) Diagram

Funcion que sirve para instanciar el nuevo parseador dependiendo del proveedor que se especifique

Retorna una interface{}, los metodos de esta deberian coincidir con la interface Diagram

type DiagramBpmnIO

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

func NewParserBPMNIO

func NewParserBPMNIO() *DiagramBpmnIO

func (DiagramBpmnIO) GetAttributeElement

func (this DiagramBpmnIO) GetAttributeElement(elem *etree.Element, key string) string

Esta funcion obtiene el atributo nombre del elemento

Retorna un string con el nombre

func (DiagramBpmnIO) GetDataInputElement

func (this DiagramBpmnIO) GetDataInputElement(elem *etree.Element) []*etree.Element

Esta funcion obtiene todos los datos de entrada de un elemento

Retorna slice de puntero element

func (DiagramBpmnIO) GetElements

func (this DiagramBpmnIO) GetElements() []*etree.Element

Esta funcion obtiene todos los elementos del diagrama ya sean gateways, process, subprocess etc..

Retorna Retorna slice de puntero element

func (DiagramBpmnIO) GetElementsInLane

func (this DiagramBpmnIO) GetElementsInLane(lane_elem *etree.Element) []*etree.Element

Esta funcion obtiene todos dentro de un lane especifico

Retorna slice de puntero element

func (DiagramBpmnIO) GetEvents

func (this DiagramBpmnIO) GetEvents() []Event

func (DiagramBpmnIO) GetFlows

func (this DiagramBpmnIO) GetFlows() []*etree.Element

Esta funcion obtiene los flows del proceso

Retorna Retorna slice de puntero element

func (DiagramBpmnIO) GetGateways

func (this DiagramBpmnIO) GetGateways() []Gateway

func (DiagramBpmnIO) GetLanes

func (this DiagramBpmnIO) GetLanes() []Lane

func (DiagramBpmnIO) GetLanesElement

func (this DiagramBpmnIO) GetLanesElement() []*etree.Element

Esta funcion obtiene todos los carriles del diagrama

Retorna slice de puntero element

func (DiagramBpmnIO) GetPools

func (this DiagramBpmnIO) GetPools() []Pool

func (DiagramBpmnIO) GetSuccessionProcess

func (this DiagramBpmnIO) GetSuccessionProcess() []*etree.Element

Esta funcion obtiene todoo el flujo del proceso, secuencial en un slice de elementos

Retorna slice de puntero element

func (DiagramBpmnIO) GetTasks

func (this DiagramBpmnIO) GetTasks() []Task

func (DiagramBpmnIO) GetTypeElement

func (this DiagramBpmnIO) GetTypeElement(elem *etree.Element) string

Obtiene el tipo de elemento

func (DiagramBpmnIO) HasDataInput

func (this DiagramBpmnIO) HasDataInput(elem *etree.Element) bool

Esta funcion es usada para verificar si un elemento posee datos de entrada

Retorna booleano

func (*DiagramBpmnIO) LoadDiagramByBuffer

func (this *DiagramBpmnIO) LoadDiagramByBuffer(buf []byte) error

func (*DiagramBpmnIO) LoadDiagramByPath

func (this *DiagramBpmnIO) LoadDiagramByPath(path string) error

func (*DiagramBpmnIO) LoadDiagramByString

func (this *DiagramBpmnIO) LoadDiagramByString(str string) error

func (*DiagramBpmnIO) ReadFromBytes

func (this *DiagramBpmnIO) ReadFromBytes(bytes []byte) error

Funcion que carga el diagrama XML en forma de byte

func (*DiagramBpmnIO) ReadFromFile

func (this *DiagramBpmnIO) ReadFromFile(filename string) error

Funcion que carga el diagrama XML en forma de pathfile

func (*DiagramBpmnIO) ReadFromString

func (this *DiagramBpmnIO) ReadFromString(data string) error

Funcion que carga el diagrama XML en forma de string

type Event

type Event struct {
	Type string
}

type Gateway

type Gateway struct {
	Type string
}

type Lane

type Lane struct {
	Name string
}

type Pool

type Pool struct {
	Name string
}

type Task

type Task struct {
	Name     string
	Type     string
	NeuronID string
	ActionID string
}

Jump to

Keyboard shortcuts

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