Problem reconstructing components' object from DB #2
Labels
No Label
Kind/Bug
Kind/Doc
Kind/Feature
Kind/Security
Kind/Testing
Priority/High
Priority/Low
Priority/Medium
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: core/oc-schedulerd#2
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In
graph.GetWorkflowComponents
we try to reconstruct the object corresponding to a component type and component id using componentModel and componentNEWModel. However the attributes of the objects are only added to the base object if they are strings. Hence we can't construct the attribute of type int, float, etc.. but also the structs in structsThis is mainly the cause of trying to make the object retrieval as generic as possible (1 method for all component's type)
Removed
componentParser
and changed the logic of component reconstruction, with json.Unmarshall rather than mapstructure. This library was over-complexifying things, creating maps from JSON data, while we already add the JSON data that could create these objects, supporting nested structs.6bbb2a0b4092b852c90e39e896e8d8ba6bbfb110
updated AddComponentModel to take the user input stored in the DB as a parameter and adding it to the constructed object with json.Unmarshall.Simpliefied the code and produced the expected reconstruction from DB data and models :