In sequence diagrams, an 'activate X' at the start of a group right after a 'deactivate X' at the end for the prior group causes an error, 'Activate/Deactivate already done on X', but probably shouldn't
Here is an example where the desire is to have the activation state be displayed distinctly within each group (This would work correctly if each group were in a separate file):
@startuml
participant X
participant Y
group First
activate X
X -> Y: Some update
activate Y
Y -> Y: spawn worker
Y -->> X: notify
deactivate Y
deactivate X
end
group Second
activate X
X -> Y: request stats
activate Y
X <- Y: return stats
deactivate Y
deactivate X
ref over X, Y: First
end
@enduml