File tree 1 file changed +10
-0
lines changed
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -285,6 +285,7 @@ func (r *run) Context(env envs.Environment) map[string]types.XValue {
285
285
// returns the context representation of the current node
286
286
//
287
287
// uuid:text -> the UUID of the node
288
+ // categories:array -> the category names of the node
288
289
// visit_count:number -> the count of visits to the node in this run
289
290
//
290
291
// @context node
@@ -297,8 +298,17 @@ func (r *run) nodeContext(env envs.Environment) map[string]types.XValue {
297
298
}
298
299
}
299
300
301
+ var categories []types.XValue
302
+ if node .Router () != nil {
303
+ categories = make ([]types.XValue , len (node .Router ().Categories ()))
304
+ for i , c := range node .Router ().Categories () {
305
+ categories [i ] = types .NewXText (c .Name ())
306
+ }
307
+ }
308
+
300
309
return map [string ]types.XValue {
301
310
"uuid" : types .NewXText (string (node .UUID ())),
311
+ "categories" : types .NewXArray (categories ... ),
302
312
"visit_count" : types .NewXNumberFromInt (visitCount ),
303
313
}
304
314
}
You can’t perform that action at this time.
0 commit comments