Modify Workflow
A modify workflow also follows a general pattern, like described below.
The @modify_workflow
decorator adds some additional steps to the
workflow that are always needed.
@modify_workflow("Modify node", initial_input_form=initial_input_form_generator)
def modify_node() -> StepList:
return (
begin
>> set_status(SubscriptionLifecycle.PROVISIONING)
>> update_subscription
>> update_node_in_ims
>> update_node_in_nrm
>> set_status(SubscriptionLifecycle.ACTIVE)
)
- Collect input from user (
initial_input_form
) - Necessary subscription administration (
@modify_workflow
):- Register modify process for this subscription
- Set subscription ‘out of sync’ to prevent the start of other processes
- Transition subscription to Provisioning (
set_status
) - Update subscription with the user input
- Interact with OSS and/or BSS, in this example
- Update subscription in IMS (
update_node_in ims
) - Update subscription in NRM (
update_node_in nrm
)
- Update subscription in IMS (
- Transition subscription to active (
set_status
) - Set subscription ‘in sync’ (
@modify_workflow
)
Like a create workflow, the modify workflow also uses an initial input
form but this time to only collect the values from the user that need to
be changed. Usually, only a subset of the values may be changed. To
assist the user, additional values can be shown in the input form using
ReadOnlyField
. In the example below, the name of the node is shown but
cannot be changed, the node status can be changed and the dropdown is
set to the current node status, and the node description is still
optional.
class ModifyNodeForm(FormPage):
node_name: ReadOnlyField(port.node.node_name)
node_status: NodeStatusChoice = node.node_status
node_description: str | None = node.node_description
After a summary form has been shown that lists the current and the new values, the modify workflow is started.
summary_fields = ["node_status", "node_name", "node_description"]
yield from modify_summary_form(user_input_dict, subscription.node, summary_fields)