update the object stored for one workflow with user input

This commit is contained in:
pb
2024-03-29 17:00:53 +01:00
parent 49d3ba9763
commit b51c0f1b74
3 changed files with 79 additions and 24 deletions

View File

@@ -2,6 +2,7 @@ package models
import (
"encoding/xml"
"strconv"
)
type MxGraphModel struct {
@@ -43,3 +44,18 @@ func (m *mxissue) Error() string {
func newMxIssue(message string) error {
return &mxissue{message}
}
// mxCell inside object tags are create twice when unmarshalling
// once as they appear in the xml inside the MxObject struct and once in the MxCell struct
// so once retrieved from object we remove them from the root's MxCell list
func (m *MxGraphModel) removeMxCell(id string){
int_id,_ := strconv.Atoi(id)
int_id = int_id + 1
cell_id := strconv.Itoa(int_id)
for i, cell := range(m.Root.MxCell){
if cell.ID == cell_id {
m.Root.MxCell = append(m.Root.MxCell[:i],m.Root.MxCell[i+1:]...)
}
}
}