Uploaded image for project: '[Read Only] - Hippo Site Toolkit 2'
  1. [Read Only] - Hippo Site Toolkit 2
  2. HSTTWO-3790

Update javadoc of WPM to recommend best practices



    • Type: Task
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.1.0
    • Component/s: None
    • Labels:
    • Similar issues:
    • Processed by team:
    • Sprint:
      Platform Sprint 140


      Regarding the usages of the update() and save() methods of the WorkflowPersistanceManager we have a best practice. An example online reflects this (1), but I think it should be clear from the javadoc as well.

      1.) https://www.onehippo.org/library/concepts/rest/restful-jax-rs-component-support-in-hst-2.html

      Although it is at the moment technically not necessary to call WPM.save() after a call to WPM.update(), it is actually recommended. Please check if there are more methods in this class that can reflect a best practice.

      More background in a comment from Woonsan Ko:

      • At the moment, wpm.update() is actually saving the intermediate changes before invoking wpm.save(), which is not that correct semantically. However, it had to be done that way due to our Hippo workflow designs (and limitations). Hippo workflow API doesn't provide "all-or-nothing" semantics. If you fail to save something through Hippo workflow in the final step, it leaves an intermediate garbage states as a result. Therefore, we had to accept that limitation by invoking session.save() even in the intermediate #update() call (which is semantically meaning intermediate updates before committing).
      • However, I and Ard agreed that we need to keep wpm.save() separately and recommend people to use the call after wpm.update() because a) it's semantically more correct and b) in the future, we may improve Hippo Workflow internal API to support all-or-nothing transactional mechanism.




            • Assignee:
              bleunis Bert Leunis (Inactive)
            • Votes:
              0 Vote for this issue
              3 Start watching this issue


              • Created: