Provisioning Flows

1. Overview

The Provision Portal runs every provisioning operation as a Business Process Model and Notation (BPMN) process. The Flowable engine executes these processes. The portal has four provisioning flows:

Each step of a flow writes a numeric status code. The Status Codes Reference lists every code.

Each flow page has a flow diagram. The portal differs from the diagrams in a few places. The section Differences from the Diagram under each diagram lists them. If a diagram and a BPMN file in src/main/resources/processes/ differ, the BPMN file is correct.

2. Flows and Entry Points

Flow BPMN process Started by

Input Flow

  • provisioningStarter in provisioningStarter.bpmn

  • inputFlowV3 in inputFlowV3.bpmn, once for each CPE

  • Single device tab, Submit: PUT /ui/provision

  • Multiple device tab, Submit: PUT /ui/provision/multiple

  • REST: POST /provision/from-request-data, POST /provision/from-xml-file-data, POST /provision/from-csv-file-data

  • SOAP: ProvisioningForDevice, ProvisioningForDevices, ProvisioningForExternalContent

ACS Event Flow

deviceEventMonitorProcess in acsEventFlowV3.bpmn

  • REST: POST /device-event

  • SOAP: DeviceEventMonitor

Deactivate Service Flow

deactivateServiceFlow in deactivateServiceFlow.bpmn

  • Deactivate service tab, Submit: PUT /ui/provision/deactivate

  • REST: POST /service/deactivate

  • SOAP: RemoveServices

Replace CPE Flow

ReplaceCPEProcess in replaceCPE.bpmn

  • Replace device tab: PUT /ui/provision/replace-cpe

  • REST: POST /replace-cpe

  • SOAP: ReplaceCPE

REST paths are relative to the application context /prov-portal. The SOAP service is at /prov-portal/soap/ProvWS. For the full API, see API & Integration.

Some requests return the Batch ID at once and continue in the background:

  • ProvisioningForDevices

  • ProvisioningForExternalContent

  • POST /provision/from-xml-file-data and POST /provision/from-csv-file-data

  • the Multiple device tab

ProvisioningForDevices, ProvisioningForExternalContent, POST /provision/from-xml-file-data and POST /provision/from-csv-file-data take the file as one of:

  • a path on the server of the portal; in a Docker installation the path is inside the provision-api container, see Batch Files

  • an http:// or https:// URL, for example https://files.example.com/prov/devices.xml: the portal downloads the file with a GET before it answers and reads it as a file on its server. The portal follows a redirect, except one from https:// to http://, which is answered with its status, for example The remote server returned an error: (302) Found. It sends no credentials. The URL ends in the extension, as a path does: a query string after .xml or .csv makes a wrong extension. The download limits are the BATCH_FILE_DOWNLOAD_* settings in Environment Configuration.

These requests check the file before they answer: its extension (.xml or .csv) and that it exists or, for a URL, that it can be downloaded. They also read the whole file before they answer. When a check fails, the answer has Result 200 and the Batch ID 00000000-0000-0000-0000-000000000000, no batch starts and no device of the file is provisioned:

  • a wrong extension, an empty path (an empty SOAP xmlFile or csvFile tag, an empty REST body), or an XML file whose content is not XML with the root element <devices> (cut off, broken markup, a single <device> root): Message Incorrect file format

  • a device mac in the XML file or a MAC address cell in the CSV file that is not hex digits with optional colons: Message 'MAC' cannot be converted to MAC address, where MAC is that value in upper case without colons

  • an XML file the portal cannot open, for example without read permission: the Message is the reason

  • a file that does not exist: Message Could not find file 'PATH'., where PATH is the path from the request

  • a file given by a URL that cannot be downloaded: the Message is the reason, one of

    • The remote server returned an error: (CODE) REASON.: the server answered with the HTTP status CODE other than 2xx, for example The remote server returned an error: (404) Not Found.; a code without a standard reason phrase has no ` REASON`, for example The remote server returned an error: (599).

    • The remote name could not be resolved: 'HOST', where HOST is the host name of the URL

    • Unable to connect to the remote server: nothing accepts the connection at the host and port of the URL

    • The operation has timed out: no connection within BATCH_FILE_DOWNLOAD_CONNECT_TIMEOUT, or the whole file did not arrive within BATCH_FILE_DOWNLOAD_TIMEOUT

    • The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.: the TLS handshake with the https:// server failed, for example because its certificate is self-signed or not signed by an authority the Java runtime of the portal trusts

    • The underlying connection was closed: An unexpected error occurred on a receive.: any other failure of the connection, for example the server closed it before the end of the file

    • Invalid URI: The format of the URI could not be determined.: the URL has no host, a host name with _ (use the IP address of such a host), a port above 65535 or a character a URL does not allow; a space is sent as %20

    • The file is larger than MAX bytes., where MAX is BATCH_FILE_DOWNLOAD_MAX_SIZE in bytes, for example The file is larger than 104857600 bytes. for the default 100MB

  • a CSV line with fewer columns than the highest column number that CSVSettings.xml maps: Message Index was outside the bounds of the array.

  • a CSV cell of reprovision other than 0, 1, 2 or empty, or a cell of deleteprevious, reboot or currentonly other than 0, 1 or empty: Message Invalid general attributes: NAME='VALUE' (allowed: VALUES), for example Invalid general attributes: reprovision='7' (allowed: 0,1,2); several such cells of one line are listed in one Message, separated by `; `

  • a CSV file the portal cannot read, for example with a quote that is never closed: Message Cannot read CSV data

  • a CSVSettings.xml the portal cannot read: Message Error processing 'CSVSettings.xml' data

  • a CSVSettings.xml without its <info>, <general> or <services> element: Message Error mapping CSV row

All other requests wait for the end of the flow and return its result.

2.1. Sub-processes

The main processes call separate BPMN processes for repeated steps:

BPMN file Purpose

inputFlowV3CreateServiceObject.bpmn

Input Flow: creates an object with FTAddObject

inputFlowV3UpdateServiceObject.bpmn

Input Flow: sets the parameters of an existing object instance

inputFlowV3ProcessServiceSubObjects.bpmn

Input Flow: processes the sub-objects of the current object

acsEventFlowV3CreateObjectFromEvent.bpmn, acsEventFlowV3UpdateObjectFromEvent.bpmn, acsEventFlowV3ProcessServiceSubObjects.bpmn, saveObjectsProcess.bpmn

ACS Event Flow: the same object steps

inputFlowV3RetrieveTaskInfo.bpmn, acsEventFlowV3RetrieveTaskInfo.bpmn, deactivateServiceFlowRetrieveTaskInfo.bpmn, replaceCPERetrieveTaskInfo.bpmn

All flows: poll the task status, see Waiting for Task Results

3. Batch Processing

provisioningStarter reads the request and runs the Input Flow for each CPE of the request. Two settings in Configuration.xml select the processing mode: <multithreading> and <numberOfMultipleThreads>.

Mode Condition Behaviour

Sequential

<multithreading> is false

The flow provisions the CPEs one after another.

Parallel

<multithreading> is true. <numberOfMultipleThreads> is equal to or greater than the number of CPEs.

The flow provisions all CPEs at the same time.

Grouped

<multithreading> is true. The request has more CPEs than <numberOfMultipleThreads>.

The flow splits the CPEs into groups of <numberOfMultipleThreads>. The CPEs of a group run in parallel. The groups run one after another.

4. Common Options

The request options change the path through the flows. On the Single device tab, these options are the General Options.

Option Effect on the flow

Delete previous

First, the flow deletes the CPE records in the provision database (provision DB). Then the flow saves the new data. Later, the flow also removes the CPE provisioning data from the ACS with FTRemoveCPEProvisionData.

Current only

Selected: the flow uses only the data of the current request. Not selected: the flow also uses the data in the provision DB for this CPE.

Reprovision, Secondary provision

The two options set the reprovision flag. The flow sends this flag with every FTSetDeviceParameters, FTAddObject and FTRPCInvoke call. See the values below.

Reboot

The flow reboots the CPE with FTRPCInvoke at the end.

Domain

If the request has a domain, the flow calls FTSetCPEDomain.

<createDevice>

A setting in Configuration.xml. true: if the ACS does not have the CPE, the flow creates the CPE with FTCreateDevice. The request must contain the OUI and the Product Class. false: the flow stores the data. The data waits for the CPE to register with the ACS.

The reprovision flag has three values:

Value Meaning

0

You select neither Reprovision nor Secondary provision. The ACS applies the values one time.

1

You select Reprovision. The ACS applies the values again on every 0 BOOTSTRAP event.

2

You select Secondary provision. The ACS applies the values on every 0 BOOTSTRAP event. The ACS creates no tasks now.

With flag 2, the flow does not wait for task results. The flow also cannot process an object with a specific instance.

A request or a stored record can leave the flag empty. The portal then sends no flag to the ACS, and the ACS applies its own default for adding values to the provisioning data. The flow waits for task results as with flag 0.

An XML request can leave out the <general> element, or some of its attributes. A flag that the request does not set takes its default:

Attribute Default

reprovision

Empty. The portal sends no flag to the ACS.

deleteprevious

0. The flow keeps the CPE records of the provision DB.

reboot

0. The flow does not reboot the CPE.

currentonly

1. The flow uses only the data of the current request.

In an XML request and in an XML batch file, deleteprevious, reboot and currentonly take 1 or true for on, 0, false or an empty value for off. An empty currentonly is off too: only a request without the attribute gets the default 1. The provision DB stores deleteprevious and reboot as 1 or 0.

A single-device request (SOAP ProvisioningForDevice, REST POST /provision/from-request-data) with another value of one of these attributes, or with a reprovision other than 0, 1, 2 or empty, provisions nothing and stores nothing. The answer has Result 200, the Bid 00000000-0000-0000-0000-000000000000 and a message that names each wrong attribute, separated by `; `, for example:

Invalid general attributes: reboot='yes' (allowed: 0,1,false,true)

A CSV batch takes its flags from the columns that CSVSettings.xml maps. Without a mapped reprovision column, the flag is 0. An empty cell of a mapped deleteprevious, reboot or currentonly column means 0.

5. CPE Identification

The flow identifies a CPE by its serial number (SN) or by the MAC address of its WAN connection.

  • SN: the flow searches the ACS for the SN.

  • MAC address: the flow gets the SN with FTFindCPEByWANMAC.

If the ACS does not have the CPE yet, the flow stores the data under the MAC address. When the CPE registers, the ACS Event Flow adds the SN to these records.

6. Waiting for Task Results

FTSetDeviceParameters, FTAddObject and FTRPCInvoke create tasks in the ACS. Each call returns a transaction ID. If the CPE is online, the flow polls FTGetTransactionStatus with this transaction ID. The polling stops when the result is final: all tasks completed, a task failed or was rejected while none is pending, or the timeout has passed.

  • All tasks completed: the step succeeds.

  • A task failed, or the ACS rejected a task: the step fails.

  • A task is still pending after the timeout: the step fails with a timeout status. At the timeout, a failed task beats a rejected task, and a rejected task beats a pending task. A transaction with no pending, failed or rejected task counts as completed.

If <isFaultVisible> in Configuration.xml is true, six failure statuses also get the fault of each failed parameter from the ACS: 1390, 1520, 1890, 2380, 2460 and 5121. The status record of the CPE keeps these faults. ProvisioningForDevice and GetStatus return them in the Fault element. Each fault has the FaultCode and the FaultString, and the Name of the parameter when the ACS recorded which parameter failed. If the CPE has a serial number, the DebugLog gets one line per failed parameter. Other failures get no fault.

With <isFaultVisible> set to true, the answer of a ProvisioningForDevice run and every status of GetStatus has a Fault element; the element is empty when no parameter failed. A request that the portal refuses before the run gets the empty element too. With false, these answers have no Fault element. The answers of the batch methods ProvisioningForDevices and ProvisioningForExternalContent never have a Fault element.

The TIMEOUT environment variable sets the timeout in seconds. The default is 60.

The TRANSACTION_DELAY environment variable sets an extra wait in milliseconds. The default is 1000. After the first completed task, the flow waits for this time. Then the flow accepts the result.

The TRANSACTION_POLL_INTERVAL environment variable sets the wait between two polls in milliseconds. The default is 1000, one second. After every answer that is not final, the flow waits one interval before the next poll. This holds while a task is pending and while no task is known yet.

If the CPE is offline, the flow does not poll. The tasks stay in the ACS. The ACS runs the tasks when the CPE connects.

7. Status Codes and Logs

Each step writes its status code to three places:

  • the DebugLog, as <SN or MAC> <code> : <description>

  • the CustomLog, if CustomStatus.xml lists the code

  • the status record of the CPE in the batch

The last code of a CPE is its final operation code. You see this code on the Get status tab.

If the ACS answers with an error code other than 100, the DebugLog also gets this line:

ERROR - Method '<method>' failed with error code: <code> and message: <message>

If the connection to the ACS fails, the step writes its failure code and the run of the CPE ends. This holds when the ACS drops the connection, does not answer, or answers with something that is not valid JSON. A few steps write no code in this case and end the run:

  • the serial and MAC lookups at the start of the input flow (in Replace CPE the run then ends with 4150)

  • the online check of the deactivate flow

  • the check of the source in the ACS and its online check in Replace CPE

After a failed serial or MAC lookup or a failed online check of the deactivate flow, the answer carries the last code written, as after a normal run. GetStatus shows the same code. In a batch, a failed serial or MAC lookup of one device ends the batch. Without multithreading, the next devices do not start. With multithreading, the devices of the current group run to the end, and the next groups do not start. The devices that ran keep their data and their statuses.

For the log files, see View Log. For every code, see Status Codes Reference.