Skip to main content
April 25, 2025
Question

How do I retain values in Local Variable after a!startProcess

  • April 25, 2025
  • 7 replies
  • 0 views

I have a button on an interface that is used to start Process using a!startProcess in the background. Now I want the values of the field to be retained. Once the process the completed, all the local variables are refreshed to empty or null values. How do I retain these values.

For other fields I am using ri! but for a particular values that I am having operations on in the interace I am bound to use local variable here. Am I missing something here? I tried using rule inputs, but the usecase requires me use a local variable here. Also tried saving this to an ri! and onSuccess saving back to local! but that didn't help. Any help or direction that I should be looking towards to solve this?

7 replies

stefanhelzle0001
April 25, 2025

In my interfaces a!startProcess does not refresh anything unless I add a bunch of a!save(). Can you share some code?

April 25, 2025

I have my local Variable local!initialReminder which is sent to a separate section Inteface, The values are populated there.

My Button SaveDraft has a a!startProcess inside a SaveInto parameter. before that I'm doing a bunch of saves but that's on different CDT. OnSuccess I'm further doing some saves but those are on Process variables again different CDTs, My local!initialReminder  is not touched. Except this particular save which passes this variable

a!save(
                ri!reminderEmailDetails,
                rule!EA_prepareReminderList(
                  initialReminder: local!initialReminder,
                  beforeDueDateReminder: local!beforeDueDateReminder,
                  afterDueDateReminder: local!afterDueDateReminder,
                  finalReminder: local!finalReminder,
                  isPreDeadLineReminderChecked: local!ispreDeadLineReminder,
                  isPostDeadLineReminderChecked: local!ispostDeadLineReminder,
                  isBreachReminderChecked: local!isBreachReminder,
                  adhocReminder: local!adhocReminder
                )
              ),

Also this save is before my startProcess.

stefanhelzle0001
April 25, 2025

What is this "Save Draft" button doing? Does it submit?

mathieud0001
April 25, 2025

I would assume that you can save to the local variable via the onSuccess.

April 25, 2025

I'm passing this value via a local!Variable to a separate interface , wouldn't it be redundant to save localVariable back to the same Variable?

Tried this approach as well just to try my luck,  but alas!

onSuccess:{
                a!save(local!draftBtnClicked, true),
                a!save(ri!attestationDetails, fv!processInfo.pv.attestationDetails),
                a!save(ri!questions, fv!processInfo.pv.questions),
                a!save(ri!reminderEmailDetails, fv!processInfo.pv.reminderDetails),
                
                a!save(local!initialReminder, local!initialReminder)
                }

Here's how my sectionLayout that hold the particular screen is: Is this a wrong approach?

a!sectionLayout(
                  contents: {
                    rule!EA_captureReminderDetails(
                      attestationDetails: ri!attestationDetails,
                      initialReminder: local!initialReminder,
                      adhocReminderEmail: local!adhocReminder,
                      isModifybuttonSelected: local!isModify,
                      /*attestationAddInfo: ri!attestationAddInfo,*/
                      parentAttestationAddInfo: ri!parentAttestationAddInfo
                    )
                  },
                  showWhen: local!activeStep = 4
                ),