12-13-2019 04:44 AM
Hey guys,
I searched everything and can't find an appropriate answer - so I need your help!
My Process made with APS (Enterprise) starts with a form where the users can upload a contract (the id in that field is "contract"). Thing is, I want to unify that file to the filename "contract.docx".
Example: User uploads file "something.docx" and then it's published to ACS as "contract.docx".
For this I know I have to call the variable containing this file, but I can't find it - and the mess is that it is not stored in "contract", like all other variables from formfields are handled. In activiti-admin I can see the variable "contract" but it is "null".
So, do you know what to call exactly and further - how to change the filename?
Thanks and cheers,
Jannik
12-13-2019 05:50 AM
Fortunately I found something related. I changed the code a bit to my needs and it looks like this:
import com.activiti.service.runtime.RelatedContentService; import com.activiti.domain.runtime.RelatedContent; List<RelatedContent> contentList = relatedContentService.getFieldContentForProcessInstance(execution.getProcessInstanceId(), "contract", 1, 0).getContent(); RelatedContent content = contentList.get(0); content.setName("Contract");
This works superb. Maybe it could help you as well. Just parse it to a groovy Scripttasks and your are g2g.
Cheers!
12-13-2019 05:50 AM
Fortunately I found something related. I changed the code a bit to my needs and it looks like this:
import com.activiti.service.runtime.RelatedContentService; import com.activiti.domain.runtime.RelatedContent; List<RelatedContent> contentList = relatedContentService.getFieldContentForProcessInstance(execution.getProcessInstanceId(), "contract", 1, 0).getContent(); RelatedContent content = contentList.get(0); content.setName("Contract");
This works superb. Maybe it could help you as well. Just parse it to a groovy Scripttasks and your are g2g.
Cheers!
Explore our Alfresco products with the links below. Use labels to filter content by product module.