e2ebridge / bpmn

BPMN 2.0 execution engine
466 stars 138 forks source link

createUnmanagedProcess tries to load the .js from folder releative from handler.js in Node_Modules #41

Open Geraldf opened 7 years ago

Geraldf commented 7 years ago

When I try to load a process wiht

var path = require("path");
bpmn.createUnmanagedProcess("./plan/myDiag.bpmn", function (err, myProcess) {
    // we start the process
    myProcess.triggerEvent("MyStart");
});

the handler.js file tries to load the associated .js file (myDiag.js) from the location the handler.js file is located. in my example the handler.js file is ...../node_modules/bpmn/lib/handler.js, which is not the same folder in which my myDiag.bpmn file is located.

cyrilschmitt commented 7 years ago

Hello Geraldf,

You need to give a fullpath instead of a relative one and it should work.