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

NoSuchWorkflowDefinitionLinkException in case of importing a JournalFolder with a workflow configuration.

    Details

      Description

      NoSuchWorkflowDefinitionLinkException in case of importing a JournalFolder with a workflow configuration.

      This bug was caused by LPS-85726 and it is produced in case you have a JournalFolder with a workflow configuration and:

      • You publish the JournalFolder to Live in a environment with Staging Remote configured.
      • You export the JournalFolder and import it in a different Liferay installation
      • You export the JournalFolder, you delete it and import again in the same Liferay installation

      Steps to reproduced

      1. Go to Site =>Content => Webcontent section
      2. Create a JournalFolder
      3. Configure the JournalFolder with the "Single Approver" workflow
      4. In Webcontent section, go to the kebab menu in the top right and open "Export/Import"
      5. Export LAR file with the JournalFolder
      6. Delete created JournalFolder:
        1. Send it to the "Recycle Bin".
        2. Go to the "Recycle Bin" and empty it.
      7. Import the LAR file:
        • Expected behavior: LAR file is imported without problem
        • Wrong behavior: LAR file is not imported, a NoSuchWorkflowDefinitionLinkException is thrown and following message is displayed in log file:
          2019-08-05 11:57:36.211 ERROR [liferay/background_task-1][BackgroundTaskMessageListener:173] Unable to execute background task
          com.liferay.exportimport.kernel.lar.PortletDataException: No WorkflowDefinitionLink exists with the primary key 35502
                  at com.liferay.exportimport.internal.lar.PortletDataContextImpl._importWorkflowDefinitionLink(PortletDataContextImpl.java:3003)
                  at com.liferay.exportimport.internal.lar.PortletDataContextImpl.importClassedModel(PortletDataContextImpl.java:1592)
                  at com.liferay.exportimport.internal.lar.PortletDataContextImpl.importClassedModel(PortletDataContextImpl.java:1548)
                  at com.liferay.journal.internal.exportimport.data.handler.JournalFolderStagedModelDataHandler.doImportStagedModel(JournalFolderStagedModelDataHandler.java:180)
                  at com.liferay.journal.internal.exportimport.data.handler.JournalFolderStagedModelDataHandler.doImportStagedModel(JournalFolderStagedModelDataHandler.java:47)
                  at com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.importStagedModel(BaseStagedModelDataHandler.java:392)
                  at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:456)
                  at com.liferay.exportimport.kernel.lar.StagedModelDataHandlerUtil.importStagedModel(StagedModelDataHandlerUtil.java:442)
                  at com.liferay.journal.internal.exportimport.data.handler.JournalPortletDataHandler.doImportData(JournalPortletDataHandler.java:335)
                  at com.liferay.exportimport.kernel.lar.BasePortletDataHandler.importData(BasePortletDataHandler.java:385)
                  at com.liferay.exportimport.internal.controller.PortletImportControllerImpl.importPortletData(PortletImportControllerImpl.java:411)
                  at com.liferay.exportimport.internal.controller.PortletImportControllerImpl.importPortletData(PortletImportControllerImpl.java:342)
                  at com.liferay.exportimport.internal.controller.PortletImportControllerImpl.doImportPortletInfo(PortletImportControllerImpl.java:1057)
                  at com.liferay.exportimport.internal.controller.PortletImportControllerImpl.importFile(PortletImportControllerImpl.java:295)
                  at com.liferay.portlet.exportimport.service.impl.ExportImportLocalServiceImpl.importPortletInfo(ExportImportLocalServiceImpl.java:453)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                  at java.lang.reflect.Method.invoke(Method.java:498)
                  at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:50)
                  at com.liferay.portal.spring.transaction.TransactionInterceptor.lambda$invoke$0(TransactionInterceptor.java:64)
                  at com.liferay.portal.spring.transaction.DefaultTransactionExecutor._execute(DefaultTransactionExecutor.java:128)
                  at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:51)
                  at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:62)
                  at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:57)
                  at com.liferay.portal.spring.aop.AopInvocationHandler.invoke(AopInvocationHandler.java:49)
                  at com.sun.proxy.$Proxy152.importPortletInfo(Unknown Source)
                  at com.liferay.exportimport.kernel.service.ExportImportLocalServiceUtil.importPortletInfo(ExportImportLocalServiceUtil.java:211)
                  at com.liferay.exportimport.internal.background.task.PortletImportBackgroundTaskExecutor$PortletImportCallable.call(PortletImportBackgroundTaskExecutor.java:138)
                  at com.liferay.exportimport.internal.background.task.PortletImportBackgroundTaskExecutor$PortletImportCallable.call(PortletImportBackgroundTaskExecutor.java:124)
                  at com.liferay.portal.spring.transaction.DefaultTransactionExecutor._execute(DefaultTransactionExecutor.java:128)
                  at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:51)
                  at com.liferay.portal.spring.transaction.TransactionInvokerImpl.invoke(TransactionInvokerImpl.java:39)
                  at com.liferay.portal.kernel.transaction.TransactionInvokerUtil.invoke(TransactionInvokerUtil.java:28)
                  at com.liferay.exportimport.internal.background.task.PortletImportBackgroundTaskExecutor.execute(PortletImportBackgroundTaskExecutor.java:88)
                  at com.liferay.portal.background.task.internal.SerialBackgroundTaskExecutor.execute(SerialBackgroundTaskExecutor.java:62)
                  at com.liferay.portal.kernel.backgroundtask.DelegatingBackgroundTaskExecutor.execute(DelegatingBackgroundTaskExecutor.java:41)
                  at com.liferay.portal.background.task.internal.ThreadLocalAwareBackgroundTaskExecutor.execute(ThreadLocalAwareBackgroundTaskExecutor.java:72)
                  at com.liferay.portal.background.task.internal.messaging.BackgroundTaskMessageListener.doReceive(BackgroundTaskMessageListener.java:132)
                  at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26)
                  at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:74)
                  at com.liferay.portal.kernel.messaging.ParallelDestination$1.run(ParallelDestination.java:52)
                  at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:752)
                  at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:664)
                  at java.lang.Thread.run(Thread.java:748)
          Caused by: com.liferay.portal.kernel.exception.NoSuchWorkflowDefinitionLinkException: No WorkflowDefinitionLink exists with the primary key 35502
                  at com.liferay.portal.service.persistence.impl.WorkflowDefinitionLinkPersistenceImpl.findByPrimaryKey(WorkflowDefinitionLinkPersistenceImpl.java:3355)
                  at com.liferay.portal.service.persistence.impl.WorkflowDefinitionLinkPersistenceImpl.findByPrimaryKey(WorkflowDefinitionLinkPersistenceImpl.java:3374)
                  at com.liferay.portal.service.base.WorkflowDefinitionLinkLocalServiceBaseImpl.getWorkflowDefinitionLink(WorkflowDefinitionLinkLocalServiceBaseImpl.java:247)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                  at java.lang.reflect.Method.invoke(Method.java:498)
                  at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:50)
                  at com.liferay.portal.spring.transaction.TransactionInterceptor.lambda$invoke$0(TransactionInterceptor.java:64)
                  at com.liferay.portal.spring.transaction.DefaultTransactionExecutor._execute(DefaultTransactionExecutor.java:128)
                  at com.liferay.portal.spring.transaction.DefaultTransactionExecutor.execute(DefaultTransactionExecutor.java:51)
                  at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:62)
                  at com.liferay.portal.spring.aop.AopMethodInvocationImpl.proceed(AopMethodInvocationImpl.java:57)
                  at com.liferay.portal.spring.aop.AopInvocationHandler.invoke(AopInvocationHandler.java:49)
                  at com.sun.proxy.$Proxy121.getWorkflowDefinitionLink(Unknown Source)
                  at com.liferay.portal.kernel.service.WorkflowDefinitionLinkLocalServiceUtil.getWorkflowDefinitionLink(WorkflowDefinitionLinkLocalServiceUtil.java:305)
                  at com.liferay.exportimport.internal.lar.PortletDataContextImpl._importWorkflowDefinitionLink(PortletDataContextImpl.java:2979)
                  ... 44 more

      The solution implemented in this LPS, it also fixes LPS-99881

       

      Steps to reproduce LPS-99881:

      1. Create Site1
      2. Go to Content => Webcontent section
      3. Create two Webcontent structures: Str1 and Str2
      4. Create a Webcontent folder
      5. Edit created Webcontent folder and setup both Str1 and Str2 structures with "Single Approver" workflow
      6. Export to LAR file
      7. Create Site2
      8. Import previous exported LAR
      9. Check configured workflows in Webcontent folder
        • Expected behaviour: both structures are configured with "Single Approver" workflow
        • Wrong behaviour: only one structure is configured with "Single Approver" workflow

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  1 year, 5 weeks ago

                  Packages

                  Version Package
                  7.0.0 DXP FP86
                  7.0.X
                  7.1.10 DXP FP14
                  7.1.10.3 SP3
                  7.1.X
                  7.2.10 DXP FP2
                  7.2.10.1 DXP SP1
                  7.2.X
                  7.2.1 CE GA2
                  Master