UC: Edit Composite Property Type - evomimic/map-proto1 GitHub Wiki
Description: This abstract use case enables a Metaspace Steward to stage edits to a Composite Property Type referred to as the parent type. These edits take the form of changing the values of editable header attributes and/or staging the addition or removal of properties to/from the parent type. The parent type may or may not already exist. When staging additions to the parent type, the Property Type for a new property may either be shared or dedicated. To reference a shared Property Type, the referenced Property Type must already exist before it can be referenced. UC: Define New Property Type can be included to meet this requirement. Note that in this case, the referenced Property Type is actually committed to persistent storage, not just staged for creation. At the conclusion of this use case, the Metaspace Steward will have either Canceled the edit or Submitted the edited parent type for persistent storage. Responsibility for actually performing the storage operation lies with the including use case. Note that new (referenced) Property Types may have been persistently created, even if the edits to parent_type have been canceled.
Actor: Metaspace Steward
Preconditions:
- a Metaspace Steward has selected an existing or new Composite Property Type for editing.
Post-conditions:
The Metaspace Steward will have either canceled the edits or submitted the edited parent type for storage. Responsibility for actually performing the storage operation lies with the including use case. Some referenced (shared) Property Types may have been created, even if edits to the parent_type are canceled.
Assumptions:
Main Flow
- This use case starts when included by its including use case.
- The system responds by presenting the Composite Property Type Editor showing existing values (if any) for the parent type's header attributes as well as any existing properties. It offers the following actions:
- Edit Header Attributes
- Add Property
- Remove Selected Propert(ies) (only available if the parent_type has at least one property and at least one of them has been selected)
- Submit
- Cancel
- The Steward selects an action.
- If the Steward selected
Edit Header Attributes, follow Alternate Flow: Edit Header Attributes. If the Steward selectedAdd Property, follow Alternate Flow: Add Property. If the Steward selectedRemove Selected Property(ies), follow _Alternate Flow: Removed Selected Properties. If the Steward selectedSubmit, the flow is continued in the including use case. If the Steward selectedCancel, any supplied values are ignored, the dialog is dismissed, and flow is continued in the including use case.
Alternate Flows
Alternate Flow: Edit Header Attributes
This flow is followed when the Steward has selected the Edit Header Attributes action.
- The system responds by putting the Header section of the Scalar Property Type Editor into
edit-mode. This places all header fields the Steward is permitted to edit into an editable representation. - The Steward makes any desired edits and selects
Done. - The system restores the Header Section to
read-modeand flow resumes at Step 2 of the Main Flow.
Alternate Flow: Add Property
This flow is followed when the Steward has selected the Add Property action.
- The system responds by putting the Type Details section of the Scalar Property Type Editor into
edit-mode. This places all type-specific property descriptor details the Steward is permitted to edit into an editable mode. - The Steward makes any desired edits and selects
Done. - The system ...` and flow resumes at Step 2 of the Main Flow.
Alternate Flow: Remove Selected Properties
This flow is followed when the Steward has selected one or more existing properties and selected the Add Property action.
- The system responds by putting the Type Details section of the Scalar Property Type Editor into
edit-mode. This places all type-specific property descriptor details the Steward is permitted to edit into an editable mode. - The Steward makes any desired edits and selects
Done. - The system ...` and flow resumes at Step 2 of the Main Flow.
Wireframes
Scalar Property Type Editor
Issues
Implementation Notes
Commands
The following command object classes (structs that implement the UndoableCommand trait) need to be offered via the WASM API for this use case:
* UpdateTypeHeader -- allows update of one or more meta-properties of a TypeDescriptor.
* UpdateTypeDetails -- allows update of one or more of the type-specific properties of a PropertyTypeDescriptor. For example, the type-specific properties of PropertyDescriptor of BaseType String include min_length and max_length. The type-specific properties of a PropertyDescriptor of BaseType I8 include min_value and max_value.
* Cancel -- discard the PropertyDescriptorBuilder and abandon the editing process
* Commit -- request that the accumulated edits for this PropertyDescriptor be persisted