Class FormsDuplicationService

java.lang.Object
sk.iway.iwcm.components.forms.FormsDuplicationService

@Service public class FormsDuplicationService extends Object
Duplicates multistep forms together with their settings, steps, items, and item conditions. The service preserves relationships between copied records by mapping original step and item IDs to their newly generated IDs. Duplication is performed in a single transaction.
  • Constructor Details

  • Method Details

    • duplicateMultistepForm

      @Transactional(transactionManager="webjet2022TransactionManager") public FormsEntity duplicateMultistepForm(FormsEntity duplicate, Long originalId, int domainId)
      Creates a copy of a multistep form and all records that define its structure and behavior. The supplied form provides the new form name and may provide replacement settings. Serialized form data is copied from the persisted original, while counters and database identifiers are reset.
      Parameters:
      duplicate - form entity to populate and persist as the copy
      originalId - database identifier of the form to copy
      domainId - domain in which the original is resolved and the copy is created
      Returns:
      persisted form entity representing the copy
      Throws:
      IllegalStateException - if the input is incomplete, the original is not a multistep form, or copied relationships cannot be reconstructed