Execution of actions after Question.Reply doesn't work?

If you think that something doesn't work in Aware IM post your message here
Post Reply
andreic
Posts: 29
Joined: Mon Nov 15, 2021 11:09 pm

Execution of actions after Question.Reply doesn't work?

Post by andreic »

Hi,
If I understand correctly, this should be the correct sequence in a process when using DISPLAY QUESTION:

rule1: DISPLAY QUESTION 'question'
rule2: IF Question.Reply='Yes' THEN DoSomething
etc

I have set up a simple example in which rule2 is supposed to change the value of an attribute.

There seems to be a problem with the execution of rule2 - according to the log it is executed correctly, but in fact it does not change the value of the attribute in normal operation.
Test log extract.PNG
Test log extract.PNG (17.2 KiB) Viewed 2329 times
Moreover, this does work when running through the process step by step using the debugger. The value of the attribute is then correctly changed.

bsv example attached:
Test_20220616_1051_Question.bsv.zip
(44.19 KiB) Downloaded 443 times
Is this a bug or a feature?
aware_support
Posts: 7523
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Re: Execution of actions after Question.Reply doesn't work?

Post by aware_support »

Your BSV works for me. Most likely, the problem is that the form does not refresh itself automatically to show the changes. If you refresh manually you can see the change to the attribute. To get the form to refresh automatically add the process to the list of processes in the Auto Refresh property of the form.
Aware IM Support Team
andreic
Posts: 29
Joined: Mon Nov 15, 2021 11:09 pm

Re: Execution of actions after Question.Reply doesn't work?

Post by andreic »

In the test bsv, if I add the process to the refresh settings of the form, it does update and show the updated value.
However, if the process is not there, the value is NOT changed at all, even if the test log says that the action is executed.

In the actual application, the log doesn't even show an evaluation of the condition:
log.PNG
log.PNG (3.93 KiB) Viewed 2312 times
The process as I said very simple:
process.PNG
process.PNG (2.54 KiB) Viewed 2312 times
It works only when this is run step by step in the debugger.

It doesn't matter if the process is added to the refresh settings of the form.
aware_support
Posts: 7523
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Re: Execution of actions after Question.Reply doesn't work?

Post by aware_support »

The process definitely works for me. The value does change. Whether the process is in auto-refresh settings or not only affects auto-refresh, never the change itself. To avoid confusion check the value directly in the database.
Aware IM Support Team
andreic
Posts: 29
Joined: Mon Nov 15, 2021 11:09 pm

Re: Execution of actions after Question.Reply doesn't work?

Post by andreic »

You are absolutely right, I realized what my mistake was. The value does change in the database. In the test bsv, after the value change I had been clicking the save button to close the popup. Without a refresh to re-read the value from the db, the current value in the attribute was left unchanged, and so it was saved over the value in the db again and I was convinced that it doesn't work...

We need a facepalm emoji here.. :(

Thank you for your help!

EDIT: As you can see in the screenshot of the log of the actual application, at some point the rule was really not evaluated for whatever reason. This still happens - the process sometimes doesn't work, and after a few more clicks, it does.

EDIT 2: When the debugger is used to go step-by-step, it always works.
Post Reply