cancel
Showing results for 
Search instead for 
Did you mean: 

Conditions during interface determination (urgent)

Shabarish_Nair
Active Contributor
0 Kudos

Hi all,

well i am using <b>conditions</b> during <b>Interface Determination</b> and according to the result of the condition a mapping program is triggered.

Now i am using <b>XPath.</b>

In my file i have a field called amount. The total of the amount field is stored in the trailer in a field called total.

Is there anyway that using XPath i can check if the sum of the amount field that r in the file is equal to the value in the total field?

a sample file would be as shown below ...

01xxxxxxxxxxxxxxxxxx -


header

02xxxxxxx10000xxxxxx ---

02xxxxxxx20000xxxxxx | body

02xxxxxxx10000xxxxxx ---

03xxx40000xxxxxxxxxx -


trailer

eg.

the sum of the amount field in the body (100002000010000) should be compared to that

in the trailer (40000) [the values in the amount field

will vary so does the total accordingly ]

can anybody suggect a solution ??

Regards,

ShabZ

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

1) Create an message interface for intermediate purposes.(which will have a field "flag" ).

2) Design a mapping which performs your validations, (sum of body == trailers) (success/ failure) and assign the same to the intermediate Message interface ( set the flag).

3) Now you can use this flag value and perform a interface determination.

Hope this helps you.

Regards,

Siva Maranani.

Former Member
0 Kudos

Hi Shabarish,

The only thing I can think off at the moment is to check the calculation in a BPM and set the "send context" property of the send step (so two send steps, one for equal, one for not equal) and check this value in the interface determination.

Cheers,

Frank

Shabarish_Nair
Active Contributor
0 Kudos

Hi Frank,

Would xpath functions work, eg. compare , sum etc ?

the twist in the scenario is that if the validations fail then a output say A has to be generated and if its a success a different one say B has to be generated. And accordingly are to be sent to two different folders (2 diff. Comm. Channels).

Thanks,

ShabZ

Former Member
0 Kudos

"standard" XPATH functions don't work - only the ones @ the top of the condition editor that are provided to you. The lower XPATH area isn't for free-form entry, unfortunately.

Shabarish_Nair
Active Contributor
0 Kudos

We did try using some functions and it gave surprising results...... eg. use compare and an error is thrown during interface determination in sxmb_moni, then we tried sum, and wow no error at all, but guess what the sum operation is not at all executed :-((

anyway, thanx all for your inputs....

ShaBZ