Giter VIP home page Giter VIP logo

Comments (3)

nitram509 avatar nitram509 commented on May 28, 2024

@kstan79

Since user tasks are asynchronous by nature, the lib-bpmn-engine is designed to pause a workflow and continue later.

In the example, Line 11

instance, _ := bpmnEngine.CreateAndRunInstance(process.ProcessKey, nil)

This is where your workflow is started in the engine until the point, where the user task happens,
then the handler is called.
Since the handler notifies the user for action (Line 21) it then just returns, so then engine will pause the workflow and return the control to your application, in Line 12.
Now, your application must somehow get the input from the user and then "continue" the workflow instance, as shown in Line 13.
Since the user task was paused, the same task handler will be called and now the handler knows, that the desired user input is present and can finally call job.Complete() to signal the engine to continue the workflow.

Typically, you need to store the user input in some database or similar.
In the example you see if externalEvent == "user is done" { - this must be your logic, which baybe fetches user input from a database or similar - OR the user input comes in via API-Request ... completely up to your design and needs.

Does this make more sense to you?

from lib-bpmn-engine.

kstan79 avatar kstan79 commented on May 28, 2024

ok. seems i need to build a full structure with database in order to continue evaluate. Will update again afterwards.

from lib-bpmn-engine.

nitram509 avatar nitram509 commented on May 28, 2024

OK, thank you for the feedback.
Please, keep in mind the feature of loading/storing BPMN state from/into a database is still on the roadmap:
https://github.com/nitram509/lib-bpmn-engine/milestone/3

I consider this question answered.
If you have further questions, don't hesitate to create new issues/questions :)

from lib-bpmn-engine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.