From 2a858a8500a2be5daeb1d999917f45e55431d284 Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Mon, 3 Oct 2022 17:58:12 +0200 Subject: [PATCH 1/3] docs: improve API and README README: explain how to start API: fix types in the function documentation --- README.md | 14 ++++++++++++++ src/index.js | 16 ++++++++-------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index f9836dd..5587c50 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ +# bpmn-visualization 'getting started' tutorial + A getting started demo that uses bpmn-visualization library to visualize runtime monitoring data. +## Content + The following visualization is used: **Overlays on activities:** @@ -48,3 +52,13 @@ means that there are currently running instances. **Edges width** shows the frequency of visit according to a predefined frequency indicator of incoming instances per month + +## How to Run + +Run +```bash +npm install +npm start +``` + +Open the URL mentioned in the console diff --git a/src/index.js b/src/index.js index 2f97bea..65c3334 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,6 @@ import { BpmnVisualization, ShapeUtil, FlowKind } from "bpmn-visualization"; -// BPMN diagram content conveniently retrieved with parcel (as string) +// BPMN diagram content conveniently retrieved with Vite (as string) // for other load methods, see https://github.com/process-analytics/bpmn-visualization-examples import diagram from "./diagram.bpmn?raw"; import "./styles.css"; @@ -15,7 +15,7 @@ const footer = document.querySelector("footer"); const version = bpmnVisualization.getVersion(); footer.innerText = `bpmn-visualization@${version.lib}`; -//load and filter a pool +// load and filter a pool bpmnVisualization.load(diagram, { fit: { type: "Center" }, modelFilter: { @@ -28,13 +28,13 @@ bpmnVisualization.load(diagram, { } }); -//add CSS classes to show running instances +// add CSS classes to show running instances let activitiesMonitoringData = getActivitiesMonitoringData(); let edgesWaitingInstances = getEdgesWaitingInstances(); // Add Overlay on activities activitiesMonitoringData.forEach((value, key) => { - //running on time + // running on time if (value[0] !== 0) { bpmnVisualization.bpmnElementsRegistry.addOverlays(key, { position: "top-center", @@ -46,7 +46,7 @@ activitiesMonitoringData.forEach((value, key) => { } }); } - //running late with risky level + // running late with risky level if (value[1] !== 0) { bpmnVisualization.bpmnElementsRegistry.addOverlays(key, { position: "top-left", @@ -58,7 +58,7 @@ activitiesMonitoringData.forEach((value, key) => { } }); } - //running late with critical level + // running late with critical level if (value[2] !== 0) { bpmnVisualization.bpmnElementsRegistry.addOverlays(key, { position: "top-right", @@ -102,7 +102,7 @@ edgesWaitingInstances.forEach((value, key) => { }); /** - * @param {Map} activitiesMonitoringData + * @returns {Map>} key: BPMN element id / value: monitoring data */ function getActivitiesMonitoringData() { let activitiesMonitoringData = new Map(); @@ -115,7 +115,7 @@ function getActivitiesMonitoringData() { } /** - * @param {Map} edgesWaitingInstances + * @returns {Map} key: BPMN element id / value: number of instances */ function getEdgesWaitingInstances() { let edgesWaitingInstances = new Map(); From aefd6685a61d62585ea16cc9033b483e08eacb7e Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Mon, 3 Oct 2022 18:09:06 +0200 Subject: [PATCH 2/3] Add intellij config file to gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b512c09..eb79dd5 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -node_modules \ No newline at end of file +node_modules +.idea From f38ab5d63cd496ecaaaa977f83f782a1495a8b2a Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Mon, 3 Oct 2022 18:15:53 +0200 Subject: [PATCH 3/3] fix comment --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 65c3334..1422cfb 100644 --- a/src/index.js +++ b/src/index.js @@ -21,7 +21,7 @@ bpmnVisualization.load(diagram, { modelFilter: { pools: [ { - // id of the Participant related to the Pool to display + // name of the Participant related to the Pool to display name: "Process Engine - Invoice Receipt" } ]