cancel
Showing results for 
Search instead for 
Did you mean: 

Condition editor question

Former Member
0 Kudos

Hi guys,

i am little bit confused about condition editor in interface determination. We have following requirement;

CASE1 (MAPPING A)

/SAPBridge/SAP/TransactionType = 111  AND /SAPBridge/SAP/SubFields/ProductStatus = AAA  OR

/SAPBridge/SAP/TransactionType = 111  AND /SAPBridge/SAP/SubFields/ProductStatus = BBB  OR

/SAPBridge/SAP/TransactionType = 111  AND /SAPBridge/SAP/SubFields/ProductStatus = CCC

CASE 2 (MAPPING B)

/SAPBridge/SAP/TransactionType = 111  AND /SAPBridge/SAP/SubFields/ProductStatus != AAA  OR

/SAPBridge/SAP/TransactionType = 111  AND /SAPBridge/SAP/SubFields/ProductStatus != BBB  OR

/SAPBridge/SAP/TransactionType = 111  AND /SAPBridge/SAP/SubFields/ProductStatus != CCC

The input value with TransctionType = 111 and Productstatus BBB give me MAPPING A  and MAPPING B as result. Normally CASE 1 was expected.

Can anyone assist me? Thank you in advance,

PM

Accepted Solutions (0)

Answers (5)

Answers (5)

former_member187010
Participant
0 Kudos

Hi Peter,

You can easily achieve this.

Hope this helps you.

Regards

Jitender

Former Member
0 Kudos

Hi Jitender,

as you mentioned i do that. But without success. I think PI has a BUG in condition editor. Is there any another way to solve this?

Kind Regards,

PM

Former Member
0 Kudos

Hello Peter,

Srinivas, Indrajit and Mikhail already gave you the correct answer. In your example, the first line of condition B gives "true", and since your connectors are all "or" the system can stop evaluating and will give "true" as result for condition B. Change those "or" to "and", and it should work as intended.

Regards,

Jörg

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Peter,


CASE1 (MAPPING A)

/SAPBridge/SAP/TransactionType = 111  AND /SAPBridge/SAP/SubFields/ProductStatus = AAA  OR

/SAPBridge/SAP/TransactionType = 111  AND /SAPBridge/SAP/SubFields/ProductStatus = BBB  OR

/SAPBridge/SAP/TransactionType = 111  AND /SAPBridge/SAP/SubFields/ProductStatus = CCC

CASE 2 (MAPPING B)

/SAPBridge/SAP/TransactionType = 111  AND /SAPBridge/SAP/SubFields/ProductStatus != AAA  OR

/SAPBridge/SAP/TransactionType = 111  AND /SAPBridge/SAP/SubFields/ProductStatus != BBB  OR

/SAPBridge/SAP/TransactionType = 111  AND /SAPBridge/SAP/SubFields/ProductStatus != CCC

Can you try this:


Case1

/SAPBridge/SAP[(TransactionType = "111" and SubFields/ProductStatus = "AAA") or (TransactionType = "111" and SubFields/ProductStatus = "BBB") or (TransactionType = "111" and SubFields/ProductStatus = "CCC")]


Case2

/SAPBridge/SAP[(TransactionType = "111" and SubFields/ProductStatus != "AAA") or (TransactionType = "111" and SubFields/ProductStatus != "BBB") or (TransactionType = "111" and SubFields/ProductStatus != "CCC")]

Use the EX operator, looks like you don't need multiline checked too

Hope this helps,

Mark

former_member192343
Active Contributor
0 Kudos

Hi

it is boolean algebra

let

TrType111 is  /SAPBridge/SAP/TransactionType =111

AAA           is  /SAPBridge/SAP/SubFields/ProductStatus = AAA

BBB           is  /SAPBridge/SAP/SubFields/ProductStatus = BBB

CCC          is  /SAPBridge/SAP/SubFields/ProductStatus = CCC

Then for

Case1

TrType111 & AAA || TrType111 & BBB || TrType111 & CCC = TrType111 & (AAA  || BBB || CCC)

in case2, I guess, you need inversion of second operand
TrType111 & !(AAA  || BBB || CCC)=TrType111 & (!AAA  & !BBB & !CCC)

Regards

Mikhail

Former Member
0 Kudos

Hi

Add the condition for second mapping as

/SAPBridge/SAP/TransactionType = 111  AND /SAPBridge/SAP/SubFields/ProductStatus != AAA  AND

/SAPBridge/SAP/TransactionType = 111  AND /SAPBridge/SAP/SubFields/ProductStatus != BBB  AND

/SAPBridge/SAP/TransactionType = 111  AND /SAPBridge/SAP/SubFields/ProductStatus != CCC

or try this if that did not work

(/p1:/SAPBridge/SAP/TransactionType = 111 AND /p1:/SAPBridge/SAP/SubFields[not(contains(ProductStatus,'AAA'))] EX          AND

(/p1:/SAPBridge/SAP/TransactionType = 111 AND /p1:/SAPBridge/SAP/SubFields[not(contains(ProductStatus,'BBB'))] EX         AND

(/p1:/SAPBridge/SAP/TransactionType = 111 AND /p1:/SAPBridge/SAP/SubFields[not(contains(ProductStatus,'CCC'))] EX

example

former_member191435
Contributor
0 Kudos

Hi PM,

You have given the OR condition... OR Condition will execute if any one of the condition is true...AND condition will work if all the conditions satisfies then only execute..

In your case...

The input value with TransctionType = 111 and Productstatus BBB  it will given both mappings y because is anywat 1st mapping will come because it satisfy the condition... 



For case 2:

You have given Productstatus != BBB  but in OR condition it is satifies Productstatus ! = AAA ... So, this is the reason it is executing the 2nd mapping... If you dont want second mapping execution use AND operator...

Thanks,

Sreenivas