[MNT-18147] Retrieve Alfresco Properties task fails if Publish to Alfresco is called twice before Created: 07-Nov-16  Updated: 08-May-20  Resolved: 01-Apr-20

Status: Closed
Project: Service Packs and Hot Fixes
Component/s: APS Tasks
Affects Version/s: Alfresco Activiti 1.5.2, Alfresco Process Services 1.8.1
Fix Version/s: Alfresco Process Services 1.11

Type: Service Pack Request
Reporter: Julien Guay [X] (Inactive) Assignee: Closed Bugs (Inactive)
Resolution: Fixed Votes: 1
Labels: triaged_Jul2019
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Activiti 1.5.2, APS 1.8.1
Alfresco 5.1.1.6, ACS 5.2.3


Attachments: Java Source File AlfrescoContentService.java     PNG File process.png    
Issue Links:
Cloners
Bug Priority:
Category 1
ACT Numbers:

00764443, 00965524

Sprint: Docs Sprint 18
Epic Link: PAD - APS Customer Requests
Delivery Team: APS

 Description   

Description

  • Retrieve Alfresco Properties task fails if Publish to Alfresco is called twice

Steps to reproduce
1.) Install Alfresco One 5.1.1.6 running on default http port 8080 and via Alfresco Share create a public site called "publicsite" as administrator.
2.) Install Activiti 1.5.2 using port 8090.
3.) In Activiti App go to Identity Management -> Tenants and select "Alfresco Repositories" and add the config for your Alfresco repository like the following and save:

Name: localhost8080
Alfresco tenant: (Leave blank)
Repository base url: http://localhost:8080/alfresco
Share base url: http://localhost:8080/share
Alfresco version: 4.2 (or higher)
Alfresco Share Connector: (leave unticked)

4.) Via the "Personal" tab (http://localhost:8090/activiti-app/idm/#/profile) click on "localhost8080" under "Alfresco Repositories" and enter the administrator credentials for Alfresco One
5.) Go to Kickstart and create a new Process with BPMN Editor called "PublishTwiceAndRetrieveProperties"
6.) On the Start Event, select "Referenced form" and create a new form called "Upload file"
7.) Add an "Attach" form control and edit its label to "Publish to Alfresco:"
8.) Click on Save / Save and close editor to close form editor.
9.) Drag and drop a "Publish to Alfresco task" into the model and add a sequence flow from the Start event
10.) Click on "Alfresco destination" for this task and set the following:

Account: "localhost8080"
Destination: Click on "Select folder..." and select "localhost8080 > publicsite > documentLibrary "
Publish as: Process initiator
Subfolder: Leave unticked "Create or reuse subfolder"

11.) Copy/Paste task configured in step 10 and add a sequence flow from the first to the copied "Publish to Alfresco" task
12.) Drag and drop a "Retrieve Alfresco properties" task into the model and add a sequence flow from the second "Publish to Alfresco" task
13.) For its "Alfresco properties" configure :

File: "publishtoalfresco"
Properties: Add property with File Property: "cm:title", with property type "string" and select New Variable "Title"

14.) Add a human task to the model with a new form with only a displayvalue form control on variable "Title"
15.) Add an End Event and save the process. Process should look like in attached process.png.
16.) Go to Apps and create an app called "PublishTwiceAndRetrieveProperties", add included model "PublishTwiceAndRetrieveProperties", save and publish
17.) Via the app from the landing page start the process and upload a document in the start form and complete.

Expected Behaviour

  • There should not be any error in the Activiti logs. The user task form from the "Retrieve Alfresco Properties" task should use the latest published document version and display its properties.

Observed Behaviour

  • The process will upload the file twice in Alfresco (version 2.0) and fail to execute the Alfresco Retrieve Properties task and the user task is not reached at all.
  • The following exception occurs
    04:44:48,699 [pool-3-thread-1] ERROR org.activiti.engine.impl.asyncexecutor.ExecuteAsyncRunnable  - Job 232556 failed
    com.activiti.alfrescoconnector.exception.AlfrescoConnectorException: UNEXPECTED Error while getting metadata properties
    	at com.activiti.alfrescoconnector.service.AlfrescoContentService.getContentMetadata(AlfrescoContentService.java:256)
    	at com.activiti.service.runtime.RelatedContentProcessor.getContentMetadata(RelatedContentProcessor.java:309)
    	at com.activiti.runtime.activiti.AlfrescoGetMetadataDelegate.execute(AlfrescoGetMetadataDelegate.java:68)
    	at org.activiti.engine.impl.delegate.JavaDelegateInvocation.invoke(JavaDelegateInvocation.java:34)
    	at org.activiti.engine.impl.delegate.DelegateInvocation.proceed(DelegateInvocation.java:37)
    	at org.activiti.engine.impl.delegate.DefaultDelegateInterceptor.handleInvocation(DefaultDelegateInterceptor.java:25)
    	at org.activiti.engine.impl.bpmn.behavior.ServiceTaskDelegateExpressionActivityBehavior.execute(ServiceTaskDelegateExpressionActivityBehavior.java:96)
    	at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:60)
    	at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:97)
    	at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:665)
    	at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:658)
    	at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionNotifyListenerStart.eventNotificationsCompleted(AtomicOperationTransitionNotifyListenerStart.java:52)
    	at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:56)
    	at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:97)
    	at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:665)
    	at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:658)
    	at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:49)
    	at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:97)
    	at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:665)
    	at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:658)
    	at org.activiti.engine.impl.pvm.runtime.AtomicOperationTransitionCreateScope.execute(AtomicOperationTransitionCreateScope.java:49)
    	at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:97)
    	at org.activiti.engine.impl.jobexecutor.AsyncContinuationJobHandler.execute(AsyncContinuationJobHandler.java:35)
    	at org.activiti.engine.impl.persistence.entity.JobEntity.execute(JobEntity.java:85)
    	at org.activiti.engine.impl.persistence.entity.MessageEntity.execute(MessageEntity.java:34)
    	at org.activiti.engine.impl.cmd.ExecuteAsyncJobCmd.execute(ExecuteAsyncJobCmd.java:52)
    	at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24)
    	at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57)
    	at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47)
    	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
    	at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45)
    	at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
    	at com.activiti.addon.cluster.interceptor.GatherMetricsCommandInterceptor.execute(GatherMetricsCommandInterceptor.java:57)
    	at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)
    	at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)
    	at org.activiti.engine.impl.asyncexecutor.ExecuteAsyncRunnable.executeJob(ExecuteAsyncRunnable.java:95)
    	at org.activiti.engine.impl.asyncexecutor.ExecuteAsyncRunnable.run(ExecuteAsyncRunnable.java:50)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    	at java.lang.Thread.run(Thread.java:745)
    Caused by: org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException: Object not found: bbffe476-5a42-4a9f-ada4-19b7aaf380cd;pwc
    	at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(AbstractAtomPubService.java:467)
    	at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.read(AbstractAtomPubService.java:613)
    	at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.getObjectInternal(AbstractAtomPubService.java:836)
    	at org.apache.chemistry.opencmis.client.bindings.spi.atompub.ObjectServiceImpl.getObject(ObjectServiceImpl.java:619)
    	at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getObject(SessionImpl.java:410)
    	at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getObject(SessionImpl.java:388)
    	at com.activiti.alfrescoconnector.service.AlfrescoContentService.getContentMetadata(AlfrescoContentService.java:240)
    	... 39 more
    
    
  • The Method updateOrCreateDocuments stores the wrong documentId in Activiti, specifically it stores the cmis:objectId of the working copy instead of the new objectId generated by the "pwc.checkin(...)". This results in an exception when trying to do anything else (like getting metadata properties) with this file.
  • Retrieve Properties fails with UNEXPECTED error in tomcat

Supporting evidence

  • Reproduced with latest Activiti 1.5.2 release


 Comments   
Comment by Mark Howarth [X] (Inactive) [ 01-Apr-20 ]

Fixed in release APS 1.11, released 31st March 2020

Generated at Tue May 18 06:07:12 BST 2021 using Jira 7.13.15#713015-sha1:7c5ddd2c3e1709974ae9c48c17df8edd3919fe2c.