Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a job where it extracts all the IDs from an API and these IDs are passed into another API to get further details. Now the requirement was to ignore some of the IDs from the above and the list was supposed to be dynamic.
Basically I needed something similar to "Not IN" condition of Sql.
Solution: I stored the Ids in context value in format ID1 | ID2 | ID3 |ID4 and added below condition in tMap which essentially does the job.
!((String)globalMap.get("id")).matches(context.EXCLUDED_ID)
Hello,
Instead of matches make use of equals.
!((String)globalMap.get("id")).equals(context.EXCLUDED_ID)
Thanks
Hi,
My excluded ID has a variable number of IDs and equals function can compare with only one ID. And this is the reason I'm using matches. It can compare any number of IDs stored as ID1|ID2|ID3|ID4|... in context.