-
Notifications
You must be signed in to change notification settings - Fork 12
/
demo.js
78 lines (56 loc) · 1.02 KB
/
demo.js
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/**
* Commands running the demo shown in ./screencast.gif
*/
var cli = window.cli;
cli.elements();
var gateway = cli.append(
'StartEvent_1',
'bpmn:ExclusiveGateway',
'150,0'
);
var serviceTask = cli.append(
gateway,
'bpmn:ServiceTask',
'150,0'
);
var callActivity = cli.append(
gateway,
'bpmn:CallActivity',
'150,90'
);
cli.undo();
callActivity = cli.append(
gateway,
'bpmn:CallActivity',
'150,120'
);
var endEvent = cli.append(
serviceTask,
'bpmn:EndEvent',
'150,0'
);
cli.connect(
callActivity,
endEvent,
'bpmn:SequenceFlow'
);
cli.setLabel(callActivity, 'CallActivity');
var gatewayShape = cli.element(gateway);
var textAnnotation = cli.create(
'bpmn:TextAnnotation',
{
x: gatewayShape.x - 50,
y: gatewayShape.y + 150
},
gatewayShape.parent
);
cli.setLabel(textAnnotation, 'i-am-text');
cli.setLabel(gateway, 'ExclusiveGateway');
cli.move(callActivity, { x: 20, y: 30 });
cli.undo();
cli.undo();
cli.undo();
cli.redo();
cli.redo();
cli.redo();
cli.save('bpmn');