The json would be:
{"activities":[{"id":1}, {"id":2}, {"id":3}], "edges":[{"a1":1, "a2":1}, {"a1":1, "a2":2}, {"a1":1, "a2":3}, {"a1":2, "a2":3}], "start":1}
The problem is that nothing differentiates the two 1s. This leads to various issues:
(@ritterni) The paths [start] 1 => 3 [end] or [start] 1 => 1 => 1 => ... should not be generated
(me & @rphkhr) When editing the graph, if we replace one of the 1s by another activity, say 4, we should know which of the 1s should be conserved/updated to 4 in the json
...?
@rphkhr proposed a solution: we modify the json format by adding a counter for each activity id, something like:
{"activities":[{"id":1, "count":1}, {"id":1, "count"=2}, {"id":2, "count":1}, {"id":"3", count:"1"}], "edges":[{"a1":{"id":1, "count":1}, "a2":{"id":1, "count"=2}}, {"a1":{"id":1, "count"=1}, "a2":{"id":2, "count"=1}}, {"a1":{"id":1, "count"=2}, "a2":{"id":3, "count"=1}}, {"a1":{"id":2, "count"=1}, "a2":{"id":3, "count"=1}}], "start":1}
Considering the following graph
The json would be:
{"activities":[{"id":1}, {"id":2}, {"id":3}], "edges":[{"a1":1, "a2":1}, {"a1":1, "a2":2}, {"a1":1, "a2":3}, {"a1":2, "a2":3}], "start":1}
The problem is that nothing differentiates the two
1
s. This leads to various issues:[start] 1 => 3 [end]
or[start] 1 => 1 => 1 => ...
should not be generated1
s by another activity, say4
, we should know which of the1
s should be conserved/updated to4
in the json@rphkhr proposed a solution: we modify the json format by adding a counter for each activity id, something like:
{"activities":[{"id":1, "count":1}, {"id":1, "count"=2}, {"id":2, "count":1}, {"id":"3", count:"1"}], "edges":[{"a1":{"id":1, "count":1}, "a2":{"id":1, "count"=2}}, {"a1":{"id":1, "count"=1}, "a2":{"id":2, "count"=1}}, {"a1":{"id":1, "count"=2}, "a2":{"id":3, "count"=1}}, {"a1":{"id":2, "count"=1}, "a2":{"id":3, "count"=1}}], "start":1}