Legacy Knowledge Base
Published Jun. 30, 2025

DDMStorageAdapterSaveRequest has no possibility to distinguish between final Form Sending and Auto-save event

Written By

Sorin Pop

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • I am using a custom form storage adapter which calls an external service when the form is submitted.
    I noticed that in combination with the auto-save feature of Liferay Forms, this results in repeated calls of the external service.
    The "Save Answers Automatically" feature was introduced by Liferay to prevent a loss of form inputs, when the user needs more time or is interrupted, or even logs out. In my implementation I use the default storage mechanism of Liferay as a base, and I have an additional processing (including transfer to the external system) on final submit, when user confirms all inputs are complete.
    Switching on the "Save Answers Automatically" option results in repeated sending to external system, in intervals of about 1 minute (according to the default interval present in the product).

    In the saveRequest-Object (DDMStorageAdapterSaveRequest) and related API-documentation I found no possibility to distinguish between final form sending and a save event caused by auto-save.

  • Steps to reproduce:
    1. Build and deploy the sample custom storage adapter from this article: https://learn.liferay.com/w/dxp/process-automation/forms/developer-guide/writing-a-form-storage-adapter
    2. Create a new form that uses this storage adapter. (Auto-save is enabled by default, and it is set to 1 minute intervals bydefault)
    3. Put 2 pages on the form, each with a text field (to somewhat emulate a real life use case).
    4. Put the form on a page and start filling in the form: let's say, fill in the field on the first page, then go to the second page, and stop, do nothing for more than 1 minute.
    Result: in the logs you can see logs indicating that the auto-save event is triggered: "Acme storage adapter's save method was invoked", and also, if on the UI, you look at the form entries with another user, you will see that an entry with status Draft has been created.
    5. Finally, fill in the field on the second page and click Submit.
    Result: in the logs you see the same message, the same thing happens in the background, and on the UI, you can see that that form entry has now changed to Approved status (it has been finalized)

Environment

  • 7.4

Resolution

  • It has been confirmed that this is not a bug per se, however, it is something that might be worth analyzed in order to be potentially added somehow to the product in the future. To that end, a feature request ticket has been opened: https://liferay.atlassian.net/browse/LPD-16093 please feel free to follow it.
     
    Currently both auto-save and submit work with the same logic on forms, since they function as a save function. The only difference between them is the status; when auto-saving, the entry will be marked as a draft, while when submitting, it will be marked as approved. Therefore, the differentiation exists but isn’t used when with a storage adapter. Perhaps as a workaround you could leverage this status differentiation in order to achieve your goal.

 

Did this article resolve your issue ?

Legacy Knowledge Base