-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.html
46 lines (33 loc) · 1.48 KB
/
test.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
</head>
<body>
<!-- Dependencies -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/x2js/1.1.3/xml2json.min.js" integrity="sha512-xl6hrpp8+qe3CwgDhhcLAMSMC/8To5kwYDgLUcA95R9xcbxiTChpd1Egu24Xk5axY1Del9opQg8S9WyEYSGNZg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<!-- Lib -->
<script src="qualibpmn.js"></script>
<!-- Test -->
<script>
const url = 'https://raw.githubusercontent.com/freebpmnquality/freebpmnquality.github.io/refs/heads/master/samples/01-tasks.bpmn';
// Fetch BPMN
const bpmn = QualiBPMNUtil.getBPMNByURL(url);
// Convert to JSON
const json = QualiBPMNUtil.translateBPMNToJSON(bpmn);
// Extract processes
const processes = QualiBPMNUtil.getProcesses(json);
for (const process in processes) {
// Get flat process elements data
const flat = QualiBPMNUtil.getFlatProcessElements(processes[process]);
// Evaluate process elements
const evaluated = QualiBPMNUtil.evaluateProcess(flat);
console.log(evaluated);
// Measure process quality
const measured = QualiBPMNUtil.measureSyntacticQuality(evaluated);
console.log(measured);
}
</script>
</body>
</html>