paed01 / bpmn-engine

BPMN 2.0 execution engine. Open source javascript workflow engine.
MIT License
893 stars 168 forks source link

How can i make it work? #134

Closed solas98 closed 3 years ago

solas98 commented 3 years ago

How can i connect the API to my project and execute BPMN diagrmas?

paed01 commented 3 years ago

Since this project is just an engine, meaning you have to add it to a “car”, it has no proper REST-api. Have a look at the examples to get started.

solas98 commented 3 years ago

In source = ... we add the bpmn diagram?? And the rest code is the Tasks? (new to programming).

solas98 commented 3 years ago

Since this project is just an engine, meaning you have to add it to a “car”, it has no proper REST-api. Have a look at the examples to get started.

I have to execute bpmn diagrams somehow like web app, can this library make it happen?

paed01 commented 3 years ago

Off course! We at Onify use it in an express/hapi-app.

You are on track:

const {promises: fs} = require('fs');
const source = await fs.readFile('./path/to/diagram.bpmn');
solas98 commented 3 years ago

Ok it gets me an error ('fs.readFileSync is not a function at Object.90.bpmn-engine'). I have an other question. Lets say i build a diagram in Camunda with different tasks(user task,gateway,etc.). For each task i have to write different code to execute like in examples right?

solas98 commented 3 years ago

How can i simpifie the xml output like yours in the examples. In camunda the xml output is very confusing compare to yours.

paed01 commented 3 years ago

No explicit coding should be required for each task. The process should run to an end if you have designed it correctly.

I have simplified the XML by starting to remove stuff until bpmn-moddle starts complaining. For instance bpmndi:BPMNDiagram elements are related to the display of the diagram and are not required for the execution - delete.

IMHO testing is the key for a successful solution.

paed01 commented 3 years ago

Any progress?

solas98 commented 3 years ago

Yeah all good. Thank you !

Στις Παρ, 23 Απρ 2021 στις 8:59 πμ ο χρήστης Pål Edman < @.***> έγραψε:

Any progress?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/paed01/bpmn-engine/issues/134#issuecomment-825408725, or unsubscribe https://github.com/notifications/unsubscribe-auth/AH4B52RU2LSY3QNRFMSUJGTTKEEFLANCNFSM42M6FLVA .

paed01 commented 3 years ago

So good that you can close this issue?