[MNT-18170] Update Alfresco Properties task fails updating properties after a publishing to Alfresco task if a new version of the published document was created in Alfresco in between Created: 07-Nov-16  Updated: 07-Sep-20  Resolved: 07-Sep-20

Status: Verified
Project: Service Packs and Hot Fixes
Component/s: APS Tasks
Affects Version/s: Alfresco Activiti 1.5.2, Alfresco Process Services 1.7, Alfresco Process Services 1.9
Fix Version/s: Alfresco Process Services 1.12

Type: Service Pack Request
Reporter: Julien Guay [X] (Inactive) Assignee: Raluca Plugariu
Resolution: Fixed Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Activiti 1.5.2
Alfresco 5.1.1.6


Issue Links:
Cloners
Related
is related to by MNT-18164 If document is linked to a process fr... Closed
Bug Priority:
Category 2
ACT Numbers:

00764417, 00976173, 00988886

Sprint: Docs Sprint 18, APS Sprint 30
Story Points: 3

 Description   

Description
Update Alfresco Properties task fails after publishing to Alfresco task if a new version of the published document was created in Alfresco in between

Steps to reproduce
1.) Install Alfresco One 5.1.1.6 running on default 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 App and create a new Process with BPMN Editor called "UpdatePropertyPointsToOldVersion"
6.) On the Start Event, select "Referenced form" and create new form called "Upload file"
7.) Add "Attach" form control and edit label "Publish to Alfresco:"
8.) Click on Save / Save and close editor
9.) Drag and drop a "Publish to Alfresco task" into the model and add a sequence flow from the Start event to it
10.) Click on "Alfresco destination" 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.) Add a human task and name it "Edit Title" Connect the publish to Alfresco task to the human task.
12.) Select "Referenced form" for the human task and create a new form called "FileMetadata"
13.) Add a text form control and edit its label to "Title"
14.) Drag and drop an "Update Alfresco properties" task to the model and add a sequence flow from the human task to it
15.) For the Update Alfresco properties tasks configure the "Alfresco properties" as followed:

File: "publishtoalfresco"
Properties: Add property name "cm:title", with property type "string" and select form field "Title"

16.) Add an End event and connect the Update Alfresco properties task with it. Validate and save the process.
17.) Via Kickstart create an app called "UpdatePropertyPointsToOldVersion" and add process model "UpdatePropertyPointsToOldVersion". Save and publish the app
18.) Validate the process is working: Open the application and start a process, upload a file in the start form. In the following task edit the title field and complete the task to finish the process. Check in Alfresco Share that the document was added and its title property is as set.
19.) Start another process and upload another document. Do not change the title field yet.
20.) In Share, browse to the file just uploaded and add a new version of the same file. Version is now 1.1 instead of 1.0
21.) Back in Activiti app, proceed to edit the title and complete the task.
22. ) Review document and it´s title property in Alfresco Share

Expected Behaviour

  • Update properties task should have worked on the latest version of the document.

Observed Behaviour

  • Property was not updated by the task and the following exception occurs in Activiti logs:
    10:08:53,919 [pool-1-thread-1] ERROR org.activiti.engine.impl.interceptor.CommandContext  - Error while closing command context com.activiti.alfrescoconnector.exception.AlfrescoConnectorException: UNEXPECTED Error while getting metadata properties
            at com.activiti.alfrescoconnector.service.AlfrescoContentService.putContentMetadata(AlfrescoContentService.java:277)
            at com.activiti.service.runtime.RelatedContentProcessor.putContentMetadata(RelatedContentProcessor.java:342)
            at com.activiti.runtime.activiti.AlfrescoPutMetadataDelegate.execute(AlfrescoPutMetadataDelegate.java:69)
            at org.activiti.engine.impl.delegate.JavaDelegateInvocation.invoke(JavaDelegateInvocation.java:34)
            at org.activiti.engine.impl.delegate.DelegateInvocation.proceed(DelegateInvocation.java:37)
    
  • The related method putContentMetadata does not check if it has the latest version of a document while trying to update the metadata of a document using cmis:
    This results in the given exception if in the meanwhile (between the initial upload of a document using a "Publish to Alfresco Task" and the execution of a "Update Alfresco properties" Task) a new version of the document has been uploaded in Alfresco.

Supporting evidence

  • Reproduced in latest Activiti release 1.5.2


 Comments   
Comment by Mark Howarth [X] (Inactive) [ 23-Aug-19 ]

Reassigning to Doug Gruber, the new APS PM.

Comment by Mark Howarth [X] (Inactive) [ 02-Dec-19 ]

Assigning to Mark Howarth [X] as PM for APS.

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