update the object stored for one workflow with user input
This commit is contained in:
@@ -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:]...)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user