Question Christine Nyamu · Jan 25, 2024

Comparing two contexts in a BPL in an IF

I am able to capture two values in two separate contexts in the BPL. One through an API call and another by looking at the contents of PV1:7. These are context.Prov  and context.ProvName. I am checking to see if the values contained in the contexts are the same and if yes process further and if not stop.

In the IF statement I tried the below but none worked. Can someone please tell me what I am doing wrong. The trace does show that they are the same value so that's not it. 

1. context.Prov = context.ProvName

2.  "context.Prov" = "context.ProvName" and

3.  context.Prov [ context.ProvName

Product version: IRIS 2021.2

Comments

Luis Angel Pérez Ramos · Jan 26, 2024

Maybe is there whitespaces in context.Prov? Have you tried to remove it? 

if$ZSTRIP(context.Prov,"<>W") = $ZSTRIP(context.ProvName,"<>W")
0
Christine Nyamu  Jan 26, 2024 to Luis Angel Pérez Ramos

Thanks @Luis Angel Pérez Ramos 
I tried your suggestion and unfortunately it didn't work. For context (no pun intended), both contexts are set as below:

0
Luis Angel Pérez Ramos  Jan 26, 2024 to Christine Nyamu

The API call is async? Maybe you are comparing both variable before to the end of the API call.

0
Christine Nyamu  Jan 26, 2024 to Luis Angel Pérez Ramos

@Luis Angel Pérez Ramos Thank you for all your help. 

It seems like it did not like the context = context scenario. What worked was putting this in the IF condition in the Management Portal. I also opted to check if NOT equal to

context.Prov '= request.{PIDgrpgrp(1).ORCgrp(1).PV1:7(1).2.1}

0