on 09-27-2013 12:34 PM
Hi All,
I have a scenario that PI should fail the mapping if value is not present(empty value) for a selective fields.
is there is any standard way to fail the mapping if value is empty space or tag is not present or we have to write UDF for this?
Note: Mandatory field means that Value is required for Business and its a optional field from source.
Regards,
Mani
Mani,
Have you tried experimenting with the occurrence for the fields in the data type? If this check needs to be done on the Target XSD, mapping will fail if the field is unavailable in the source.
Hope that helps.
Rakesh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Note: Mandatory field means that Value is required for Business and its a optional field from source.
if the field is optional in source and mandatory in target, how can you run interface successfully. it will fail in mapping step in pi. but as per source system this is correct one.
Say you have thrown error when field is empty. after that what are you going to do? Going to ask source system to send the value for the field again. if you go for such a scenario it will be difficult to handle while doing support.
You have to ask the source system to send the data as per target requirement. else make your message mapping which gives correct output as per target system requirement.
You can go for xml validation which is standard one for validating your message. this is used to make sure target system is getting correct message as per xsd definition even though source is sending correct message.
If you can not catch it with xml validation you can go for udf as mentioned amit.
Regards,
Muniyappan.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you are want to do validation for more fields then
1)Use java mapping with good coding skills (instead of UDF's) and avoid using AE engine validation concept.
2)Always best practice to use validation at sender side before hitting data to PI.
Regards,
Raja
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mani,
Few cents...
IMO, if some field is mandatory for business, it should not be optional at source. You can throw custom exception to fail the mapping but it is not a good design. I don't think an interface should be designed to fail in PI.
Ideally if a field is mandatory for ECC, it should be populated by source system. Source system should take care of this validation and skip the records.
Hope it helps!
Ambrish
Hope
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Manikandan,
Is the scenario synchronous or asynchronous?.
If the scenario is asynchronous go ahead with Amit Srivastava suggestion, if the scenario is synchronous the source system is waiting a response and to get an exception is not a good idea, i would talk with the target endpoint system developers in order that they control the error and to get a logic error for the source response.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This can be handled by using XML validation at adapter engine level. Byusing that all the fields that are there in payload can be verified. Search SDN for more details on XML validation.
Another way yu can make the field mandatory in PI and mapping will fail if it does not get any value.
Regards
Gaurav Ranjan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.