Need to cover few scenarios in pipeline

Hi,
I have a multiple scenario to cover in a pipeline.
1)read an xml, validate the xml , send mail mentioning xml file name that it is not valid.
2)create lookup out of csv file which will have number, name, s1.
3)if xml is valid, check if <V_number> exists in lkp(number).
if yes, then transform the xml and name the output file with <V_number>_lkp(name)_timestamp.
4)if <V_number> does not exists in lkp(number) stop the execution and send mail mentioning xml file name.

I am able to transform the xml. My current pipeline looks like below:-
image

Hi @Supratim ,
Any idea here.

@Sahil You can try with below option-

1)read an xml, binary router(both expression with true), use binary to document snap with NONE option, use mapper (map - file name from content)
** ,Inner Join use 1 in both path (it will give you filename with all xml parse json element )
2)Read CSV file and create lookup element.
3)Do inner join with both flow using common name (also open error view of join snap and select Unmatched data to error view)
if yes, use mapper success to map required data then transform the xml and name the output file with <V_number>_lkp(name)_timestamp.
4)if <V_number> does not exists in lkp(number) stop the execution and send mail mentioning xml file name.

Hi @Supratim ,
I am fairly new to snaplogic. please excuse me for silly questions.
scenario (1) is not fulfilled, where we need to validate the xml and send mail if xml is invalid.
and I am stuck at 3 positions:-
a) map - file name from content
b)mapper all required element
c)Not match email sender
content-location object has value: “sldb:///Dev/Interfaces/input_1.xml”

Hi @Supratim ,
Ignore my earlier comment, I am able to achieve all the scenarios except (1).
and after inner join still few of the remaining records are going to email send, which should not be the case.

Hi @Supratim ,
And XML formatter after Mapper1 is not allowing file name to pass.
How to name the output file in file writer.

  1. As i am not sure about your data set, might creating confusion. Try this option- For join - first inter change input0 (38) to input 1(csv parse ) and use left outer / outer join ,also uncheck unmatch error view option. Then can use router to determine you found the correct lookup data or not. If found then save in file else send mail.
  2. For file name , creat a child pipeline with xml parser and file write (also remove these from parent)Add one pipeline param (filename ) in child pipeline and use that in file write. Call this child pipeline using pipeline execute.

Thanks,
Supratim
(+91)923-263-3466

This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient(s), please reply to the sender and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email, and/or any action taken in reliance on the contents of this e-mail is strictly prohibited and may be unlawful. Where permitted by applicable law, this e-mail and other e-mail communications sent to and from Cognizant e-mail addresses may be monitored.

Hi @Supratim ,
I will try it, How to validate input xml after reading it at the starting and sending a mail if it is invalid.

using xsd in xml parser snap can validate your input xml. Make sure to open error view of xml parser to capture error message.

Thanks,
Supratim
(+91)923-263-3466

This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient(s), please reply to the sender and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email, and/or any action taken in reliance on the contents of this e-mail is strictly prohibited and may be unlawful. Where permitted by applicable law, this e-mail and other e-mail communications sent to and from Cognizant e-mail addresses may be monitored.

Hi @Supratim ,
For child pipeline, it is showing error:-
Failure: Snap is not connected to any upstream source, Reason: Snap failed unexpectedly and did not provide any reason

image

That’s fine , when you call child pipeline from parent will not get error

Thanks,
Supratim
(+91)923-263-3466

This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient(s), please reply to the sender and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email, and/or any action taken in reliance on the contents of this e-mail is strictly prohibited and may be unlawful. Where permitted by applicable law, this e-mail and other e-mail communications sent to and from Cognizant e-mail addresses may be monitored.