All Projects → citilinkru → camunda-client-go

citilinkru / camunda-client-go

Licence: MIT license
Camunda REST API client for golang

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to camunda-client-go

pycamunda
Python REST api client for the workflow and decision automation engine Camunda.
Stars: ✭ 33 (-65.26%)
Mutual labels:  camunda-bpm-platform, camunda, rest-client, camunda-external-task
camunda-external-task-client-python3
Camunda External Task Client in Python
Stars: ✭ 43 (-54.74%)
Mutual labels:  camunda, camunda-bpm, camunda-external-task
workflower-bundle
A Symfony bundle for Workflower
Stars: ✭ 23 (-75.79%)
Mutual labels:  bpmn, bpms
awesome-camunda
a curated list of awesome Camunda BPM projects, libraries, tools, documentations, forum posts, etc.
Stars: ✭ 93 (-2.11%)
Mutual labels:  bpmn, camunda
camunda-kafka-polling-client
Stream your process history to Kafka
Stars: ✭ 28 (-70.53%)
Mutual labels:  bpmn, camunda
camunda-bpm-migration
Fluent Java API for Camunda Platform 7 process instance migration
Stars: ✭ 18 (-81.05%)
Mutual labels:  bpmn, camunda
micronaut-camunda-bpm
Integration between Micronaut and Camunda (Workflow Engine). We configure Camunda with sensible defaults, so that you can get started with minimum configuration: simply add a dependency in your Micronaut project to embed the workflow engine!
Stars: ✭ 73 (-23.16%)
Mutual labels:  bpmn, camunda
Camunda Bpm Platform
Flexible framework for workflow and decision automation with BPMN and DMN. Integration with Spring, Spring Boot, CDI.
Stars: ✭ 2,390 (+2415.79%)
Mutual labels:  bpmn, camunda-bpm-platform
restish
Restish is a CLI for interacting with REST-ish HTTP APIs with some nice features built-in
Stars: ✭ 453 (+376.84%)
Mutual labels:  rest-client
bpmn-spec
A tool to run tests for BPMN processes on Zeebe
Stars: ✭ 28 (-70.53%)
Mutual labels:  bpmn
camunda-formio-plugin
Integration for Drag and Drop Formio Form Builder and Renderer with Camunda Tasklist App
Stars: ✭ 61 (-35.79%)
Mutual labels:  camunda
flow
企业级流程中心(基于flowable和bpmn.js封装的流程引擎,采用Springboot,Mybatis-plus, Ehcache, Shiro 等框架技术,前端采用Vue3&Antd,Vben)
Stars: ✭ 486 (+411.58%)
Mutual labels:  bpmn
plg
A Business Processes and Logs Generator
Stars: ✭ 30 (-68.42%)
Mutual labels:  bpmn
Kreya
Kreya is a GUI client for gRPC and REST APIs with innovative features for environments, authorizations and more.
Stars: ✭ 217 (+128.42%)
Mutual labels:  rest-client
camunda-cloud-helm
Camunda Platform 8 Self-Managed Helm charts
Stars: ✭ 41 (-56.84%)
Mutual labels:  camunda
FluentRest
Lightweight fluent wrapper over HttpClient to make REST calls easier
Stars: ✭ 54 (-43.16%)
Mutual labels:  rest-client
Rump
REST client for Java that allows for easy configuration and default values. Allows for quick request construction and a huge range of modifications by using response/request interceptors, adjusting default values related to HTTP requests and creating custom instances for when you need multiple API connection setups.
Stars: ✭ 55 (-42.11%)
Mutual labels:  rest-client
camunda-bpm-custom-batch
using the camunda batch execution for custom batch runs
Stars: ✭ 22 (-76.84%)
Mutual labels:  camunda
bpmn
BPMN diagrams in R
Stars: ✭ 16 (-83.16%)
Mutual labels:  bpmn
camunda-helm
Camunda public Kubernetes Helm repo and charts
Stars: ✭ 33 (-65.26%)
Mutual labels:  camunda-bpm

Camunda REST API client for golang

Go Report Card codecov Go Reference Release

Installation

go get github.com/citilinkru/camunda-client-go/v3

Usage

Create client:

client := camunda_client_go.NewClient(camunda_client_go.ClientOptions{
	EndpointUrl: "http://localhost:8080/engine-rest",
    ApiUser: "demo",
    ApiPassword: "demo",
    Timeout: time.Second * 10,
})

Create deployment:

file, err := os.Open("demo.bpmn")
if err != nil {
    fmt.Printf("Error read file: %s\n", err)
    return
}
result, err := client.Deployment.Create(camunda_client_go.ReqDeploymentCreate{
    DeploymentName: "DemoProcess",
    Resources: map[string]interface{}{
        "demo.bpmn": file,
    },
})
if err != nil {
    fmt.Printf("Error deploy process: %s\n", err)
    return
}

fmt.Printf("Result: %#+v\n", result)

Start instance:

processKey := "demo-process"
result, err := client.ProcessDefinition.StartInstance(
	camunda_client_go.QueryProcessDefinitionBy{Key: &processKey},
	camunda_client_go.ReqStartInstance{},
)
if err != nil {
    fmt.Printf("Error start process: %s\n", err)
    return
}

fmt.Printf("Result: %#+v\n", result)

More examples

Examples documentation

Usage for External task

Create external task processor:

logger := func(err error) {
	fmt.Println(err.Error())
}
asyncResponseTimeout := 5000
proc := processor.NewProcessor(client, &processor.Options{
    WorkerId: "demo-worker",
    LockDuration: time.Second * 5,
    MaxTasks: 10,
    MaxParallelTaskPerHandler: 100,
    AsyncResponseTimeout: &asyncResponseTimeout,
}, logger)

Add and subscribe external task handler:

proc.AddHandler(
    []*camunda_client_go.QueryFetchAndLockTopic{
        {TopicName: "HelloWorldSetter"},
    },
    func(ctx *processor.Context) error {
        fmt.Printf("Running task %s. WorkerId: %s. TopicName: %s\n", ctx.Task.Id, ctx.Task.WorkerId, ctx.Task.TopicName)

        err := ctx.Complete(processor.QueryComplete{
            Variables: &map[string]camunda_client_go.Variable {
                "result": {Value: "Hello world!", Type: "string"},
            },
        })
        if err != nil {
            fmt.Printf("Error set complete task %s: %s\n", ctx.Task.Id, err)
            
            return ctx.HandleFailure(processor.QueryHandleFailure{
                ErrorMessage: &errTxt,
                Retries: &retries,
                RetryTimeout: &retryTimeout,
            })
        }
        
        fmt.Printf("Task %s completed\n", ctx.Task.Id)
        return nil
    },
)

Features

  • Support api version 7.11
  • Full support API External Task
  • Full support API Process Definition
  • Full support API Process Instance
  • Full support API Deployment
  • Partial support API History
  • Partial support API Tenant
  • Without external dependencies

Road map

  • Full coverage by tests
  • Full support references api

Testing

Unit-tests:

go test -v -race ./...

Run linter:

docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.45.2 golangci-lint run -v

Integration tests:

docker run --rm --name camunda -p 8080:8080 camunda/camunda-bpm-platform
go test -tags=integration -failfast ./...

Examples:

Go to examples directory and follow the instructions to run the examples.

CONTRIBUTE

  • write code
  • run go fmt ./...
  • run all linters and tests (see above)
  • run all examples (see above)
  • create a PR describing the changes

LICENSE

MIT

AUTHOR

Konstantin Osipov [email protected]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].