cancel
Showing results for 
Search instead for 
Did you mean: 

Condition Based Message Generation

Former Member
0 Kudos

Hi Folks,

     I have a scenario in PI where the business wants the message to be generated only if some conditions are satisfied else the message should not be created at all.

For example

Event

    <Header>

        <EVTID>

        <TRKID>

         <EVTDAT>

        <EVTTIM>

     <MESSAGE>

          <SENDERID>

         <PARAMETER_NAME>

         <PARAMETER_VALUE>

         <PARAMETER_INDEX>

Assume the above is my xml structure. I want to validate if <EVITID> has a valid value, <TRKID> is not blank and <EVTDAT> is not blank and <EVTTIM> is not blank then only generate the message else don't generate the message in PI at all.

A quick response is appreciated.

Regards,

   Santosh

Accepted Solutions (0)

Answers (4)

Answers (4)

markangelo_dihiansan
Active Contributor
0 Kudos

Hello Santosh,

Assume the above is my xml structure. I want to validate if <EVITID> has a valid value, <TRKID> is not blank and <EVTDAT> is not blank and <EVTTIM> is not blank then only generate the message else don't generate the message in PI at all.

You can use schema validation for this e.g for EVITID you can use xsd:enumeration for the valid values and for TRKID/EVTDAT/EVTTIM, you can use pattern with regex. That way, the message won't reach receiver determination if the validation fails.

Regards,

Mark

Former Member
0 Kudos

Hi Santosh,

You can use Xpath condition in RD

http://wiki.scn.sap.com/wiki/display/XI/Xpath+Condition+in+Receiver+Determination

Regards,

Karthikeyan S.

Former Member
0 Kudos

Hello,

U can put conditions in RD and if ur preliminary conditions are getting satisfied then determine receiver and generate ur mapping

/p1:MT_Message***/Event/Header[EVTID="1234" and count(TRKID)>0 and string-length(normalize-space(TRKID))>0 and count(EVTDAT)>0 and string-length(normalize-space(EVTDAT))>0 and count(EVTTIM)>0 and string-length(normalize-space(EVTTIM))>0]

Thanks

Amit Srivastava

Former Member
0 Kudos

Hi Santosh

Use the node function Create-If to generate message based on conditon. On the target side map message type with Create-If and use the condtion you wanto to use.

For example see the below map. The target will generate if name is John

Let me know if you have any doubts.