How to store/retrieve multiple documents in Alfresco using Community version?

Hi Everyone,

I am using Bonita Community 7.2.3. I have some questions and I hope you can help me.

**Scenario **: I have a form where a user is able to add multiple documents to collection by clicking on ‘Add’ button and removing them from collection if not needed by clicking on ‘Remove’ button.

I have to upload all documents to alfresco and store all document_ids in a BDM. I have to display/retrieve all the uploaded document links using the stored document ids in the next step.

Questions:
Do I have to use multiple alfresco connectors to the process to upload all documents?
Do I have to provide multiple documents as inputs in the beginning of the process?(Here my document upload count depends on user. He clicks on ‘Add’ to upload more documents)
Do I have to select ‘Multiple’ option for one document and use the same document for all uploaded documents? If so how can I do that?

Please help me by providing some examples to above scenario. I have tried for almost 2 weeks. Please do the needful.

Thanks,
Varshini

Questions:

We don’t do Alfresco but here are some answers based on how we do it for Databases:

Do I have to use multiple alfresco connectors to the process to upload all documents?

No, you can use one Alfresco Connector but you execute it multiple times using the MultiInstantiation protocol.

The way we did this was to create a separate process (upLoadToAlfresco). This is then called from a MultiInstantiation service step that passes each document to the Alfresco step which then does the upload.

Do I have to provide multiple documents as inputs in the beginning of the process? (Here my document upload count depends on user. He clicks on ‘Add’ to upload more documents)

No - if it’s zero then you won’t upload, if it’s one or more then it will upload only that number…maybe this question needs clarity?

Do I have to select ‘Multiple’ option for one document and use the same document for all uploaded documents? If so how can I do that?

Not sure where you are with this question. I will assume you are talking about documents in the BDM, Asking a question without context is difficult to answer.

In the BDM add Attribute documents as type Long and click Multiple, this will allow zero one or multiple documents.

When you do this you can see the Initialization Script for the BDM creates a list for documents and then can add documentID’s to the list. You may need to add a bit of code here to get the actual documentID.

regards
Seán

PS: If this reply answers your question, please mark as resolved.

Hi Sean,
Thanks for the reply. I apologize for asking questions without context. I hope my clarification below clears the confusion.

Questions:

  1. Do I have to use multiple alfresco connectors to the process to upload all documents?
    The workaround you mentioned i.e Multi-Instantiation service task is the only way to upload list of documents? Can you please provide an example?

  2. Do I have to provide multiple documents as inputs in the beginning of the process?(Here my document upload count depends on user. He clicks on ‘Add’ to upload more documents)
    Clarification: Usually we add one document in the process and set it to ‘Single’ document and set its default value to our form(i.e upload file widget) contract input.
    I meant adding multiple documents prior in the process. In my form when we click on ‘Add’ document, we can upload a document which adds to the collection. So there will be no specific count for the documents that gets uploaded. So I can’t provide multiple documents as inputs on assumption.
    I want to know how to manage all documents in the collection and ‘upload them to alfresco/store uploaded documents file name and document_id to database’ at a same time

  3. Do I have to select ‘Multiple’ option for one document and use the same document for all uploaded documents? If so how can I do that?
    Clarification: Usually we add one document in the process and set it to ‘Multiple’ document and set its default value to our form(i.e upload file collection widget) contract input.
    If I upload all the documents how can manage them to get stored in alfresco and capture the document_id for each document. Can you please provide an example/script to capture all document_ids and store them to my BDM database?

I didn’t understand what you meant by your answer “In the BDM add Attribute documents as type Long and click Multiple, this will allow zero one or multiple documents”. Can you please elaborate on that?

Sorry for the long post. I am trying to explain the things clearly. Please let me know, if it still doesn’t explain my point.
Thanks for being patient.
Any help would be appreciated!!! HELP!!!

Thank you,
Varshini