Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
deemount committed Mar 11, 2024
2 parents e3c75ac + 3702e21 commit b01f020
Show file tree
Hide file tree
Showing 8 changed files with 137 additions and 137 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ A library of elements and attributes for processes in Business Process Model Not

## Wiki

The documentation is now written in the wiki of the respective module

[Wiki](https://github.com/deemount/gobpmnModels/wiki)
The [documentation](https://github.com/deemount/gobpmnModels/wiki) is now written in the wiki of the respective module

**Start here** [gobpmn](https://github.com/deemount/gobpmn)

Expand All @@ -20,8 +18,10 @@ You can also test the idea behind it directly. Simply follow the link to the lab

## Modules

+ [gobpmnTypes](https://github.com/deemount/gobpmnTypes)
+ [gobpmnCamunda](https://github.com/deemount/gobpmnCamunda)
+ [gobpmnDiagram](https://github.com/deemount/gobpmnDiagram)
+ [gobpmnBuilder](https://github.com/deemount/gobpmnBuilder)
+ [gobpmnCounter](https://github.com/deemount/gobpmnCounter)
+ [gobpmnHash](https://github.com/deemount/gobpmnHash)
+ [gobpmnReflection](https://github.com/deemount/gobpmnReflection)
+ [gobpmnTypes](https://github.com/deemount/gobpmnTypes)
58 changes: 30 additions & 28 deletions pkg/collaboration/Structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,36 @@ import (
* @Elementary
*/

// Collaboration ...
type Collaboration struct {
impl.CoreID
attributes.Attributes
Participant PARTICIPANT_SLC `xml:"bpmn:participant" json:"participant,omitempty"`
MessageFlow flow.MESSAGE_FLOW_SLC `xml:"bpmn:messageFlow,omitempty" json:"messageFlow,omitempty"`
}
type (
// Collaboration ...
Collaboration struct {
impl.CoreID
attributes.Attributes
Participant PARTICIPANT_SLC `xml:"bpmn:participant" json:"participant,omitempty"`
MessageFlow flow.MESSAGE_FLOW_SLC `xml:"bpmn:messageFlow,omitempty" json:"messageFlow,omitempty"`
}

// TCollaboration ...
type TCollaboration struct {
impl.CoreID
attributes.TAttributes
Participant TPARTICIPANT_SLC `xml:"participant" json:"participant,omitempty"`
MessageFlow flow.TMESSAGE_FLOW_SLC `xml:"messageFlow,omitempty" json:"messageFlow,omitempty"`
}
// TCollaboration ...
TCollaboration struct {
impl.CoreID
attributes.TAttributes
Participant TPARTICIPANT_SLC `xml:"participant" json:"participant,omitempty"`
MessageFlow flow.TMESSAGE_FLOW_SLC `xml:"messageFlow,omitempty" json:"messageFlow,omitempty"`
}

// Participant ...
type Participant struct {
impl.BaseAttributes
ProcessRef string `xml:"processRef,attr,omitempty" json:"processRef,omitempty" csv:"PROCESS_REF"`
Documentation attributes.DOCUMENTATION_SLC `xml:"bpmn:documentation,omitempty" json:"documentation,omitempty" csv:"DOCUMENTATION"`
ParticipantMultiplicity []loop.ParticipantMultiplicity `xml:"bpmn:participantMultiplicity,omitempty" json:"participantMultiplicity,omitempty" csv:"PARTICIPANT_MULTIPLICITY"`
}
// Participant ...
Participant struct {
impl.BaseAttributes
ProcessRef string `xml:"processRef,attr,omitempty" json:"processRef,omitempty" csv:"PROCESS_REF"`
Documentation attributes.DOCUMENTATION_SLC `xml:"bpmn:documentation,omitempty" json:"documentation,omitempty" csv:"DOCUMENTATION"`
ParticipantMultiplicity []loop.ParticipantMultiplicity `xml:"bpmn:participantMultiplicity,omitempty" json:"participantMultiplicity,omitempty" csv:"PARTICIPANT_MULTIPLICITY"`
}

// TParticipant ...
type TParticipant struct {
impl.BaseAttributes
ProcessRef string `xml:"processRef,attr" json:"processRef,omitempty"`
Documentation attributes.DOCUMENTATION_SLC `xml:"documentation,omitempty" json:"documentation,omitempty"`
ParticipantMultiplicity []loop.TParticipantMultiplicity `xml:"participantMultiplicity,omitempty" json:"participantMultiplicity,omitempty"`
}
// TParticipant ...
TParticipant struct {
impl.BaseAttributes
ProcessRef string `xml:"processRef,attr" json:"processRef,omitempty"`
Documentation attributes.DOCUMENTATION_SLC `xml:"documentation,omitempty" json:"documentation,omitempty"`
ParticipantMultiplicity []loop.TParticipantMultiplicity `xml:"participantMultiplicity,omitempty" json:"participantMultiplicity,omitempty"`
}
)
53 changes: 12 additions & 41 deletions pkg/core/Definitions.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,13 @@ import (
"github.com/deemount/gobpmnModels/pkg/events"
"github.com/deemount/gobpmnModels/pkg/marker"
"github.com/deemount/gobpmnModels/pkg/process"
impl "github.com/deemount/gobpmnTypes"
gobpmnTypes "github.com/deemount/gobpmnTypes"
)

var (
schemaBpmnModel = "http://www.omg.org/spec/BPMN/20100524/MODEL"
schemaBpmn20 = "http://www.omg.org/spec/BPMN/2.0/20100501/BPMN20.xsd"
schemaBpmn20_HTTPS = "https://www.omg.org/spec/BPMN/20100501/BPMN20.xsd"
schemaOMGDC = "http://www.omg.org/spec/DD/20100524/DC"
schemaBpmnIOSchema = "http://bpmn.io/schema/bpmn"
schemaW3XmlSchema = "http://www.w3.org/2001/XMLSchema"
schemaW3XmlSchemaInstance = "http://www.w3.org/2001/XMLSchema-instance"
schemaOMGBpmnModel = "http://www.omg.org/spec/BPMN/20100524/MODEL"
schemaOMGDC = "http://www.omg.org/spec/DD/20100524/DC"
schemaBpmnIOSchema = "http://bpmn.io/schema/bpmn"
)

// NewDefinitions ...
Expand All @@ -34,46 +30,21 @@ func NewDefinitions() DefinitionsRepository {

/** BPMN **/

// SetID ...
func (definitions *Definitions) SetID(typ string, suffix interface{}) {
definitions.ID = SetID(typ, suffix)
}

// SetBpmn ...
func (definitions *Definitions) SetBpmn() {
definitions.Bpmn = schemaBpmnModel
definitions.Bpmn = schemaOMGBpmnModel
}

// SetDC ...
func (definitions *Definitions) SetDC() {
definitions.DC = schemaOMGDC
}

// SetOmgDC ...
func (definitions *Definitions) SetOmgDC() {
definitions.OmgDC = schemaOMGDC
}

// SetXSD ...
func (definitions *Definitions) SetXSD() {
definitions.Xsd = schemaW3XmlSchema
}

// SetXSI ...
func (definitions *Definitions) SetXSI() {
definitions.Xsi = schemaW3XmlSchemaInstance
}

// SetXsiSchemaLocation ...
func (definitions *Definitions) SetXsiSchemaLocation() {
definitions.XsiSchemaLocation = fmt.Sprintf("%s %s", schemaBpmnModel, schemaBpmn20)
}

// SetXsiSchemaLocation ...
func (definitions *Definitions) SetXsiSchemaLocationHTTPS() {
definitions.XsiSchemaLocation = fmt.Sprintf("%s %s", schemaBpmnModel, schemaBpmn20_HTTPS)
}

// SetID ...
func (definitions *Definitions) SetID(typ string, suffix interface{}) {
definitions.ID = SetID(typ, suffix)
}

// SetTargetNamespace ...
func (definitions *Definitions) SetTargetNamespace() {
definitions.TargetNamespace = schemaBpmnIOSchema
Expand Down Expand Up @@ -117,7 +88,7 @@ func (definitions *Definitions) SetSignal(num int) {
* @Settings
*/

// SetDefinitionsAttributes ...
// SetDefaultAttributes ...
func (definitions *Definitions) SetDefaultAttributes() {
definitionsHash := utils.GenerateHash()
definitions.SetBpmn()
Expand All @@ -141,7 +112,7 @@ func (definitions *Definitions) SetMainElements(num int) {
/** BPMN **/

// GetID ...
func (definitions Definitions) GetID() impl.STR_PTR {
func (definitions Definitions) GetID() gobpmnTypes.STR_PTR {
return &definitions.ID
}

Expand Down
28 changes: 28 additions & 0 deletions pkg/core/Definitions_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package core

import (
"testing"
)

func TestDefinitionsRepository(t *testing.T) {
// create a new repository
repo := NewDefinitions()
t.Logf("result of repo is %v", repo)
// check if the repository is not nil
if repo == nil {
t.Errorf("expected a repository, got nil")
}
}

func TestDefinitionsRepositoryID(t *testing.T) {
// create a new repository
repo := NewDefinitions()
repo.SetID("definitions", "1234")
repo.SetCollaboration()
repo.SetProcess(0)
t.Logf("result of repo is %v", repo)
// check if the repository has the correct id
if *repo.GetID() != "Definitions_1234" {
t.Errorf("expected a correct id, got something else")
}
}
5 changes: 0 additions & 5 deletions pkg/core/Interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ type DefinitionsRepository interface {
DefinitionsElements
SetBpmn()
SetDC()
SetOmgDC()
SetXSD()
SetXSI()
SetXsiSchemaLocation()
SetXsiSchemaLocationHTTPS()
SetTargetNamespace()
SetMainElements(num int)
SetDefaultAttributes()
Expand Down
75 changes: 39 additions & 36 deletions pkg/core/Structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,42 @@ import (
"github.com/deemount/gobpmnModels/pkg/process"
)

// DefinitionsBaseElements ...
type DefinitionsBaseElements struct {
Collaboration collaboration.COLLABORATION_SLC `xml:"bpmn:collaboration,omitempty" json:"collaboration"`
Process process.PROCESS_SLC `xml:"bpmn:process,omitempty" json:"process"`
Category marker.CATEGORY_SLC `xml:"bpmn:category,omitempty" json:"category,omitempty"`
events.CoreEvents
}

// TDefinitionsBaseElements ...
type TDefinitionsBaseElements struct {
Collaboration collaboration.TCOLLABORATION_SLC `xml:"collaboration,omitempty" json:"collaboration"`
Process process.TPROCESS_SLC `xml:"process,omitempty" json:"process"`
Category marker.TCATEGORY_SLC `xml:"category,omitempty" json:"category,omitempty"`
events.TCoreEvents
}

// Definitions represents the root element
type Definitions struct {
XMLName xml.Name `xml:"bpmn:definitions" json:"-"`
Bpmn string `xml:"xmlns:bpmn,attr" json:"-"`
Xsd string `xml:"xmlns:xsd,attr,omitempty" json:"-"`
Xsi string `xml:"xmlns:xsi,omitempty" json:"-"`
XsiSchemaLocation string `xml:"xsi:schemaLocation,attr,omitempty" json:"-"`
DC string `xml:"xmlns:dc,attr,omitempty" json:"-"`
OmgDC string `xml:"xmlns:omgdc,attr,omitempty" json:"-"`
ID string `xml:"id,attr" json:"id"`
TargetNamespace string `xml:"targetNamespace,attr" json:"-"`
DefinitionsBaseElements
}

// TDefinitions ...
type TDefinitions struct {
XMLName xml.Name `xml:"definitions" json:"-"`
ID string `xml:"id,attr" json:"id"`
TDefinitionsBaseElements
}
type (

// DefinitionsBaseElements ...
DefinitionsBaseElements struct {
Collaboration collaboration.COLLABORATION_SLC `xml:"bpmn:collaboration,omitempty" json:"collaboration"`
Process process.PROCESS_SLC `xml:"bpmn:process,omitempty" json:"process"`
Category marker.CATEGORY_SLC `xml:"bpmn:category,omitempty" json:"category,omitempty"`
events.CoreEvents
}

// TDefinitionsBaseElements ...
TDefinitionsBaseElements struct {
Collaboration collaboration.TCOLLABORATION_SLC `xml:"collaboration,omitempty" json:"collaboration"`
Process process.TPROCESS_SLC `xml:"process,omitempty" json:"process"`
Category marker.TCATEGORY_SLC `xml:"category,omitempty" json:"category,omitempty"`
events.TCoreEvents
}

/*
* @Elementary
*/

// Definitions represents the root element
Definitions struct {
XMLName xml.Name `xml:"bpmn:definitions" json:"-"`
Bpmn string `xml:"xmlns:bpmn,attr" json:"-"`
DC string `xml:"xmlns:dc,attr,omitempty" json:"-"`
ID string `xml:"id,attr" json:"id"`
TargetNamespace string `xml:"targetNamespace,attr" json:"-"`
DefinitionsBaseElements
}

// TDefinitions ...
TDefinitions struct {
XMLName xml.Name `xml:"definitions" json:"-"`
ID string `xml:"id,attr" json:"id"`
TDefinitionsBaseElements
}
)
2 changes: 2 additions & 0 deletions pkg/pool/Types.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ package pool

type FLOWNODEREF_SLC []FlowNodeRef
type LANE_SLC []Lane
type LANE_SET_SLC []LaneSet

type TLANE_SLC []TLane
type TLANE_SET_SLC []TLaneSet

/*
* @Pointers
Expand Down
Loading

0 comments on commit b01f020

Please sign in to comment.