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

  • ReplaceCPE over SOAP

  • POST /replace-cpe over 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 fromSn or fromMac, and the Destination has toSn or toMac. Exactly one of the two is set.

  • fromOui, fromProductClass, toOui and toProductClass are 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.

Replace CPE Flow
Figure 1. Replace CPE Flow

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 FTRPCInvoke call, before the wait for the task. The portal writes 422 when the task result is known, directly before 424, 4230 or 4231.

  • Failed FTGetTransactionStatus call: 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

  1. The flow searches the provision DB for the Source.

  2. If the provision DB has records of the Destination, the flow deletes these records.

  3. The flow searches the ACS for the Destination. For a MAC address, the flow uses FTFindCPEByWANMAC.

  4. If the ACS has the Destination, the flow checks the online status of the Destination.

  5. 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

  1. The flow reads the provisioning data of the Source from the provision DB.

  2. The flow converts the data by the rules of replaceCPE.xml.

  3. The flow builds a ProvisioningForDevice request from the data.

  4. 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

  1. The flow deletes the records of the Source from the provision DB.

  2. If the ACS has the Source, the flow removes the Source provisioning data and user info from the ACS.

  3. If the Source is online, FTRPCInvoke resets the Source to factory defaults. The portal names the RPC FactoryReset, the CWMP name of the method.

  4. 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), FTFindCPEByWANMAC failure (no answer, or an answer with an HTTP error status)

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

ProvisioningForDevice request built: success, failure

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), FTFindCPEByWANMAC failure (no answer, or an answer with an HTTP error status)

417, 430

Source in the ACS: yes (the ACS answers with the error code 100), no (any other answer)

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

FTRPCInvoke answered and its task result is known. Written before 424, 4230 and 4231.

4220

FTRPCInvoke failure, or FTGetTransactionStatus call failure. The flow reads no fault parameters.

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.