e2ebridge / bpmn

BPMN 2.0 execution engine
466 stars 138 forks source link

Having to provide the full path for the bpmn file is ugly #24

Open chevdor opened 9 years ago

chevdor commented 9 years ago
bpmn.createUnmanagedProcess("/why/would/we/need/this/full/path/task.bpmn", function(err, task){
    task.triggerEvent("MyStart");
});

If only a filename is provided, cannot we use the called entry point script location as root?

soulmate2015 commented 8 years ago

You can use modules "path" like this:

var bpmn = require('bpmn');
var path = require('path');
bpmn.createUnmanagedProcess(path.join(__dirname, '../bpmn/myProcess.bpmn'), function (err, myProcess) {
    myProcess.triggerEvent("MyStart");
});

Provide a absolutely path in the current working directory.

Taivas commented 7 years ago

Try path.resolve, that's cooler anyway.