on 10-02-2016 9:49 AM
Hi experts,
please provide me the suggestions
Scenario: File to Idoc
PFB, is the incoming file format: i need to put condition for dataprevisa, where date should come in ascending order and in this incoming file having 10 months data will be present i need to fetch only last month data.
And each numero line should create each idoc at target side.
if dataprevisa "date" = dataentrega"date" have to create idoc.
if dataprevisa "date" != dataentrega"date" have to create idoc.
if dataprevisa " " = dataentrega" " should not create idoc.
Have to Implement in graphical mapping.
<?xml version="1.0" ?>
<transportadora="27/09/2016 10:30">
<notasfiscais>
<origem="1234567889">
<numero="5407" dataprevisa="30/09/2016" dataentrega="30/09/2016" localizacao="data" />
<numero="5401" dataprevisa="29/09/2016" dataentrega="27/09/2016" localizacao="data" />
<numero="5400" dataprevisa="28/09/2016" dataentrega="28/09/2016" localizacao="" />
<numero="5399" dataprevisa="27/09/2016" dataentrega="" localizacao="" />
<numero="5403" dataprevisa="26/09/2016" dataentrega="" localizacao="" />
</origem>
<origem="123456785689">
<numero="5407" dataprevisa="26/09/2016" dataentrega="25/09/2016" localizacao="data" />
<numero="5401" dataprevisa="24/09/2016" dataentrega="27/09/2016" localizacao="data" />
<numero="5400" dataprevisa="25/09/2016" dataentrega="28/09/2016" localizacao="" />
<numero="5399" dataprevisa="15/09/2016" dataentrega="" localizacao="" />
<numero="5403" dataprevisa="13/09/2016" dataentrega="" localizacao="" />
</origem>
Thanks and Regards,
Abhilash.
Hi Abhilash,
Some comments:
if dataprevisa "date" = dataentrega"date" have to create idoc.
if dataprevisa "date" != dataentrega"date" have to create idoc.
if dataprevisa " " = dataentrega" " should not create idoc.
Just use if dataprevisa != "" AND dataentrega != "" in the xpath of your receiver determination.
Have to Implement in graphical mapping.
This requires multi-mapping, which PI version do you have?
Regards,
Mark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Abhilash!
Wouldn't you provide correct XML structure first?
In your current example I can't see elements, only attributes inside XML tags.
Regards, Evgeniy.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Abhilash,
This is not a valid XML, as has already pointed out above. If this is the format of file that you receive, you wouldn't be able to use Message mapping to parse this. You can check if the XML payload is valid by copying it in any XML tool and validating the structure.
Having said that, if you really need to process the data from this file, I guess only option would be to write a Java mapping and do string parsing in it.
Regards,
Sanjeev.
Once again: your document is incorrect. While trying to validate it:
Element type "transportadora" must be followed by either attribute specifications, ">" or "/>".
Opening tag for transportadora doesn't contain element name. With your current syntax it contains only attribute transportadora="27/09/2016 10:30".
And in closing tag transportadora is an element name.
Regards, Evgeniy.
this is the correct XML
<?xml version="1.0" ?>
<transportadora="27/09/2016 10:30">
<notasfiscais>
<origem="1234567889">
<numero="5407" dataprevisa="30/09/2016" dataentrega="30/09/2016" localizacao="data" />
<numero="5401" dataprevisa="29/09/2016" dataentrega="27/09/2016" localizacao="data" />
<numero="5400" dataprevisa="28/09/2016" dataentrega="28/09/2016" localizacao="" />
<numero="5399" dataprevisa="27/09/2016" dataentrega="" localizacao="" />
<numero="5403" dataprevisa="26/09/2016" dataentrega="" localizacao="" />
</origem>
<origem="123456785689">
<numero="5407" dataprevisa="26/09/2016" dataentrega="25/09/2016" localizacao="data" />
<numero="5401" dataprevisa="24/09/2016" dataentrega="27/09/2016" localizacao="data" />
<numero="5400" dataprevisa="25/09/2016" dataentrega="28/09/2016" localizacao="" />
<numero="5399" dataprevisa="15/09/2016" dataentrega="" localizacao="" />
<numero="5403" dataprevisa="13/09/2016" dataentrega="" localizacao="" />
</origem>
</notasfiscais>
</transportadora>
thsi si the correct xml
<?xml version="1.0" ?>
<transportadora dthratualizacao="27/09/2016 10:30">
<notasfiscais>
<origem="1234567889">
<numero="5407" dataprevisa="30/09/2016" dataentrega="30/09/2016" localizacao="data" />
<numero="5401" dataprevisa="29/09/2016" dataentrega="27/09/2016" localizacao="data" />
<numero="5400" dataprevisa="28/09/2016" dataentrega="28/09/2016" localizacao="" />
<numero="5399" dataprevisa="27/09/2016" dataentrega="" localizacao="" />
<numero="5403" dataprevisa="26/09/2016" dataentrega="" localizacao="" />
</origem>
<origem="123456785689">
<numero="5407" dataprevisa="26/09/2016" dataentrega="25/09/2016" localizacao="data" />
<numero="5401" dataprevisa="24/09/2016" dataentrega="27/09/2016" localizacao="data" />
<numero="5400" dataprevisa="25/09/2016" dataentrega="28/09/2016" localizacao="" />
<numero="5399" dataprevisa="15/09/2016" dataentrega="" localizacao="" />
<numero="5403" dataprevisa="13/09/2016" dataentrega="" localizacao="" />
</origem>
</notasfiscais>
</transportadora>
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.