Delete an uploaded file

<< Click to Display Table of Contents >>

Navigation:  Bizagi Studio > Process wizard > Business Rules > Business rules examples > File management with expressions >

Delete an uploaded file

In Bizagi, you may delete the content of File-type attributes without an end user's intervention using an expression.

 

For example, in a Loans Request Process the Process Entity is called Request. Assume in this entity there is a File-type attribute called HistoryFile that will store documents that are attached in several activities of the Process.

 

 

AdvanceFilesManagement1

 

To delete the uploaded files use this statement:

 

Me.deleteAllCollectionItems("Request.HistoryFile");

 

DO NOT USE this statement as THE VALUE OF THE UPLOADED FILE WILL REMAIN UNCHANGED:

 

Me.setXPath("Request.HistoryFile", null)

 

 

AdvanceFilesManagement16

 

 

Note this expression is similar to the ones used to delete records to a collection. This is because file-type attributes are treated as a collection of files, for this reason you can store many files in a single attribute.