Privilege issue while performing Query Rule in XOR Gateway

Hi Everyone,

I have a process where the start even can be either started with a Start Form or with an Email.

Once the start event is completed i have a Script Task to build the CDT.

Now i have a XOR gateway placed after Script Task to check for the duplicate records(I am performing a Query Entity here to check details from DB).

If there is a record already in DB with same details entered then this could be considered as Duplicate and the XOR will direct the flow to End Event if not it will write details to DB.

Now the issue i am facing is......

Everything works fine if i trigger the process through Start Form. But if i trigger this through email, the process gets stuck at XOR gateway stating below error message.

ERROR: Expression evaluation error in rule 'test' at function a!queryEntity: The data store entity does not exist, has been deleted, or you do not have sufficient privileges to access its data.

PS: I have checked the security settings of almost everything(Query Rule, Constant, Data Store, Process Model). i am in the Admin group for all these.

Kindly let me know if i am missing something here.

 Discussion posts and replies are publicly visible