Provisioning Nifi WITSML FLOW¶
Getting started¶
This will guide you through how to provision nifi flow to fetch data for selective mnemonics for logs using nifi-witsml-bundle.
Setup and Requirements¶
You will need nifi-tempus-bundle and nifi-witsml-bundle for creating provisioning flow. Clone nifi-tempus-bundle and nifi-witsml-bundle and build the respective maven projects. Finally copy the nar files to nifi lib directory.
- nifi-tempus-bundle : https://github.com/hashmapinc/nifi-tempus-bundle
- nifi-witsml-bundle : https://github.com/hashmapinc/nifi-witsml-bundle
Fetch Log Mnemonic List¶
- On your nifi canvas create a flow as shown in image. This flow will let you fetch mnemonics for log object.
- Configure ListObjects(GetLogs) processor as shown. This processor will fetch log meta-data with mnemonic list from Witsml server.
- EvaluateJsonPath(PopulateAttributesFromJson) processor will add flowfile-attributes from logs json data. Configuration is being shown in image, don’t forget to add the highlighted mnemonicList attribute.
- To validate the process you will need to list-queue between EvaluateJsonPath and LogToTempus. On attribute tab you can see mnemonicList as below.
- To convert the logs mnemonic list to Tempus gateway device attribute json format you will use LogToTempus Processor.
- LogToTempus processor configuration are shown as follows.
- Finally configure PublishMqtt(AttributesToTempus) processor to publish the generated json to Tempus.
- Move back to your Tempus UI, on that particular Well Device you can see client attributes as log mnemonics as shown in image.
Fetch Data for selected Mnemonic using Tempus Attributes¶
- Create a nifi flow as follows to subscribe to shared attributes of tempus device and store the list of mnemonics in a file.
- ConsumeMqtt processor will subscribe to Tempus Device Attribute topic for shared attributes :
- TempusToNodeList is processor from nifi-tempus-bundle will process the different types shared attributes json messages from tempus.
- TempusToNodeList takes File path which will be used as storage for extracted node mnemonic list from Json messages. You also need to select the Data type as “WITSML”.
- Output of TempusToNodeList will be passed on to PutFile processor to write/replace the updated node list to the storage file :
NOTE : Change the conflict Resolution Strategy to “replace”.
- Start the nifi ConsumeMqtt processor and move back to Tempus UI.
- Select the mnemonics from Tempus UI client attribute window for which you want to fetch data and click on SEND TO SHARED button :
- Selected mnemonics will be added to the shared attributes window of the device with their value as true :
- On the nifi side these attributes will be subscribed by ConsumeMqtt processor and passed on to the TempusToNodeList processor for processing and storing them in a storage file using PutFile.
Start fetching data for mnemonic list from witsml server¶
- Create nifi flow to read witsml-storage file and pass the mnemonics list to WitsmlJsonToAttribute processor.
- GetFile processor will read the storage file in which you have been putting mnemonics list in previous steps.
NOTE : make “Keep Source File” as true.
- WitsmlJsonToAttribute will read the flowfile content and add wellId, wellboreId, logId, wellName and mnemonics as flowfile attributes.
- Data from WitsmlJsonToAttribute will be passed to GetData(GetLogData) processor. GetData processor will fetch data for only the selected mnemonics.
- LogData from processor can be passed to LogToTempus processor to process the data and convert it into Tempus GatewayJson format. Finally this data can be published through PublishMqtt processor.