Skip to content

deemount/gobpmn

Repository files navigation

gobpmn

gobpmn

Description

gobpmn is an experimental library that makes it possible to reflect

  • structs,
  • anonymous fields,
  • typed and
  • generic maps

in Go and create business process models with it.

As a modeler with a CLI, gobpmn is a monorepo with clear encapsulation.

STILL IN DEVELOPMENT

Requirements

  • Go >= 1.24

Optional:

  • Saxon >= 12.5 (Requires Java >= 23)

Install

  1. Clone the repository or the download the .zip-File of the repository
  2. Install the latest gobpmn version as a package within a module with go get
  3. Install the latest gobpmn version as a package outside of a module with go install
go get github.com/deemount/gobpmn@latest
go install github.com/deemount/gobpmn@latest

Examples

go run examples/generic_map_simple_process/main.go
go run examples/typed_map_simple_process/main.go
go run examples/renting_process/main.go
go run examples/simple_process/main.go
go run examples/small_process/main.go

How To

package main

import (
    "log"
    "github.com/deemount/gobpmn"
)

type Process struct {
    Def             gobpmn.Repository
    IsExecutable    bool
    Process         gobpmn.BPMN
    StartEvent      gobpmn.BPMN
    FromStartEvent  gobpmn.BPMN
    Task            gobpmn.BPMN
    FromTask        gobpmn.BPMN
    EndEvent        gobpmn.BPMN
}

func (p Process) GetDefinitions() gobpmn.Repository {
    return p.Def
}

func main() {
    _, err := gobpmn.FromStruct(Process{})
    if err != nil {
        log.Fatalf("ERROR: %s", err)
        return
    }
}
package main

import (
    "log"
    "github.com/deemount/gobpmn"
)

var Process = map[string]any{
    "Def":                 gobpmn.Definitions(),
    "IsExecutable":        true,
    "Process":             gobpmn.BPMN{Pos: 1},
    "StartEvent":          gobpmn.BPMN{Pos: 2},
    "FromStartEvent":      gobpmn.BPMN{Pos: 3},
    "Task":                gobpmn.BPMN{Pos: 4},
    "FromTask":            gobpmn.BPMN{Pos: 5},
    "EndEvent":            gobpmn.BPMN{Pos: 6},
}

func main() {
    type T any
    _, err := gobpmn.FromMap[T](Process)
    if err != nil {
        log.Fatalf("ERROR: %s", err)
        return
    }
}

Wiki

Read the documentation

Further Links

Checkout the other projects for BPMN written in Go

Check my articles for this project on medium.com

About

Experimental Business Process Model Notation 2 with Go

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages