How to auto-close and submit a form (without an User action)

Certified Senior Developer

Hello,

I would like to know how may I trigger a submit action to a form, without a manual User action please ?

(it could be in using a timer...  for example, submitting the form after 10 seconds)

I saw some related posts around Javascript, but is it possible to do this with Appian ?

Regards

  Discussion posts and replies are publicly visible

Parents Reply Children
  • +1
    Certified Senior Developer
    in reply to Mike Schmitt

    Thank you Mike, I am testing a scenario... where a process contains a lot of nodes (let's say 50 nodes for a full saving process).
    I would like to break the process in 2 sub process, with a form displaying a message ("saving in progress...").

    But I would like this to be completely automatic.

  • 0
    Certified Lead Developer
    in reply to cedric01

    You can basically do that - but it will require user interaction to submit the form as always.  I usually just make a button with a "refresh" icon, and if they click it when the background process is completed, it proceeds to the next chained task.

  • 0
    Certified Senior Developer
    in reply to Mike Schmitt

    Ok Mike, I thought it would be possible within Appian (as it is possible to do it with Javascript).
    So, the only way would be to deal with exception.

    As Naven has suggested, I may try to deal with an Exception ?
    I would like test to throw an exception after a 10 seconds delays. Could you explain me how to set this delay please ?

  • 0
    Certified Lead Developer
    in reply to cedric01

    I provided the expression you can use to create a 10 second delay in my reply on the other thread below.  However I'm curious what you are intending the user-facing experience to be with this?  In most cases it's not a good idea to cause the task to expire by exception unless you believe the user has probably abandoned it.

  • 0
    Certified Senior Developer
    in reply to Mike Schmitt

    Mike, I was just looking for a workaround to cut a very long process model (70 nodes)  into 2 sub processes, then, in loading a form that displays the "Saving data in progress" message during 10 seconds. Just to cutting my process.
    The User does not have to click on Submit because the data saving are still in progress and the process is not waiting for him.

    You're right, the Exception is not a good solution, as we put the process in error (for a process that is not in error), but I'm looking for a good solution, I don't have.  

  • 0
    Certified Lead Developer
    in reply to cedric01

    I'm still not sure what you're hoping the user-facing experience will be.  Are they going to be seeing a task while the "saving" processes run?  Do you intend for them to go from that task directly to the next chained task, or to navigate away and do something else?

  • 0
    Certified Senior Developer
    in reply to Mike Schmitt

    Sorry Mike if my explanations are not clear enough...
    Here is the full process I would imagine:

    - The user start the process model (70 nodes) of updating data (many DB tables to update).

    - A start form (A) is displayed with a lot of field to fill

    - The User enters values in all the fields, and click on submit to validate the form (A)

    - The saving data is started

    - because of the very important size of nodes (causing an error when size > 50 nodes), we call another Form (B) in the middle of the saving data process model, and this form just displays a simple message "Data saving in progress...". The goal of the form (B) is just to cut the process model.


    - The new form (B) is displayed... and then, 10 seconds after, it is auto-submitted without any User action, and then is auto-closed.

    - The process model can continue, until the end, without error because it has been cutted into 2 sub processes (35 nodes each).

  • 0
    Certified Lead Developer
    in reply to cedric01

    There may be a simple solution then, since there is no further User task in the sequence.

    On the task in question, you can say "saving in progress... you can now navigate to a different tab" etc.  Do not give a submit button or any other way for the user to submit.  The user will leave the form by clicking to a different tab/etc.  You can then safely auto-complete the task via timer after any interval (you can do 1 minute or any other length), without affecting the user's experience.

    This is the way I've handled similar cases in the past and it works decently.

  • 0
    Certified Senior Developer
    in reply to Mike Schmitt

    I'm not sure to understand.

    in your solution, as you are not decreasing the number of successives nodes executed... the error would persist.

    In our system configuration, exceeding 50 nodes causes any process to be aborted.

  • 0
    Certified Lead Developer
    in reply to cedric01

    A 50-node process doesn't automatically abort; that's just the limit of nodes between two chained user interaction tasks.  If you're experiencing something different, then you might have a more severe error in your environment, because this is NOT a limitation of Appian that I've ever seen.

    In my example above, the process would continue running in the background and complete anything it needs to complete, both before and after the user-facing "saving in progress..." task expires.