This section describes how to create and deploy a custom questionnaire for ServAssure FieldPro. There are customizable components to modem record creation that can be modified on a per-tenant basis.
Configuration File
A configuration file, configuration.json, defines the customizable components.
When deployed, the default file is located here:
- Desktop — https://hostname:port/nxt-ui/assets/fieldpro-configuration.json
- Mobile — https://hostname:port/nxt-fieldpro/fieldpro/assets/configuration.json
When deployed, the customized files are located here:
- Desktop — https://hostname:port/nxt-ui/config/tenant-name/fieldpro-configuration.json
- Mobile — https://hostname:port/opt/arris/tomcat/webapps/nxt-fieldpro/config/tenant-name/configuration.json
Customizable elements of the configuration file
You can customize the collection variables and the contents of the questionnaire section of creating a modem record.
- Start with a copy of the default file.
- Incorporate the tenant name into the filename, for example configuration_mytenant.json.
- Save your customized file in a location outside of the product environment so it is not overwritten by an upgrade or new installation. You will need to re-deploy the file after each upgrade or installation.
Sample Collection
For the collection of samples from the modem, you can customize the minimum number of samples required, and the collection timeout value.
minSuccessfulSamples": 1,
"collectionTimeoutSeconds": 120,Questionnaire customization
For the questionnaire section of creating a modem record, you can design the number and style of questions. Available options are:
- checkbox-group/checkbox
- select
- input
- textarea
Each type of question has a key and a label. Types such as select, input, and textarea, also include optional placeholder values.
The following is an example configuration.json file:
{
"minSuccessfulSamples": 1,
"collectionTimeoutSeconds": 120,
"questionnaire": [
{
"label": "Questions",
"key": "questions",
"type": "checkbox-group",
"items": [
{
"key": "signal",
"label": "A signal is present",
},
{
"key": "mtaPower",
"label": "The MTA has power",
}
]
},
{
"key": "callRating",
"label": "Rate the experience",
"type": "select",
"required": true,
"options": [
{
"label": "Fair",
"value": "fair"
},
{
"label": "Good",
"value": "good"
},
{
"label": "Great",
"value": "great"
}
]
},
{
"type": "input",
"label": "Summarize your findings",
"key": "summarize-input",
},
{
"type": "textarea",
"label": "Notes",
"key": "notes",
"maxLength": 50
}
]
}Validating and deploying the configuration file
Once you have created your custom questionnaire configuration file, use the steps that follow to validate the structure of the configuration file and load it into the correct location for the specified tenant.
On your Ansible host, navigate to the nxt-ansible-2.14.x.x directory.
- If not already installed, install ansible.utils:
ansible-galaxy collection install ansible.utils - Switch to Python virtual environment, for example ansible-2.9.6.0:
source /home/arris/ansible_virtualenv/ansible-2.9.6.4/bin/activate - If not already installed, install the Python jsonschema package:
pip install jsonschema - Navigate to the tools directory, for example:
cd /home/arris/user/nxt-ansible-2.9.6.4/tools - Run the Ansible playbook to validate your configuration file, and move it into place:
ansible-playbook -i <pathInventoryFile> fieldpro-configure-list.yml -bkKThe script prompts you to provide the following information:- SSH password:
Enter the root password for your app server.
- BECOME password
[defaults to SSH password]:
Leave blank; hit return.
- Enter the tenant you
want to customize:
Provide the name of the tenant, for example, my_tenant.
- Enter the file you
want to use for customization (full path):
Enter the full path of the file containing the custom configuration file, for example, /home/arris/user/configuration_my_tenant.json.
If errors are reported when validating the file, correct the errors and re-run the Ansible playbook.
- SSH password:
Repeat Step 6 for any additional tenants.
The next time a new modem record is created with ServAssure FieldPro, the custom questions will be presented.
