Skip to main content
Known Participant
Dec 24, 2022 5:48 PM UTC
Question

Refresh Interface after a!startProcess does not work

Hi,

We have a simple interface wich contains a refresh button that triggers a a!startProcess() function (to update some fields in Db and then update fields in the GUI). 
The interface is displayed from a RecordType view.
The process gets some data and then write simply the current datetime into an updated_on field in the table. 
The problem we met is when we click on the button, the data are not refreshed (or works just the first time). 
When we debug the variables in the interface we can see that the data are still the Old ones despite the fact the data are correct in the Db table. 
If we click again and again, the data are never refreshed. 
I've tried a lot of things :
- add a counter in the interface to ensure the save is called when the process ended
- all the process nodes are well chained. 
- I've deleted a lot of nodes in the process so that now it contains only 5 nodes (to be sure, to avoid the 50 nodes issues). 
- I've created a little testing snippet example and all works fine in another environment (with a Site, a RecordType, a process, a simple Interface and the Vehicle CDT example).

Would you have any idea why this problem occurs ? 


Regards 

24 replies

mikes0011
Brainy
Dec 25, 2022 3:17 AM UTC

Are you using an onSuccess save parameter to have the local form's data reflect anything about the data changed in the launched process?

Can you share your a!startProcess() code snippet here?

The Expression Guru
Known Participant
Dec 25, 2022 7:26 PM UTC

      a!buttonArrayLayout(
        buttons: {
          a!buttonWidget(
            label: "Update",
            icon: "refresh-alt",
            saveInto: {
              a!startProcess(
                processModel: cons!AS_PM_HISTO,
                processParameters: { projetId: ri!projetId },
                onSuccess: {
                  a!save(
                    local!history,
                    rule!as_qe_getHistoryWithFilters(
                      projectId: ri!projectId
                    )[1]
                  ),
                },
                onError: {
                }
              )
            },
            style: "SECONDARY"
          )
        },

Inspiring
Dec 25, 2022 2:45 PM UTC

Hi Cedric,

Did you try using a!refresh Variable function on the data you are refreshing from DB?

Known Participant
Dec 25, 2022 7:27 PM UTC

Yes, I've tried but without success

komalj3844
Participating Frequently
Dec 25, 2022 4:55 PM UTC

Have you applied Channing in the process called under a!startprocess , please do the channing till the db update. 

Known Participant
Dec 25, 2022 7:28 PM UTC

yes, Komalj, as I've wrote all nodes are chained. 

Known Participant
Dec 26, 2022 4:21 PM UTC

It is like if the interface does not succeed to get the fresh data from the Db.

Like a cache issue.

If I close the interface and then reopen it, the data are correct.