Skip to main content
February 2, 2022
Solved

Prevent refresh on local variable based on queryentity()

  • February 2, 2022
  • 5 replies
  • 0 views

Hi All,

I have a local variable defined within load() which retrieves data from one of the table using a!queryentity() .

local!data: rule!getAllData(id)

Whenever there is an insert or update happens in the table , local!data pulls the new values on performing a refresh of the page from the browser .

My requirement is that i dont want to query the table again even though i refresh the page from the browser . Basically i want to retrieve the data from database only once when the task is generated . 

Please can you help me with this problem.

Thanks in advance .

Best answer by mikes0011
Also, why m I using load() is because these applications have been developed way long back

That makes sense - just checking.  I suggest you prioritize changing this over to a!localVariables as soon as you can, though.

what should be my approach to handle all the active tasks or instances in PROD

That highly depends on what you hope to happen with active instances.  You won't be (easily) able to amend active instances to query the data prior to the task, so any changes you make should ensure that active tasks can continue working at least as they currently do.  New instances can get your new desired behavior.  This could be accomplished by editing the interface to check whether a value was passed in from the process, and if so, the interface uses that value, and if not, then it does the query as it does currently.  This would allow you to safely add the functionality to pass the data in from the process but have existing instances of the task continue to work as-is.

5 replies

mikes0011
Brainy
February 2, 2022
i dont want to query the table again even though i refresh the page from the browser .

The only way to do this is to query the data in the process prior to the task and pass the queried data into the task as a rule input - fairly easy to do.

Also: why are you using load()?  Are you really on a 3+ year old Appian installation?

The Expression Guru
February 3, 2022

Hi Mike - Thankyou for your response . 

If its the only way then what should be my approach to handle all the active tasks or instances in PROD ?  I can only think of closing all the tasks before this change goes to production . Is there any alternative ? 

Also, why m I using load() is because these applications have been developed way long back and I agree its not fully updated with latest features [emoticon:c4563cd7d5574777a71c318021cbbcc8] definitely we have to do this in future .

mikes0011
mikes0011Answer
Brainy
February 3, 2022
Also, why m I using load() is because these applications have been developed way long back

That makes sense - just checking.  I suggest you prioritize changing this over to a!localVariables as soon as you can, though.

what should be my approach to handle all the active tasks or instances in PROD

That highly depends on what you hope to happen with active instances.  You won't be (easily) able to amend active instances to query the data prior to the task, so any changes you make should ensure that active tasks can continue working at least as they currently do.  New instances can get your new desired behavior.  This could be accomplished by editing the interface to check whether a value was passed in from the process, and if so, the interface uses that value, and if not, then it does the query as it does currently.  This would allow you to safely add the functionality to pass the data in from the process but have existing instances of the task continue to work as-is.

The Expression Guru