How to implement multiple file upload for documents

Aware IM does not support “multiple allowed” for attributes of the Document type, however, there is a way for you to implement “Multiple file upload” functionality when the user selects several documents at once and uploads them all to the system. In order to implement this functionality you need the following:

  1. Define a business object representing your document. This business object should have at least one attribute of the Document type. It can have other attributes as well, such as Description of the document, type etc
  2. Make sure that this object can be created automatically, i.e. if it has some mandatory attributes, the initial values for these attributes are provided. This is because Aware IM will be creating instances of this object behind the scenes and if some required values are not initialised properly by rules Aware IM will not be able to create instances of the object
  3. Define a multiple reference to this object in the business object that will store the documents. In other words, rather than defining a Document attribute in this object you define a multiple reference to the object that includes this Document. For example, if you want to define attachments to your Order object, first define an OrderAttachment object with the Attachment Document attribute and then define multiple reference attribute Attachments (of the OrderAttachment type) to the Order object
  4. Go to the Presentation option of the multiple reference attribute (Attachments in the example above) and go to the Panel Operations. Then add the Add New operation.
  5. Select “Use multi-file upload for document attribute” as the parameter of the operation and specify the name of the Document attribute. At run time the user will be able to select multiple files to upload and for each file Aware IM will create an instance of the Document wrapper object (ObjectAttachment), upload the file into the Document attribute of this object and attach the instance of this object as a reference (to the Order object)

Starting from version 5.7 it is now possible to implement multiple file upload as a process. To do this you need to write a process that assumes that the Context contains a predefined business object called FileItem. This object has one attribute of the Document type called Doc. The process receives multiple instances of this object and it can do something with the documents stored in the Doc attribute – for example, copy them to some other business object, for example:

CREATE Photo FOR EACH FileItem WITH Photo.Picture = FileItem.Doc 
  • Last modified: 2022/09/13 18:15