Skip to content

Commit 6af4de2

Browse files
committed
Added proper visualization of the Declare model
1 parent b951e45 commit 6af4de2

2 files changed

Lines changed: 23 additions & 23 deletions

File tree

src/components/ProcessVisualizer.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
<v-icon class="mr-2" icon="mdi-download" />
3131
Download .decl
3232
</v-btn>
33-
<!-- <pre class="flex-grow-1 img-container mt-3" v-html="declare_img"></pre> -->
3433
<div id="declareContainer" class="flex-fill"></div>
3534
</v-container>
3635
</v-tabs-window-item>
@@ -96,7 +95,7 @@ export default {
9695
});
9796
9897
// render declare
99-
this.declare_img = this.declare;
98+
// this.declare_img = this.declare;
10099
},
101100
handleDownloadFile(type) {
102101
let model = "";
@@ -127,7 +126,7 @@ export default {
127126
onTabChange() {
128127
if (this.tab === 'declare') {
129128
setTimeout(() => {
130-
let declare = new DeclareContainer(this.declare_js);
129+
new DeclareContainer(this.declare_js);
131130
}, 100);
132131
}
133132
}

src/libs/declare-js/main.js

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { handleFileUpload } from "./interactivity/importMenu.js";
2626

2727
export class DeclareContainer {
2828

29-
constructor() {
29+
constructor(str) {
3030

3131
this.enableEdit = true;
3232
this.snapToGrid = true;
@@ -35,6 +35,7 @@ export class DeclareContainer {
3535
this.canvas;
3636
this.view;
3737
this.zoomLevel = 1;
38+
this.str = str;
3839

3940
this.mode;
4041
this.editor;
@@ -153,25 +154,25 @@ export class DeclareContainer {
153154
// generation of random model (activities, existence constraints, relation constraints)
154155
//const constraintStrings = this.declareModel.generateRandomModel(10, 5, 15);
155156

156-
const str = `
157-
End('hand over car')
158-
AtLeastOne('verify problem')
159-
ExactlyOne('hand over car')
160-
Init('get customer report')
161-
ChainResponse('get customer report','verify problem')
162-
Precedence('verify problem','ask customer for clarification')
163-
AlternateResponse('ask customer for clarification','verify problem')
164-
Succession('verify problem','repair car')
165-
Response('order spare parts','repair car')
166-
ChainSuccession('repair car','check repair')
167-
ChainSuccession('check repair','notify customer')
168-
ChainSuccession('notify customer','hand over car')
169-
NotResponse('repair car','ask customer for clarification')
170-
NotResponse('notify customer','repair car')
171-
NotResponse('hand over car','repair car')
172-
`;
173-
174-
const constraintStrings = str.split(/\r?\n/);
157+
// const str = `
158+
// End('hand over car')
159+
// AtLeastOne('verify problem')
160+
// ExactlyOne('hand over car')
161+
// Init('get customer report')
162+
// ChainResponse('get customer report','verify problem')
163+
// Precedence('verify problem','ask customer for clarification')
164+
// AlternateResponse('ask customer for clarification','verify problem')
165+
// Succession('verify problem','repair car')
166+
// Response('order spare parts','repair car')
167+
// ChainSuccession('repair car','check repair')
168+
// ChainSuccession('check repair','notify customer')
169+
// ChainSuccession('notify customer','hand over car')
170+
// NotResponse('repair car','ask customer for clarification')
171+
// NotResponse('notify customer','repair car')
172+
// NotResponse('hand over car','repair car')
173+
// `;
174+
175+
const constraintStrings = this.str.split(/\r?\n/);
175176

176177
console.log(constraintStrings);
177178

0 commit comments

Comments
 (0)