-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmapa.xml
More file actions
194 lines (187 loc) · 3.92 KB
/
mapa.xml
File metadata and controls
194 lines (187 loc) · 3.92 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<?xml version="1.0" encoding="UTF-8"?>
<document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://modeler.netgrif.com/petriflow_schema.xsd">
<!-- ROLES -->
<role>
<id>player</id>
<name>hrac</name>
</role>
<role>
<id>game</id>
<name>hra</name>
</role>
<!-- DATA -->
<data type="text">
<id>playerId</id>
<title></title>
</data>
<data type="text">
<id>dungeonId</id>
<title></title>
</data>
<!-- TRANSITIONS -->
<transition>
<id>2</id>
<x>256</x>
<y>259</y>
<label>Constructor [Game]</label>
<roleRef>
<id>game</id>
<logic>
<perform>true</perform>
</logic>
</roleRef>
<dataGroup>
<id>1</id>
<dataRef>
<id>playerId</id>
<logic>
<behavior>editable</behavior>
</logic>
</dataRef>
</dataGroup>
</transition>
<transition>
<id>6</id>
<x>524</x>
<y>409</y>
<label>Ist do lesa</label>
<assignPolicy>auto</assignPolicy>
<roleRef>
<id>player</id>
<logic>
<perform>true</perform>
</logic>
</roleRef>
<dataGroup>
<id>1</id>
<dataRef>
<id>playerId</id>
<logic>
<behavior>forbidden</behavior>
</logic>
</dataRef>
<dataRef>
<id>dungeonId</id>
<logic>
<behavior>forbidden</behavior>
</logic>
</dataRef>
</dataGroup>
<event type="finish">
<id>1</id>
<actions phase="pre">
<!-- vytvorim les a zaznamenam v nom svoje ID -->
<!-- tieto funkcie vykonaju zmeny v DB -->
<action>
dID : f.dungeonId;
// xkovarj3@is.stuba.sk--
def forestC = createCase("xkovarj3@is.stuba.sk--Forest", "Forest", "green");
change dID value {
return forestC.getStringId();
}
</action>
<!-- tieto funkcie robia queries na DB a musime ich vykonat az potom ako sa do DB zmeny ulozia -->
<!-- premenna 'useCase' existuje defaultne a je v nej ulozeny "this" case -->
<action>
dID : f.dungeonId,
pID : f.playerId;
def forestC = findCase({it._id.eq(new org.bson.types.ObjectId(dID.value))});
// .defaultValue lebo support pre lokalizovane texty
def forestTask = findTask({it.title.defaultValue.eq("Constructor [Game]").and(it.caseId.eq(dID.value))});
forestTask = assignTask(forestTask);
setData(forestTask, [
"playerId": [
"value" : pID.value,
"type" : "text"
],
"mapId": [
"value" : useCase.getStringId(),
"type" : "text"
]
]);
finishTask(forestTask);
</action>
</actions>
</event>
</transition>
<transition>
<id>7</id>
<x>524</x>
<y>320</y>
<label>Return to town [Game]</label>
<roleRef>
<id>game</id>
<logic>
<perform>true</perform>
</logic>
</roleRef>
</transition>
<!-- PLACES -->
<place>
<id>1</id>
<x>131</x>
<y>257</y>
<label></label>
<tokens>1</tokens>
<static>false</static>
</place>
<place>
<id>4</id>
<x>420</x>
<y>263</y>
<label></label>
<tokens>0</tokens>
<static>false</static>
</place>
<place>
<id>10</id>
<x>623</x>
<y>375</y>
<label></label>
<tokens>0</tokens>
<static>false</static>
</place>
<!-- ARCS -->
<arc>
<id>3</id>
<type>regular</type>
<sourceId>1</sourceId>
<destinationId>2</destinationId>
<multiplicity>1</multiplicity>
</arc>
<arc>
<id>5</id>
<type>regular</type>
<sourceId>2</sourceId>
<destinationId>4</destinationId>
<multiplicity>1</multiplicity>
</arc>
<arc>
<id>8</id>
<type>regular</type>
<sourceId>4</sourceId>
<destinationId>6</destinationId>
<multiplicity>1</multiplicity>
</arc>
<arc>
<id>9</id>
<type>regular</type>
<sourceId>7</sourceId>
<destinationId>4</destinationId>
<multiplicity>1</multiplicity>
</arc>
<arc>
<id>11</id>
<type>regular</type>
<sourceId>6</sourceId>
<destinationId>10</destinationId>
<multiplicity>1</multiplicity>
</arc>
<arc>
<id>12</id>
<type>regular</type>
<sourceId>10</sourceId>
<destinationId>7</destinationId>
<multiplicity>1</multiplicity>
</arc>
</document>