a collection of tools to work with BPMN
Project description
BPMN Tools
a collection of tools to work with BPMN
Installation
% pip install bpmn-tools
See it in Action
>>> import xmltodict
>>> from bpmn_tools.flow import Process, Start, End, Task, Flow
>>> from bpmn_tools.collaboration import Collaboration, Participant
>>> from bpmn_tools.notation import Definitions
>>> from bpmn_tools.diagrams import Diagram, Plane, Shape, Edge
>>> from bpmn_tools.layout import simple
>>> activities = [
... Start(id="start"),
... Task('Say "Hello!"', id="hello"),
... Task('Wait for response...', id="wait"),
... End(id="end")
... ]
>>> process = Process(id="process").extend(activities).extend([
... Flow(source=activities[0], target=activities[1]),
... Flow(source=activities[1], target=activities[2]),
... Flow(source=activities[2], target=activities[3])
... ])
>>> collaboration = Collaboration(id="collaboration").append(
... Participant("lane", process, id="participant")
... )
>>> model = Definitions(id="definitions").extend([
... process,
... collaboration,
... ])
>>> model.append(
... Diagram(
... id="diagram",
... plane=Plane(id="plane", element=collaboration)
... )
... )
Definitions({'id': 'definitions', 'xmlns:bpmn': 'http://www.omg.org/spec/BPMN/20100524/MODEL', 'xmlns:bpmndi': 'http://www.omg.org/spec/BPMN/20100524/DI', 'xmlns:dc': 'http://www.omg.org/spec/DD/20100524/DC', 'xmlns:di': 'http://www.omg.org/spec/DD/20100524/DI'})
>>> simple.layout(model)
>>> xml = xmltodict.unparse(model.as_dict(with_tag=True), pretty=True)
>>> with open("hello.bpmn", "w") as fp:
... fp.write(xml)
...
2937
Use bpmn-to-image to visualize the generated XML, because "what (sane) human being wants to read XML?" 😉
% npm install -g bpmn-to-image
% bpmn-to-image hello.bpmn:hello.png
Et voila...
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bpmn-tools-0.5.0.tar.gz
(22.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bpmn-tools-0.5.0.tar.gz.
File metadata
- Download URL: bpmn-tools-0.5.0.tar.gz
- Upload date:
- Size: 22.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d1c9b66c8e1f624ec52128695a02b689b27fb5e33bc61485d0a498e301145f9
|
|
| MD5 |
374a3d8bdc0462bba7f0c44da89c90d3
|
|
| BLAKE2b-256 |
a0965cbd0d0a8a7ebbf407dca63006a71fe83725fb7a52b4c774dbc67b36ed96
|
File details
Details for the file bpmn_tools-0.5.0-py3-none-any.whl.
File metadata
- Download URL: bpmn_tools-0.5.0-py3-none-any.whl
- Upload date:
- Size: 28.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
604710fbfcfe3eb0e830cedac2701f59afc05b33d3065c769b8b86a15676084a
|
|
| MD5 |
8d8b860f01aae33151622eb0c9d6c359
|
|
| BLAKE2b-256 |
ed2425ad021026cc977a056798bb7cbafa80e2466000cf3c9ec13af58e981f04
|