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:
-
Input Flow: provisions one or more CPEs from a provisioning request.
-
ACS Event Flow: applies the stored provisioning data after the ACS reports a device event.
-
Deactivate Service Flow: removes services from a CPE.
-
Replace CPE Flow: moves the provisioning data of one CPE to another CPE.
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 |
|
|
ACS Event Flow |
|
|
Deactivate Service Flow |
|
|
Replace CPE Flow |
|
|
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-dataandPOST /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-apicontainer, see Batch Files -
an
http://orhttps://URL, for examplehttps://files.example.com/prov/devices.xml: the portal downloads the file with aGETbefore it answers and reads it as a file on its server. The portal follows a redirect, except one fromhttps://tohttp://, which is answered with its status, for exampleThe 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.xmlor.csvmakes a wrong extension. The download limits are theBATCH_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
xmlFileorcsvFiletag, 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): MessageIncorrect file format -
a device
macin 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, whereMACis 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'., wherePATHis 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 statusCODEother than2xx, for exampleThe remote server returned an error: (404) Not Found.; a code without a standard reason phrase has no ` REASON`, for exampleThe remote server returned an error: (599). -
The remote name could not be resolved: 'HOST', whereHOSTis 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 withinBATCH_FILE_DOWNLOAD_CONNECT_TIMEOUT, or the whole file did not arrive withinBATCH_FILE_DOWNLOAD_TIMEOUT -
The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.: the TLS handshake with thehttps://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 above65535or a character a URL does not allow; a space is sent as%20 -
The file is larger than MAX bytes., whereMAXisBATCH_FILE_DOWNLOAD_MAX_SIZEin bytes, for exampleThe file is larger than 104857600 bytes.for the default100MB
-
-
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
reprovisionother than0,1,2or empty, or a cell ofdeleteprevious,rebootorcurrentonlyother than0,1or empty: MessageInvalid general attributes: NAME='VALUE' (allowed: VALUES), for exampleInvalid 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.xmlthe portal cannot read: MessageError processing 'CSVSettings.xml' data -
a
CSVSettings.xmlwithout its<info>,<general>or<services>element: MessageError 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 |
|---|---|
|
Input Flow: creates an object with |
|
Input Flow: sets the parameters of an existing object instance |
|
Input Flow: processes the sub-objects of the current object |
|
ACS Event Flow: the same object steps |
|
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 |
|
The flow provisions the CPEs one after another. |
Parallel |
|
The flow provisions all CPEs at the same time. |
Grouped |
|
The flow splits the CPEs into groups of |
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 |
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 |
Reboot |
The flow reboots the CPE with |
Domain |
If the request has a domain, the flow calls |
|
A setting in Configuration.xml.
|
The reprovision flag has three values:
| Value | Meaning |
|---|---|
|
You select neither Reprovision nor Secondary provision. The ACS applies the values one time. |
|
You select Reprovision.
The ACS applies the values again on every |
|
You select Secondary provision.
The ACS applies the values on every |
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 |
|---|---|
|
Empty. The portal sends no flag to the ACS. |
|
|
|
|
|
|
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.