forked from camunda/camunda-bpmn.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo-process.html
54 lines (42 loc) · 1.61 KB
/
demo-process.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
47
48
49
50
51
52
53
54
<html>
<head>
</head>
<body>
<div id="trace">
</div>
<script src="lib/require/require.min.js"></script>
<script src="build/engine.min.js"></script>
<script src="lib/jquery/jquery-1.7.2.min.js"></script>
<script type="text/javascript">
require([ "jquery", "bpmn/Engine" ], function ($, Engine) {
var processXml = '<?xml version="1.0" encoding="UTF-8"?>' +
'<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" '+
'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">'+
'<process id="theProcess" isExecutable="true">' +
'<startEvent id="theStart" />'+
'<userTask id="task" />'+
'<endEvent id="end" />'+
'<sequenceFlow id="flow1" sourceRef="theStart" targetRef="task" />'+
'<sequenceFlow id="flow2" sourceRef="task" targetRef="end" />'+
'</process>'+
'</definitions>';
var trace = $("#trace");
trace.html("Starting Process ..." + processXml);
var instance = Engine.startInstance(processXml, {}, [{
id : "task",
"start" : function (execution) {
console.log(execution);
trace.append("<br/> start " + execution.activityDefinition.id);
}
}, {
id : "end",
"end" : function (execution) {
console.log(execution);
trace.append("<br/> after " + execution.activityDefinition.id);
}
}]);
instance.signal("task");
});
</script>
</body>
</html>