Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-6584

Refactor the order in which code blocks are executed for *ServiceImpl.add / update

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: 5.1.2, 5.2.3
    • Fix Version/s: 5.2.3
    • Component/s: WCM
    • Labels:
      None
    • Branch Version/s:
      5.2.x, 5.1.x
    • Backported to Branch:
      Committed

      Description

      The order in which service add and update methods are implemented have not been standardized so far. This leads to confusion as to the order in which events are fired (which affects how listeners work).

      For example, if Expando attributes are stored AFTER the model is updated, then model listeners will never have access to those expando attributes. See LPS-4728.

      The method updateStatus also requires that certain logic happen when a workflow piece is updated. When should a social activity be logged? (ie only when a model is approved).

      When should email be sent? Only after everything is persisted. You should never send an email if there is still a possibility the rest of the method can choke because of a rollback.

      The new standard should therefore be:

      When "adding"

      expando, model, resource, portal package, local package, other package, indexer, status, file, email / subscribers, ping

      When "deleting"

      model, resource, portal package, local package, other package (expando is in here) indexer, status, file, email / subscribers, ping

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  8 years, 42 weeks, 2 days ago

                  Packages

                  Version Package
                  5.2.3