upload method
Implementation
void upload(String diagram) {
final children = <String>[];
stateMachine.states.forEach((stateId, state) {
if (state is State) {
for (final region in state.regions) {
children.add(region.machine.name);
}
}
});
_log.fine('Children: $children');
_log.info('Uploading diagram through $_ws');
_ws?.sink.add(
messageToJson(
UploadMachineDTO(
hostname: hostname,
domain: domain,
smId: stateMachine.name,
diagram: diagram,
children: children,
),
),
);
}