cancel
Showing results for 
Search instead for 
Did you mean: 

Fail the message in PI, on validation failure

former_member216353
Participant
0 Kudos

Hi all,

We are working on PI 7.4 SP07 single stack system.

For a particular interface (File(FTP)-->PI-->ABAP Proxy) the requirement is to fail the message in PI and raise an alert if the value for a specific field (say BatchID) in the source file is maintained in lower case.

What is the best way to achieve this requirement.

Please share your thoughts and inputs.

regards,

Younus

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi Mohammed

First of all my recommendation is to validate the information in the source system. Why? Because if you reject the data in the target system finally you force the source system to apply validations. A validation in the source system implies a better perfomance in the network dataflows.

Although you can validate the data in a mapping with a UDF, this wouldn't be my recommendation.

You can enhance data structure definition with validations like the previous post and actívate in the integration builder elements (adapter or integration engine), Then i would define an alert in PI for this interface.

All depends on the way you need to keep informed the users about the errors or in the kind of validations. Validate uppercase letters it's very simple but  for example you would be to used the target system to validate certain values for a field.

Kr

former_member184720
Active Contributor
0 Kudos

Hi Younus - If you can modify the source xsd, then may be you can go for schema validation option which way you don't need to execute the mapping.

something like this -

XML Schema Restrictions/Facets

The next example defines an element called "initials" with a restriction. The only acceptable value is THREE of the UPPERCASE letters from a to z:

<xs:element name="initials">
  <xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:pattern value="[A-Z][A-Z][A-Z]"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>

former_member189420
Active Participant
0 Kudos

Hi Mohammed,

We had similar situation. We used enhanced receiver determination to perform the validation (operation mapping). Here you can pass the Receiver1 (Mail System) and Receiver2(Proper Business System if successful) as parameters. So that you can change them in different landscapes. Then based on the receiver determined subsequent operation mapping can be performed again.

Hope it helps!

Cheers,

Anand Patil

Former Member
0 Kudos

Hi Yonus,

I would recommend the below option rather than failing the mapping in PI .

Check the condition and notify to Business for condition failure .So that they can correct the file and places again

1)Use the Enhanced Receiver Determination and check the condition based on this open either mail or ECC Business component/Business system.

2)Create 2 mappings one for mail and other for ABAP Proxy communication.

-------------------------------------------------

There is also an option to fail @ mapping level by throwing a custom exception .

throw new StreamTransformationException("$$$BatchID field value is in lower case$$$");

Regards

Venkat

Former Member
0 Kudos

Hi Younus,

I would suggest use a UDF to check if the batchID is in lowercase. If its lowercase, you can either fail it in the UDF itself or pass 0 as return value and map it to the Root Node.

In both the cases we are trying to fail the mapping.

Thanks & Regards,

Tejas Bisen

Former Member
0 Kudos

Hi Younus,

Can you please validate the case sensitivity of the particular field value in mapping itself.

Thanks,

Venkat B.