e2ebridge / bpmn

BPMN 2.0 execution engine
467 stars 138 forks source link

False detection of several processes #22

Open chevdor opened 9 years ago

chevdor commented 9 years ago

Hello,

Running a trivial sample, I get the following message:

$ node myprocess.js
[Error: The BPMN file '/.../myprocess.bpmn'. contains more than one process definition. Use 'createCollaboratingProcesses' instead of 'createProcess']
/..../myprocess.js:6
    myprocess.triggerEvent("MyStart");

However, the process definition contains a single process. myprocess.bpmn | uploaded via ZenHub

priojk commented 8 years ago

Did you also provide the associated myprocess.js file? If not, this seems to be a duplicate of #20.

chevdor commented 8 years ago

Yes I did. Both myprocess.js and myprocess.bpmn are in the same folder.

The content is:

var bpmn = require("bpmn");
// We assume there is a myProcess.js besides myProcess.bpmn that contains the handlers
bpmn.createUnmanagedProcess("/Volumes/some-path/bpmn-test/myprocess.bpmn", function(err, myprocess){
    if(err) console.log(err);
    // we start the process
    myprocess.triggerEvent("MyStart");

});

exports.MyStart = function(data, done) {
    // called after the start event arrived at MyStart
    done(data);
};

exports.MyTask = function(data, done) {
    // called at the beginning of MyTask
    done(data);
};

exports.MyTaskDone = function(data, done) {
    // Called after the process has been notified that the task has been finished
    // by invoking myProcess.taskDone("MyTask").
    // Note: <task name> + "Done" handler are only called for 
    // user tasks, manual task, and unspecified tasks
    done(data);
};

exports.MyEnd = function(data, done) {
    // Called after MyEnd has been reached
    done(data);
};