Skip to content

Commit 9efa511

Browse files
author
Thomas van der Ven
committed
Updated readme with explanation of reconcile workflow and some conistency updates for reconcile workflow
1 parent feac3a0 commit 9efa511

File tree

2 files changed

+52
-2
lines changed

2 files changed

+52
-2
lines changed

README.md

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,7 @@ A modify workflow also follows a general pattern, like described below.
10471047
The `@modify_workflow` decorator adds some additional steps to the
10481048
workflow that are always needed.
10491049

1050-
```pyrhon
1050+
```python
10511051
@modify_workflow("Modify node", initial_input_form=initial_input_form_generator)
10521052
def modify_node() -> StepList:
10531053
return (
@@ -1191,6 +1191,55 @@ the orchestrator, a task (a workflow with `Target.SYSTEM`) can be
11911191
written that will retrieve a list of all L2VPNs from IMS and compare it
11921192
against a list of all L2VPN subscription from the orchestrator.
11931193

1194+
### Reconcile workflow
1195+
1196+
A reconcile workflow is similar to a modify workflow but without requiring user input via forms.
1197+
This makes the reconcile workflow useful for synchronization the existing configuration of
1198+
subscriptions with OSS and/or BSS.
1199+
1200+
The `@reconcile_workflow` removes the need for user input forms by basically running a
1201+
`modify_workflow` where the `initial_input_form` is automatically set to `None`.
1202+
1203+
```python
1204+
@reconcile_workflow("Reconcile l2vpn")
1205+
def reconcile_l2vpn() -> StepList:
1206+
return begin >> update_l2vpn_in_external_systems
1207+
```
1208+
1209+
1. Minimal required information of the subscription is collected and consists of the subscriptions
1210+
existing configuration.
1211+
2. Necessary subscription administration (`@reconcile_workflow`):
1212+
1. Register reconcile process for this subscription
1213+
2. Set subscription ‘out of sync’ to prevent the start of other processes
1214+
3. Interact with OSS and/or BSS, in this example
1215+
1. Update subscription in external systems (OSS and/or BSS) (`update_l2vpn_in_external_systems`)
1216+
4. Set subscription ‘in sync’ (`@reconcile_workflow`)
1217+
1218+
Because both a `@modify_workflows` and `@reconcile_workflow` need to have the same update steps for
1219+
a similar product (e.g. `l2vpn`), these update steps can be extracted into a separate variable:
1220+
1221+
```python
1222+
# variable containing update steps which are both used in modify and reconcile workflows
1223+
update_l2vpn_in_external_systems = begin >> update_l2vpn_in_nrm
1224+
1225+
1226+
@modify_workflow("Modify l2vpn", initial_input_form=initial_input_form_generator)
1227+
def modify_l2vpn() -> StepList:
1228+
return (
1229+
begin
1230+
>> set_status(SubscriptionLifecycle.PROVISIONING)
1231+
>> update_subscription
1232+
>> update_subscription_description
1233+
>> set_status(SubscriptionLifecycle.ACTIVE)
1234+
>> update_l2vpn_in_external_systems
1235+
)
1236+
1237+
1238+
@reconcile_workflow("Reconcile l2vpn")
1239+
def reconcile_l2vpn() -> StepList:
1240+
return begin >> update_l2vpn_in_external_systems
1241+
```
1242+
11941243
## Services
11951244

11961245
Services are collections of helper functions that deliver a service to

workflows/l2vpn/modify_l2vpn.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ def update_l2vpn_in_nrm(subscription: L2vpnProvisioning) -> State:
6767
return {"subscription": subscription}
6868

6969

70+
# variable containing update steps which are both used in modify and reconcile workflows
7071
update_l2vpn_in_external_systems = begin >> update_l2vpn_in_nrm
7172

7273

@@ -82,6 +83,6 @@ def modify_l2vpn() -> StepList:
8283
)
8384

8485

85-
@reconcile_workflow("Reconcile SN8 L2Vpn")
86+
@reconcile_workflow("Reconcile l2vpn")
8687
def reconcile_l2vpn() -> StepList:
8788
return begin >> update_l2vpn_in_external_systems

0 commit comments

Comments
 (0)