https://github.com/nikku/bpmn-js-cli-modeling-dsl
A modeling DSL for bpmn-js
https://github.com/nikku/bpmn-js-cli-modeling-dsl
Last synced: 12 months ago
JSON representation
A modeling DSL for bpmn-js
- Host: GitHub
- URL: https://github.com/nikku/bpmn-js-cli-modeling-dsl
- Owner: nikku
- License: mit
- Created: 2014-08-04T07:14:19.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2021-09-15T12:22:25.000Z (almost 5 years ago)
- Last Synced: 2025-04-11T11:15:00.260Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 94.7 KB
- Stars: 23
- Watchers: 6
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
> As of version `1.0.0` this library exposes [ES modules](http://exploringjs.com/es6/ch_modules.html#sec_basics-of-es6-modules). Use an ES module aware bundler such as [Webpack](https://webpack.js.org) or [Rollup](https://rollupjs.org) to bundle it for the browser.
# bpmn-js-cli-modeling-dsl
[](https://github.com/nikku/bpmn-js-cli-modeling-dsl/actions/workflows/CI.yml)
A modeling DSL (domain specific language) for [bpmn-js](https://github.com/bpmn-io/bpmn-js), built on top of [bpmn-js-cli](https://github.com/bpmn-io/bpmn-js-cli).
## Usage
Use the extension for [bpmn-js-cli](https://github.com/bpmn-io/bpmn-js-cli) to quickly model simple processes.
To model this process:

simply execute the following command
```javascript
cli.model('StartEvent_1 -> and -> service -> user -> icatch -> xor -> or -> ithrow -> end');
```
You may use the full classified name of any BPMN element such as `bpmn:ServiceTask`, too to model it.
### Shortcuts
A number of aliases are registered for most commonly modeled BPMN elements:
```javascript
var aliases = {
service: 'bpmn:ServiceTask',
user: 'bpmn:UserTask',
manual: 'bpmn:ManualTask',
task: 'bpmn:Task',
end: 'bpmn:EndEvent',
transaction: 'bpmn:Transaction',
sub: 'bpmn:SubProcess',
call: 'bpmn:CallActivity',
icatch: 'bpmn:IntermediateCatchEvent',
ithrow: 'bpmn:IntermediateThrowEvent',
xor: 'bpmn:ExclusiveGateway',
or: 'bpmn:InclusiveGateway',
and: 'bpmn:ParallelGateway'
};
```
Use any of the aliases instead of the full qualified BPMN name.
## Setup
Deploy the cli-extension with [bpmn-js](https://github.com/bpmn-io/bpmn-js):
```javascript
import BpmnModeler from 'bpmn-js/lib/Modeler';
import ModelingDslModule from 'bpmn-js-cli-modeling-dsl';
var modeler = new BpmnModeler({
additionalModules: [
ModelingDslModule
],
cli: {
bindTo: 'cli'
}
});
modeler.importXML('some-bpmn-xml');
```
Access the cli as `cli` in your developer console (open via `F12` in most browsers).
Create a simple process from `` via
```javascript
cli.model(' -> and -> service -> user -> icatch -> xor -> or -> ithrow -> end');
```
## License
MIT