paed01/bpmn-engine

Dependencies in "Persist state on events" example

Closed this issue · 1 comments

Hi. In the Persist state on events example (Link), there are two local modules loaded:

const {getSourceSync, getAllowedServices, getExtensions} = require('./utils');
const {publish} = require('./dbbroker');

are those files available somewhere? I couldn't find them.

also, is it possible to get the sample bpmn model loaded in getSourceSync('./mother-of-all.bpmn')?

It's a mocked example that I have to rewrite some day. Especially the anti-pattern use of a file named utils...

Nevertheless, here it comes:

const fs = require('fs');

module.exports = {
  getSourceSync,
  getAllowedServices,
  getExtensions,
};

function getSourceSync(file) {
  return fs.readFileSync(file);
}

function getAllowedServices() {
  return {
    myServiceFn(executionMessage,  callback) {
      // do something servicewise
      callback(null, {myResult: 1});
    },
  };
}

function getExtensions() {
  return {};
}

All models used during testing are available here