Installation#
installation of bpmn-server along with bpmn-web#
git clone https://github.com/bpmnServer/bpmn-web.git
# this will install bpmn-server along with all dependencies
npm install
# this will copy Initial files that are not tracked by .git; .env and appDelegate
npm run setup
# now edit `.env` file, change your mongoDB connection
# after editing .env, run setup again to initialize DB
npm run setup
npm run start
To Update#
installation of bpmn-client#
create a folder or use an existing project
git clone .../bpmn-client-sample
copy sample.env .env
edit .env file
npm install
# To Update
git pull
npm update
Setup bpmn Application with bpmn-server#
Configuration#
Every project must have a configuration file that is an instance of Configuration class
This configuration file is passed to the BPMNServer constructor.
For testing purposes, you can have a different configuration than production in same environemnt by passign a different object.
Environment#
things that vary between dev and production
- timers:
- forceTimersDelay
- precision
- database:
- MongoDB: db_url db
import { Configuration, ModelsDatastore, DataStore, Logger } from './';
import { MyAppDelegate } from './appDelegate';
let definitionsPath = __dirname + '/processes/';
var configuration = new Configuration({
definitionsPath: definitionsPath,
timers: {
forceTimersDelay: 1000,
precision: 3000,
},
database: {
MongoDB: {
db_url: 'mongodb://localhost:27017?retryWrites=true&w=majority',
db: 'bpmn',
},
},
/* Define Server Components */
logger: function (server) {
new Logger(server);
},
definitions: function (server) {
return new ModelsDatastore(server);
},
appDelegate: function (server) {
return new MyAppDelegate(server);
},
dataStore: function (server) {
return new DataStore(server);
},
});
export { configuration };
Example of usage in javascript
const { configuration } = require('../configuration.js');
const server = new BPMNServer(configuration, logger);
or in Typesciprt
import { configuration } from '../configuration.js';
const server = new BPMNServer(configuration, logger);
Processes Folder#
This is where the definition files reside, the demo WebApp contains a set of those file for you to start with.
AppDelegate Class#
This class handles application specific calls
moddleOptions;
servicesProvider; // to respond to all named services
sendEmail(to, msg, body);
executionStarted(execution);
executionEvent({ event, item, execution });
messageThrown(signalId, data, messageMatchingKey: any, item: IItem);
signalThrown(signalId, data, messageMatchingKey: any, item: IItem);
issueMessage(messageId, data);
issueSignal(messageId, data);
serviceCalled(serviceName,data,item: IItem);
scopeEval(scope, script);
scopeJS(scope, script);
ModelDataStore Options#
MongoDB#
This the preferred and default option, models are saved and loaded in MongoDB Additionally, if you define a definitionsPath in configuration.ts, ModelsDatastore will monitor your path for changes, allowing you to edit bpmn files externally.
Remote-Load-Only#
This option can be used for minimal installation by having models at a remote location
BPMN-SERVER components#
Packages#
bpmn-server#
bpmn-server-mongo#
Applications#
App | desc | datastore | modelDatastore |
---|---|---|---|
bpmn-web | Sample Full Demo with Model editor | Mongo | Mongo |
bpmn-browser | Minimal implementation run in browser | Memory | fs |
bpmn-node | Minimal implementation for command line | Mongo | Mongo |
Remote Access | |||
bpmn-client | Node Remote Access ti bpmn-web | ||
bpmn-py | Python Remote Access ti bpmn-web |