Replace CPE Flow
1. Overview
The Replace CPE Flow moves the provisioning data of one CPE to another CPE. The first CPE is the Source. The second CPE is the Destination. A typical case is a device swap for a subscriber. The flow provisions the Destination through the Input Flow. Then the flow clears the Source.
These requests start the flow:
-
the Replace device tab, see Replace CPE
-
ReplaceCPEover SOAP -
POST /replace-cpeover REST
The request identifies each CPE by its serial number (SN) or its MAC address. It also carries the OUI and the Product Class of both CPEs.
The portal checks the request before the flow starts:
-
The Source has
fromSnorfromMac, and the Destination hastoSnortoMac. Exactly one of the two is set. -
fromOui,fromProductClass,toOuiandtoProductClassare set. -
No value consists of spaces only.
A request that breaks a rule does not start the flow.
The portal answers with the result 200, an empty status, the Bid 00000000-0000-0000-0000-000000000000 and a message that lists every broken rule, for example Invalid ReplaceCPE request: fromSn and fromMac are both set, set one of them; toProductClass is empty.
The rules are the same for the Replace device tab, SOAP and REST.
The Business Process Model and Notation (BPMN) process is ReplaceCPEProcess in replaceCPE.bpmn.
The provision database (provision DB) must contain provisioning data for the Source.
2. Flow Diagram
The numbers in the circles are status codes. For their meaning, see Status Codes Reference.
2.1. Differences from the Diagram
The portal differs from the diagram in these places:
-
Circle 423: on the diagram it only joins the wait loop. The portal writes no 423.
-
Match and replace: the diagram writes 4110 when the step fails. The portal never writes 4110.
-
Online check of the Source: the diagram writes 4200 when the check fails. The portal writes no status and ends with the last status, 419.
-
Factory reset: the diagram writes 422 right after the
FTRPCInvokecall, before the wait for the task. The portal writes 422 when the task result is known, directly before 424, 4230 or 4231. -
Failed
FTGetTransactionStatuscall: the diagram writes 4230. The portal writes 4220. -
Failed or rejected task: the diagram writes 4240. The portal writes 4230.
-
Task counts all 0: the diagram writes 4240. The portal polls until the timeout, counts the transaction as completed and writes 424.
-
Timeout: the diagram writes 4231. The portal writes 4231 only when a task is pending and none failed or was rejected. With a failed or rejected task it writes 4230. The portal never writes 4240.
3. Steps
3.1. Prepare the Destination
-
The flow searches the provision DB for the Source.
-
If the provision DB has records of the Destination, the flow deletes these records.
-
The flow searches the ACS for the Destination. For a MAC address, the flow uses
FTFindCPEByWANMAC. -
If the ACS has the Destination, the flow checks the online status of the Destination.
-
The flow removes the old data of the Destination from the ACS: the provisioning data and the user info.
If the provision DB has no data for the Source, the flow ends with status 4000. An offline Destination stops the flow with status 4050. If the ACS does not have the Destination yet, the flow skips steps 4 and 5.
3.2. Transfer the Data
-
The flow reads the provisioning data of the Source from the provision DB.
-
The flow converts the data by the rules of replaceCPE.xml.
-
The flow builds a
ProvisioningForDevicerequest from the data. -
The flow runs the Input Flow for the Destination.
In step 2, the flow uses the <model> section for the OUI and the Product Class of both CPEs.
The flow converts the matching parameters, objects and services.
If replaceCPE.xml has no such section, the flow moves the data without changes.
A section with empty attributes is never used, because every request carries the four values.
If no data matches the section, the flow also moves the data without changes.
The flow moves every stored copy of an object, each with its own instance and values (see copies of one object). The flow does not move sub-objects.
The Input Flow writes its own status codes for the Destination.
3.3. Clear the Source
-
The flow deletes the records of the Source from the provision DB.
-
If the ACS has the Source, the flow removes the Source provisioning data and user info from the ACS.
-
If the Source is online,
FTRPCInvokeresets the Source to factory defaults. The portal names the RPCFactoryReset, the CWMP name of the method. -
The flow waits for the result of the factory reset task. The flow writes 422 as soon as the result is known, then 424 (completed), 4230 (failed or rejected) or 4231 (pending after the timeout). A transaction with no failed, rejected or pending task is completed, also when no task completed at all. At the timeout, a failed task beats a rejected task, and a rejected task beats a pending task.
If the online status check of the Source answers with an error, the flow ends without a new status.
The response has Result 100 and the last status of the flow, 419.
If the ACS lookup of the Source answers with any error code other than 100, the flow writes 430 and ends with Result 100, as it does for a Source that the ACS does not have.
After these failures the flow does not roll back what it has already done.
If an ACS call gets no answer, for example a dropped connection or an answer that is not valid JSON, the flow ends the same way, see Status Codes and Logs.
The flow does not write 4200.
4. Status Codes
| Code | Meaning |
|---|---|
400, 4000, 4001 |
Source in the provision DB: yes, no, provision DB error |
401, 402, 4010 |
Destination in the provision DB: yes, no, search failure |
403, 4030 |
Destination records deleted from the provision DB: success, failure |
426, 427, 4260 |
SN for the Destination MAC address: found, not found (the ACS answers without an SN, whatever the error code), |
404, 406, 4040 |
Destination in the ACS: yes, no, search failure |
405, 4050, 4051 |
Destination online, Destination offline, online status unknown. The flow ends after 4050 and 4051. |
407, 4070 |
Destination provisioning data removed from the ACS: success, failure |
431, 4310 |
Destination user info removed from the ACS: success, failure |
408, 4080 |
Source data read from the provision DB: success, failure |
409, 410 |
Section for the Source and the Destination in replaceCPE.xml: yes, no |
411, 412 |
Data converted, no matching data |
413, 4130 |
|
415, 4150 |
Input Flow for the Destination: success, failure |
416, 4160 |
Source records deleted from the provision DB: success, failure |
428, 429, 4280 |
SN for the Source MAC address: found, not found (the ACS answers without an SN, whatever the error code), |
417, 430 |
Source in the ACS: yes (the ACS answers with the error code |
418, 4180 |
Source provisioning data removed from the ACS: success, failure |
419, 4190 |
Source user info removed from the ACS: success, failure |
421, 420 |
Source online, Source offline |
422 |
|
4220 |
|
4231 |
Factory reset task still pending after the timeout |
4230 |
Factory reset task failed or rejected |
424 |
Source reset to factory defaults |
Final statuses for a successful replacement:
| Code | Result |
|---|---|
424 |
The flow reset the Source to factory defaults. |
420 |
The Source was offline. |
429 |
The ACS does not have the Source. The request used a MAC address. |
430 |
The ACS does not have the Source. The request used an SN. |