Member since
02-27-2018
4
Posts
2
Kudos Received
0
Solutions
03-01-2018
03:44 PM
Hi everyone. I have two ReplaceText Processors injecting two different insert queries into a single PutSQL Processor (my insert queries use values coming from elements of two xml files). My goal is to make sure that if an insert fails then a rollback operation is performed on the other (assuming it doesn't fail), because I don't have to create a mismatch between the tables. How can I obtain such a feature? Any help will be appreciated.
... View more
Labels:
- Labels:
-
Apache NiFi
03-01-2018
03:28 PM
1 Kudo
Thank you @Timothy Spann, I combined TransformXML, SplitXML and EvaluateXPath, and I obtained the desired result.
... View more
02-27-2018
02:40 PM
1 Kudo
Hi everyone. I have the following XML:
<?xml version="1.0" encoding="UTF-8"?>
<flow xmlns:*** xmlns:xsi=*** xsi:schemaLocation=***>
<version>1.0</version>
<id>15</id>
<date>2018-01-01</date>
<sender>
<senderId>
<idType>G</idType>
<idCode>code</idCode>
</senderId>
<senderName>name</senderName>
</sender>
<paymentsNumber>2</paymentsNumber>
<paymentsTotal>800.40</paymentsTotal>
<payment>
<paymentId>1</paymentId>
<paymentAmount>400.20</paymentAmount>
<paymentResult>0</paymentResult>
<paymentDate>2018-02-01</paymentDate>
</payment>
<payment>
<paymentId>2</paymentId>
<paymentAmount>400.20</paymentAmount>
<paymentResult>0</paymentResult>
<paymentDate>2018-02-02</paymentDate>
</payment>
</flow>
I need to extract all tags values and to execute insert queries on different tables. In particular:
- <version>, <id>, <date>, <idType>, <idCode>, <senderName>, <paymentsNumber>, <paymentsTotal> need to be inserted in one table - <version>, <id>, <date> and all tags values inside <payment> need to be inserted in another table (an insert query for every <payment> tag occurrence) How can I achieve this result? I tried to use ReplaceText + PutSQL, but this combination seems to not be useful.
Any help will be appreciated!
Regards.
... View more
Labels:
- Labels:
-
Apache NiFi