- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2018 07:05 AM
Hi!,
I have a problem, I have a process with a loop with form, but in the next iterations the form not is initialized.
Can I do initialize field 'uploadfile' in begin each iteration?
Regards,
Fernando
- Labels:
-
Alfresco Process Services
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2018 10:15 AM
yeah, you got to tweak the code to meet your requirement. May be instead of delete, you may want to do something like relatedContent.setField(null);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2018 12:30 PM
The best way to do that is to put a script/service task in the loop back to delete the existing file. You can use the relatedContentService api (com.activiti.service.runtime.RelatedContentService) to do this..I have a sample groovy script below..the 'uploadfield' will need to be replaced with your upload field id
def page = null;int pageNumber = 0; while ((page == null) || (page.hasNext())) { page = relatedContentService .getFieldContentForProcessInstance( execution.getProcessInstanceId(), 'uploadfield', 50, pageNumber); relatedContentService.deleteRelatedContent(page.getContent()); pageNumber++;}
Cheers,
Ciju
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2018 09:32 AM
Hi Ciju Joseph
But I do not want delete the previous files, I need clean fields for a new upload.
Cheers,
Fernando
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2018 10:15 AM
yeah, you got to tweak the code to meet your requirement. May be instead of delete, you may want to do something like relatedContent.setField(null);
