@@ -38,6 +38,8 @@ class Parameters(Enum):
38
38
ANNOTATION = "annotation"
39
39
ACT_METRIC = "act_metric"
40
40
EDGE_METRIC = "edge_metric"
41
+ ACT_THRESHOLD = "act_threshold"
42
+ EDGE_THRESHOLD = "edge_threshold"
41
43
42
44
43
45
def wrap_text (text : str , max_length : int = 15 ) -> str :
@@ -135,6 +137,12 @@ def apply(
135
137
annotation = exec_utils .get_param_value (
136
138
Parameters .ANNOTATION , parameters , "frequency"
137
139
)
140
+ act_threshold = exec_utils .get_param_value (
141
+ Parameters .ACT_THRESHOLD , parameters , 0
142
+ )
143
+ edge_threshold = exec_utils .get_param_value (
144
+ Parameters .EDGE_THRESHOLD , parameters , 0
145
+ )
138
146
139
147
pref_act = (
140
148
" E="
@@ -148,11 +156,14 @@ def apply(
148
156
)
149
157
150
158
data = {"objectTypes" : [], "overallActivityStats" : {}}
159
+ added_activities = set ()
151
160
152
161
for act , ent in ocdfg ["activities_indep" ][act_key ].items ():
153
- data ["overallActivityStats" ][wrap_text (act )] = {
154
- "totalFrequency" : pref_act + str (len (ent ))
155
- }
162
+ if len (ent ) >= act_threshold :
163
+ data ["overallActivityStats" ][wrap_text (act )] = {
164
+ "totalFrequency" : pref_act + str (len (ent ))
165
+ }
166
+ added_activities .add (act )
156
167
157
168
counter = 0
158
169
@@ -163,9 +174,10 @@ def apply(
163
174
list_item ["headerLabel" ] = wrap_text (ot )
164
175
list_item ["activities" ] = []
165
176
for act , ent in content .items ():
166
- list_item ["activities" ].append (
167
- {"name" : wrap_text (act ), "frequency" : pref_act + str (len (ent ))}
168
- )
177
+ if act in added_activities :
178
+ list_item ["activities" ].append (
179
+ {"name" : wrap_text (act ), "frequency" : pref_act + str (len (ent ))}
180
+ )
169
181
170
182
content2 = ocdfg ["edges" ][edge_key ][ot ]
171
183
content3 = ocdfg ["edges_performance" ][edge_key ][ot ]
@@ -185,34 +197,41 @@ def apply(
185
197
perf = sum (perf )
186
198
else :
187
199
perf = mean (perf )
188
- list_edges .append (
189
- {
190
- "source" : wrap_text (tup [0 ]),
191
- "target" : wrap_text (tup [1 ]),
192
- "frequency" : pref_edge + str (len (ent )),
193
- "performance" : vis_utils .human_readable_stat (perf ),
194
- }
195
- )
200
+
201
+ if tup [0 ] in added_activities and tup [1 ] in added_activities :
202
+ if len (ent ) >= edge_threshold :
203
+ list_edges .append (
204
+ {
205
+ "source" : wrap_text (tup [0 ]),
206
+ "target" : wrap_text (tup [1 ]),
207
+ "frequency" : pref_edge + str (len (ent )),
208
+ "performance" : vis_utils .human_readable_stat (perf ),
209
+ }
210
+ )
196
211
197
212
for act , ent in content4 .items ():
198
- list_edges .append (
199
- {
200
- "source" : "Start" ,
201
- "target" : wrap_text (act ),
202
- "frequency" : pref_edge + str (len (ent )),
203
- "performance" : vis_utils .human_readable_stat (0.0 ),
204
- }
205
- )
213
+ if act in added_activities :
214
+ if len (ent ) >= edge_threshold :
215
+ list_edges .append (
216
+ {
217
+ "source" : "Start" ,
218
+ "target" : wrap_text (act ),
219
+ "frequency" : pref_edge + str (len (ent )),
220
+ "performance" : vis_utils .human_readable_stat (0.0 ),
221
+ }
222
+ )
206
223
207
224
for act , ent in content5 .items ():
208
- list_edges .append (
209
- {
210
- "source" : wrap_text (act ),
211
- "target" : "End" ,
212
- "frequency" : pref_edge + str (len (ent )),
213
- "performance" : vis_utils .human_readable_stat (0.0 ),
214
- }
215
- )
225
+ if act in added_activities :
226
+ if len (ent ) >= edge_threshold :
227
+ list_edges .append (
228
+ {
229
+ "source" : wrap_text (act ),
230
+ "target" : "End" ,
231
+ "frequency" : pref_edge + str (len (ent )),
232
+ "performance" : vis_utils .human_readable_stat (0.0 ),
233
+ }
234
+ )
216
235
217
236
list_item ["edges" ] = list_edges
218
237
0 commit comments