nitram509 / lib-bpmn-engine

A BPMN engine, meant to be embedded in Go applications with minimal hurdles, and a pleasant developer experience using it. This approach can increase transparency for non-developers.
https://nitram509.github.io/lib-bpmn-engine/
MIT License
274 stars 70 forks source link

bpmnEngine.NewTaskHandler undefined #61

Closed kstan79 closed 1 year ago

kstan79 commented 1 year ago

Im trying this library follow guide https://nitram509.github.io/lib-bpmn-engine/getting-started, it gave:

./main.go:18:13: bpmnEngine.NewTaskHandler undefined (type bpmn_engine.BpmnEngineState has no field or method NewTaskHandler)
kstan79 commented 1 year ago

I'm solve using alternative method, which proposed by vscode autocomplete:

//define service task id = "hello-world"
bpmnEngine.AddTaskHandler("hello-world", printContextHandler)

You may update the documentation?

nitram509 commented 1 year ago

Hi @kstan79 ,

I just cross-checked this example code. https://github.com/nitram509/lib-bpmn-engine/blob/effe15b555fa1edabc8dd196f8ecdf1010ea83cb/docs/examples/pause_user_tasks/pause_user_tasks.go#L10

Using v.0.3.0-beta1 of the library does work fine.

Your snippet bpmnEngine.AddTaskHandler("hello-world", printContextHandler) indicates a very old version.

What version you're using?

kstan79 commented 1 year ago

im checkout latest master version.

nitram509 commented 1 year ago

im checkout latest master version.

That's strange. The NewTaskHandler().Assignee()... function in main branch is looking as shown in the previous comment. I wonder how your code AddTaskHandler("hello-world", printContextHandler) can even compile without error?

There must be some difference. What do we oversee?

kstan79 commented 1 year ago

oh, i know the reason. most probably i'm create new go project with direct import remote package. no check out source code

eriknyk commented 1 year ago

@kstan79 for latest 0.3.0-beta2

go get github.com/nitram509/lib-bpmn-engine/pkg/bpmn_engine@v0.3.0-beta2

Should enough!